aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.md36
-rw-r--r--meta-ivi-common/conf/layer.conf10
-rw-r--r--meta-ivi-common/recipes-multimedia/audiomanager/audiomanager-plugins/0001-some-adoptions.patch7854
-rw-r--r--meta-ivi-common/recipes-multimedia/audiomanager/audiomanager-plugins_7.3.bb42
4 files changed, 7942 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..920bb7d
--- /dev/null
+++ b/README.md
@@ -0,0 +1,36 @@
+AudioManagerPlugins
+============
+
+## Description
+
+**AudioManagerPlugins** provides support for GENIVI AudioManagerPlugins on top of AGL.
+Note that it requires AudioManager support to be built into AGL.
+
+### Install on top of an existing AGL image
+
+* Grab all required Yocto layers with the following commands:
+```
+$ git clone https://git.automotivelinux.org/gerrit/p/staging/AudioManagerPlugins.git
+```
+
+* In your existing _"$BUILD_DIR/conf/bblayers.conf"_ file, add:
+```
+ /home/SDK/AGL/poky/../AudioManagerPlugins/meta-ivi-common \
+```
+_("/home/SDK/AGL" being the directory containing your Yocto layers)_
+
+* In your existing _"$BUILD_DIR/conf/local.conf"_ file, add:
+```
+IMAGE_INSTALL_append = " audiomanager-plugins"
+```
+
+* Rebuild your image:
+```
+$ bitbake agl-demo-platform
+```
+
+## Known issues
+
+* **AudioManagerPlugins** supports building with CAPI support via PACKAGECONFIG, but for that one
+ needs to add the common-api-c++-dbus recipe and make sure AudioManager is also built with CAPI
+ support.
diff --git a/meta-ivi-common/conf/layer.conf b/meta-ivi-common/conf/layer.conf
new file mode 100644
index 0000000..8076954
--- /dev/null
+++ b/meta-ivi-common/conf/layer.conf
@@ -0,0 +1,10 @@
+# We have a conf and classes directory, add to BBPATH
+BBPATH .= ":${LAYERDIR}"
+
+# We have recipes-* directories, add to BBFILES
+BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
+ ${LAYERDIR}/recipes-*/*/*.bbappend"
+
+BBFILE_COLLECTIONS += "ivi-common"
+BBFILE_PATTERN_app-framework = "^${LAYERDIR}/"
+BBFILE_PRIORITY_app-framework = "20"
diff --git a/meta-ivi-common/recipes-multimedia/audiomanager/audiomanager-plugins/0001-some-adoptions.patch b/meta-ivi-common/recipes-multimedia/audiomanager/audiomanager-plugins/0001-some-adoptions.patch
new file mode 100644
index 0000000..f878049
--- /dev/null
+++ b/meta-ivi-common/recipes-multimedia/audiomanager/audiomanager-plugins/0001-some-adoptions.patch
@@ -0,0 +1,7854 @@
+From f6824b01f88f5db48001517d34b6d09c43c9d112 Mon Sep 17 00:00:00 2001
+From: Christian Linke <christian.linke@bmw.de>
+Date: Wed, 7 Oct 2015 19:34:14 +0100
+Subject: [PATCH] some adoptions
+Upstream-Status: Backport [http://git.projects.genivi.org/?p=AudioManagerPlugins.git;a=commit;h=f6824b01f88f5db48001517d34b6d09c43c9d112]
+
+---
+ .../test/MockIAmCommandReceive.h | 108 +-
+ PluginCommandInterfaceDbus/CMakeLists.txt | 6 +-
+ .../include/configCommandDbus.h | 2 +-
+ .../src/CAmCommandSenderDbus.cpp | 2 +-
+ PluginCommandInterfaceDbus/test/CMakeLists.txt | 7 +-
+ .../test/MockIAmCommandReceive.h | 110 +-
+ PluginRoutingInterfaceDBus/CMakeLists.txt | 113 --
+ .../cmake/FindAudioManager.cmake | 31 -
+ PluginRoutingInterfaceDBus/cmake/config.cmake | 6 -
+ .../include/CAmDbusMessageHandler.h | 147 ---
+ PluginRoutingInterfaceDBus/include/CAmDbusSend.h | 55 -
+ .../include/CAmRoutingSenderDbus.h | 96 --
+ .../include/IAmRoutingReceiverShadow.h | 142 ---
+ .../include/RoutingReceiver.xml | 237 ----
+ .../include/RoutingSender.xml | 76 --
+ .../include/configRoutingDbus.h | 6 -
+ .../src/CAmDbusMessageHandler.cpp | 1194 --------------------
+ PluginRoutingInterfaceDBus/src/CAmDbusSend.cpp | 154 ---
+ .../src/CAmRoutingSenderDbus.cpp | 408 -------
+ .../src/IAmRoutingReceiverShadow.cpp | 975 ----------------
+ PluginRoutingInterfaceDbus/CMakeLists.txt | 108 ++
+ .../cmake/FindAudioManager.cmake | 31 +
+ PluginRoutingInterfaceDbus/cmake/config.cmake | 6 +
+ .../include/CAmDbusMessageHandler.h | 147 +++
+ PluginRoutingInterfaceDbus/include/CAmDbusSend.h | 55 +
+ .../include/CAmRoutingSenderDbus.h | 96 ++
+ .../include/IAmRoutingReceiverShadow.h | 143 +++
+ .../include/RoutingReceiver.xml | 237 ++++
+ .../include/RoutingSender.xml | 76 ++
+ .../include/configRoutingDbus.h | 6 +
+ .../src/CAmDbusMessageHandler.cpp | 1194 ++++++++++++++++++++
+ PluginRoutingInterfaceDbus/src/CAmDbusSend.cpp | 155 +++
+ .../src/CAmRoutingSenderDbus.cpp | 410 +++++++
+ .../src/IAmRoutingReceiverShadow.cpp | 977 ++++++++++++++++
+ 34 files changed, 3761 insertions(+), 3755 deletions(-)
+ delete mode 100644 PluginRoutingInterfaceDBus/CMakeLists.txt
+ delete mode 100644 PluginRoutingInterfaceDBus/cmake/FindAudioManager.cmake
+ delete mode 100644 PluginRoutingInterfaceDBus/cmake/config.cmake
+ delete mode 100644 PluginRoutingInterfaceDBus/include/CAmDbusMessageHandler.h
+ delete mode 100644 PluginRoutingInterfaceDBus/include/CAmDbusSend.h
+ delete mode 100644 PluginRoutingInterfaceDBus/include/CAmRoutingSenderDbus.h
+ delete mode 100644 PluginRoutingInterfaceDBus/include/IAmRoutingReceiverShadow.h
+ delete mode 100644 PluginRoutingInterfaceDBus/include/RoutingReceiver.xml
+ delete mode 100644 PluginRoutingInterfaceDBus/include/RoutingSender.xml
+ delete mode 100644 PluginRoutingInterfaceDBus/include/configRoutingDbus.h
+ delete mode 100644 PluginRoutingInterfaceDBus/src/CAmDbusMessageHandler.cpp
+ delete mode 100644 PluginRoutingInterfaceDBus/src/CAmDbusSend.cpp
+ delete mode 100644 PluginRoutingInterfaceDBus/src/CAmRoutingSenderDbus.cpp
+ delete mode 100644 PluginRoutingInterfaceDBus/src/IAmRoutingReceiverShadow.cpp
+ create mode 100644 PluginRoutingInterfaceDbus/CMakeLists.txt
+ create mode 100644 PluginRoutingInterfaceDbus/cmake/FindAudioManager.cmake
+ create mode 100644 PluginRoutingInterfaceDbus/cmake/config.cmake
+ create mode 100644 PluginRoutingInterfaceDbus/include/CAmDbusMessageHandler.h
+ create mode 100644 PluginRoutingInterfaceDbus/include/CAmDbusSend.h
+ create mode 100644 PluginRoutingInterfaceDbus/include/CAmRoutingSenderDbus.h
+ create mode 100644 PluginRoutingInterfaceDbus/include/IAmRoutingReceiverShadow.h
+ create mode 100644 PluginRoutingInterfaceDbus/include/RoutingReceiver.xml
+ create mode 100644 PluginRoutingInterfaceDbus/include/RoutingSender.xml
+ create mode 100644 PluginRoutingInterfaceDbus/include/configRoutingDbus.h
+ create mode 100644 PluginRoutingInterfaceDbus/src/CAmDbusMessageHandler.cpp
+ create mode 100644 PluginRoutingInterfaceDbus/src/CAmDbusSend.cpp
+ create mode 100644 PluginRoutingInterfaceDbus/src/CAmRoutingSenderDbus.cpp
+ create mode 100644 PluginRoutingInterfaceDbus/src/IAmRoutingReceiverShadow.cpp
+
+diff --git a/PluginCommandInterfaceCAPI/test/MockIAmCommandReceive.h b/PluginCommandInterfaceCAPI/test/MockIAmCommandReceive.h
+index 05a4562..0732553 100644
+--- a/PluginCommandInterfaceCAPI/test/MockIAmCommandReceive.h
++++ b/PluginCommandInterfaceCAPI/test/MockIAmCommandReceive.h
+@@ -26,61 +26,63 @@ namespace am {
+
+ class MockIAmCommandReceive : public IAmCommandReceive {
+ public:
+- MOCK_CONST_METHOD1(getInterfaceVersion,
+- void(std::string& version));
+- MOCK_METHOD3(connect,
+- am_Error_e(const am_sourceID_t sourceID, const am_sinkID_t sinkID, am_mainConnectionID_t& mainConnectionID));
+- MOCK_METHOD1(disconnect,
+- am_Error_e(const am_mainConnectionID_t mainConnectionID));
+- MOCK_METHOD2(setVolume,
+- am_Error_e(const am_sinkID_t sinkID, const am_mainVolume_t volume));
+- MOCK_METHOD2(volumeStep,
+- am_Error_e(const am_sinkID_t sinkID, const int16_t volumeStep));
+- MOCK_METHOD2(setSinkMuteState,
+- am_Error_e(const am_sinkID_t sinkID, const am_MuteState_e muteState));
+- MOCK_METHOD2(setMainSinkSoundProperty,
+- am_Error_e(const am_MainSoundProperty_s& soundProperty, const am_sinkID_t sinkID));
+- MOCK_METHOD2(setMainSourceSoundProperty,
+- am_Error_e(const am_MainSoundProperty_s& soundProperty, const am_sourceID_t sourceID));
+- MOCK_METHOD1(setSystemProperty,
+- am_Error_e(const am_SystemProperty_s& property));
+- MOCK_CONST_METHOD1(getListMainConnections,
+- am_Error_e(std::vector<am_MainConnectionType_s>& listConnections));
+- MOCK_CONST_METHOD1(getListMainSinks,
+- am_Error_e(std::vector<am_SinkType_s>& listMainSinks));
+- MOCK_CONST_METHOD1(getListMainSources,
+- am_Error_e(std::vector<am_SourceType_s>& listMainSources));
+- MOCK_CONST_METHOD2(getListMainSinkSoundProperties,
+- am_Error_e(const am_sinkID_t sinkID, std::vector<am_MainSoundProperty_s>& listSoundProperties));
+- MOCK_CONST_METHOD2(getListMainSourceSoundProperties,
+- am_Error_e(const am_sourceID_t sourceID, std::vector<am_MainSoundProperty_s>& listSourceProperties));
+- MOCK_CONST_METHOD1(getListSourceClasses,
+- am_Error_e(std::vector<am_SourceClass_s>& listSourceClasses));
+- MOCK_CONST_METHOD1(getListSinkClasses,
+- am_Error_e(std::vector<am_SinkClass_s>& listSinkClasses));
+- MOCK_CONST_METHOD1(getListSystemProperties,
+- am_Error_e(std::vector<am_SystemProperty_s>& listSystemProperties));
+- MOCK_CONST_METHOD2(getTimingInformation,
+- am_Error_e(const am_mainConnectionID_t mainConnectionID, am_timeSync_t& delay));
+- MOCK_CONST_METHOD1(getDBusConnectionWrapper,
+- am_Error_e(CAmDbusWrapper*& dbusConnectionWrapper));
+- MOCK_CONST_METHOD1(getSocketHandler,
+- am_Error_e(CAmSocketHandler*& socketHandler));
+- MOCK_METHOD2(confirmCommandReady,
+- void(const uint16_t handle, const am_Error_e error));
+- MOCK_METHOD2(confirmCommandRundown,
+- void(const uint16_t handle, const am_Error_e error));
+- MOCK_CONST_METHOD2(getListMainSinkNotificationConfigurations,
+- am_Error_e(const am_sinkID_t sinkID, std::vector<am_NotificationConfiguration_s>& listMainNotificationConfigurations));
+- MOCK_CONST_METHOD2(getListMainSourceNotificationConfigurations,
+- am_Error_e(const am_sourceID_t sourceID, std::vector<am_NotificationConfiguration_s>& listMainNotificationConfigurations));
+- MOCK_METHOD2(setMainSinkNotificationConfiguration,
+- am_Error_e(const am_sinkID_t sinkID, const am_NotificationConfiguration_s& mainNotificationConfiguration));
+- MOCK_METHOD2(setMainSourceNotificationConfiguration,
+- am_Error_e(const am_sourceID_t sourceID, const am_NotificationConfiguration_s& mainNotificationConfiguration));
++ MOCK_CONST_METHOD1(getInterfaceVersion,
++ void(std::string& version));
++ MOCK_METHOD3(connect,
++ am_Error_e(const am_sourceID_t sourceID, const am_sinkID_t sinkID, am_mainConnectionID_t& mainConnectionID));
++ MOCK_METHOD1(disconnect,
++ am_Error_e(const am_mainConnectionID_t mainConnectionID));
++ MOCK_METHOD2(setVolume,
++ am_Error_e(const am_sinkID_t sinkID, const am_mainVolume_t volume));
++ MOCK_METHOD2(volumeStep,
++ am_Error_e(const am_sinkID_t sinkID, const int16_t volumeStep));
++ MOCK_METHOD2(setSinkMuteState,
++ am_Error_e(const am_sinkID_t sinkID, const am_MuteState_e muteState));
++ MOCK_METHOD2(setMainSinkSoundProperty,
++ am_Error_e(const am_MainSoundProperty_s& soundProperty, const am_sinkID_t sinkID));
++ MOCK_METHOD2(setMainSourceSoundProperty,
++ am_Error_e(const am_MainSoundProperty_s& soundProperty, const am_sourceID_t sourceID));
++ MOCK_METHOD1(setSystemProperty,
++ am_Error_e(const am_SystemProperty_s& property));
++ MOCK_CONST_METHOD1(getListMainConnections,
++ am_Error_e(std::vector<am_MainConnectionType_s>& listConnections));
++ MOCK_CONST_METHOD1(getListMainSinks,
++ am_Error_e(std::vector<am_SinkType_s>& listMainSinks));
++ MOCK_CONST_METHOD1(getListMainSources,
++ am_Error_e(std::vector<am_SourceType_s>& listMainSources));
++ MOCK_CONST_METHOD2(getListMainSinkSoundProperties,
++ am_Error_e(const am_sinkID_t sinkID, std::vector<am_MainSoundProperty_s>& listSoundProperties));
++ MOCK_CONST_METHOD2(getListMainSourceSoundProperties,
++ am_Error_e(const am_sourceID_t sourceID, std::vector<am_MainSoundProperty_s>& listSourceProperties));
++ MOCK_CONST_METHOD1(getListSourceClasses,
++ am_Error_e(std::vector<am_SourceClass_s>& listSourceClasses));
++ MOCK_CONST_METHOD1(getListSinkClasses,
++ am_Error_e(std::vector<am_SinkClass_s>& listSinkClasses));
++ MOCK_CONST_METHOD1(getListSystemProperties,
++ am_Error_e(std::vector<am_SystemProperty_s>& listSystemProperties));
++ MOCK_CONST_METHOD2(getTimingInformation,
++ am_Error_e(const am_mainConnectionID_t mainConnectionID, am_timeSync_t& delay));
++ MOCK_CONST_METHOD1(getDBusConnectionWrapper,
++ am_Error_e(CAmDbusWrapper*& dbusConnectionWrapper));
++ MOCK_CONST_METHOD1(getSocketHandler,
++ am_Error_e(CAmSocketHandler*& socketHandler));
++ MOCK_METHOD2(confirmCommandReady,
++ void(const uint16_t handle, const am_Error_e error));
++ MOCK_METHOD2(confirmCommandRundown,
++ void(const uint16_t handle, const am_Error_e error));
++ MOCK_CONST_METHOD2(getListMainSinkNotificationConfigurations,
++ am_Error_e(const am_sinkID_t sinkID, std::vector<am_NotificationConfiguration_s>& listMainNotificationConfigurations));
++ MOCK_CONST_METHOD2(getListMainSourceNotificationConfigurations,
++ am_Error_e(const am_sourceID_t sourceID, std::vector<am_NotificationConfiguration_s>& listMainNotificationConfigurations));
++ MOCK_METHOD2(setMainSinkNotificationConfiguration,
++ am_Error_e(const am_sinkID_t sinkID, const am_NotificationConfiguration_s& mainNotificationConfiguration));
++ MOCK_METHOD2(setMainSourceNotificationConfiguration,
++ am_Error_e(const am_sourceID_t sourceID, const am_NotificationConfiguration_s& mainNotificationConfiguration));
++ MOCK_CONST_METHOD2(getVolume,
++ am_Error_e(const am_sinkID_t sinkID, am_mainVolume_t& mainVolume));
++};
+
+
+-};
+
+ } // namespace am
+ #endif /* MOCKCOMMANDRECEIVENTERFACE_H_ */
+diff --git a/PluginCommandInterfaceDbus/CMakeLists.txt b/PluginCommandInterfaceDbus/CMakeLists.txt
+index 239df90..fbc3a19 100644
+--- a/PluginCommandInterfaceDbus/CMakeLists.txt
++++ b/PluginCommandInterfaceDbus/CMakeLists.txt
+@@ -38,7 +38,9 @@ if (NOT DAEMONVERSION)
+ endif(AUDIOMANAGER_FOUND)
+ endif (NOT DAEMONVERSION)
+
+-IF(${WITH_ENABLED_IPC} STREQUAL "DBUS")
++IF(NOT WITH_DBUS_WRAPPER)
++ message (FATAL_ERROR "For Dbus plugins you need to compile the AM WITH_DBUS_WRAPPER")
++ENDIF(NOT WITH_DBUS_WRAPPER)
+
+ if(WITH_DLT)
+ pkg_check_modules(DLT REQUIRED automotive-dlt>=2.2.0)
+@@ -107,4 +109,4 @@ IF(${WITH_ENABLED_IPC} STREQUAL "DBUS")
+ ENDIF(USE_BUILD_LIBS)
+
+
+-ENDIF(${WITH_ENABLED_IPC} STREQUAL "DBUS")
++
+diff --git a/PluginCommandInterfaceDbus/include/configCommandDbus.h b/PluginCommandInterfaceDbus/include/configCommandDbus.h
+index 20fd246..39d53cd 100644
+--- a/PluginCommandInterfaceDbus/include/configCommandDbus.h
++++ b/PluginCommandInterfaceDbus/include/configCommandDbus.h
+@@ -2,6 +2,6 @@
+ #define _COMMANDDBUS_CONFIG_H
+
+ #define COMMAND_DBUS_INTROSPECTION_FILE "/usr/local/share/audiomanager/audiomanager/CommandInterface.xml"
+-#define LIBRARY_OUTPUT_PATH "/home/genius/workspace/ascgit004.AudioManager/Plugins/build/command"
++#define LIBRARY_OUTPUT_PATH "/home/mgu/workspace/audiomanager/ascgit004.AudioManagerPlugins/build/PluginCommandInterfaceDbus/command"
+
+ #endif /* _COMMANDDBUS_CONFIG_H */
+diff --git a/PluginCommandInterfaceDbus/src/CAmCommandSenderDbus.cpp b/PluginCommandInterfaceDbus/src/CAmCommandSenderDbus.cpp
+index 7f0db70..e5d3382 100644
+--- a/PluginCommandInterfaceDbus/src/CAmCommandSenderDbus.cpp
++++ b/PluginCommandInterfaceDbus/src/CAmCommandSenderDbus.cpp
+@@ -317,7 +317,7 @@ void am::CAmCommandSenderDbus::cbTimingInformationChanged(const am_mainConnectio
+
+ void CAmCommandSenderDbus::getInterfaceVersion(std::string & version) const
+ {
+- version = CommandSendVersion;
++ version = CommandVersion;
+ }
+
+ void am::CAmCommandSenderDbus::cbSinkUpdated(const am_sinkID_t sinkID, const am_sinkClass_t sinkClassID, const std::vector<am_MainSoundProperty_s>& listMainSoundProperties)
+diff --git a/PluginCommandInterfaceDbus/test/CMakeLists.txt b/PluginCommandInterfaceDbus/test/CMakeLists.txt
+index 3a1e270..ba96d53 100644
+--- a/PluginCommandInterfaceDbus/test/CMakeLists.txt
++++ b/PluginCommandInterfaceDbus/test/CMakeLists.txt
+@@ -25,10 +25,9 @@ set(STD_INCLUDE_DIRS "/usr/include")
+ set(EXECUTABLE_OUTPUT_PATH ${TEST_EXECUTABLE_OUTPUT_PATH})
+
+ FIND_PACKAGE(Threads)
+-FIND_PACKAGE(DBUS REQUIRED)
+ FIND_PACKAGE(PkgConfig)
+ FIND_PACKAGE(PythonLibs REQUIRED)
+-
++pkg_check_modules (DBUS "dbus-1 >= 1.4" REQUIRED)
+
+ IF(WITH_DLT)
+ pkg_check_modules(DLT REQUIRED automotive-dlt>=2.2.0)
+@@ -76,7 +75,7 @@ ADD_EXECUTABLE(AmCommandSenderDbusSignalTest ${DBUS_SIGNAL_INTERFACE_SRCS_CXX})
+
+ TARGET_LINK_LIBRARIES(AmCommandSenderDbusTest
+ ${DLT_LIBRARIES}
+- ${DBUS_LIBRARY}
++ ${DBUS_LIBRARIES}
+ ${CMAKE_DL_LIBS}
+ ${CMAKE_THREAD_LIBS_INIT}
+ ${PYTHON_LIBRARY}
+@@ -87,7 +86,7 @@ TARGET_LINK_LIBRARIES(AmCommandSenderDbusTest
+
+ TARGET_LINK_LIBRARIES(AmCommandSenderDbusSignalTest
+ ${DLT_LIBRARIES}
+- ${DBUS_LIBRARY}
++ ${DBUS_LIBRARIES}
+ ${CMAKE_DL_LIBS}
+ ${CMAKE_THREAD_LIBS_INIT}
+ ${PYTHON_LIBRARY}
+diff --git a/PluginCommandInterfaceDbus/test/MockIAmCommandReceive.h b/PluginCommandInterfaceDbus/test/MockIAmCommandReceive.h
+index 442cfc6..0732553 100644
+--- a/PluginCommandInterfaceDbus/test/MockIAmCommandReceive.h
++++ b/PluginCommandInterfaceDbus/test/MockIAmCommandReceive.h
+@@ -1,7 +1,7 @@
+ /**
+ * Copyright (c) 2012 BMW
+ *
+- * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
++ * \author Aleksandar Donchev, aleksander.donchev@partner.bmw.de BMW 2013
+ *
+ * \copyright
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction,
+@@ -26,61 +26,63 @@ namespace am {
+
+ class MockIAmCommandReceive : public IAmCommandReceive {
+ public:
+- MOCK_CONST_METHOD1(getInterfaceVersion,
+- void(std::string& version));
+- MOCK_METHOD3(connect,
+- am_Error_e(const am_sourceID_t sourceID, const am_sinkID_t sinkID, am_mainConnectionID_t& mainConnectionID));
+- MOCK_METHOD1(disconnect,
+- am_Error_e(const am_mainConnectionID_t mainConnectionID));
+- MOCK_METHOD2(setVolume,
+- am_Error_e(const am_sinkID_t sinkID, const am_mainVolume_t volume));
+- MOCK_METHOD2(volumeStep,
+- am_Error_e(const am_sinkID_t sinkID, const int16_t volumeStep));
+- MOCK_METHOD2(setSinkMuteState,
+- am_Error_e(const am_sinkID_t sinkID, const am_MuteState_e muteState));
+- MOCK_METHOD2(setMainSinkSoundProperty,
+- am_Error_e(const am_MainSoundProperty_s& soundProperty, const am_sinkID_t sinkID));
+- MOCK_METHOD2(setMainSourceSoundProperty,
+- am_Error_e(const am_MainSoundProperty_s& soundProperty, const am_sourceID_t sourceID));
+- MOCK_METHOD1(setSystemProperty,
+- am_Error_e(const am_SystemProperty_s& property));
+- MOCK_CONST_METHOD1(getListMainConnections,
+- am_Error_e(std::vector<am_MainConnectionType_s>& listConnections));
+- MOCK_CONST_METHOD1(getListMainSinks,
+- am_Error_e(std::vector<am_SinkType_s>& listMainSinks));
+- MOCK_CONST_METHOD1(getListMainSources,
+- am_Error_e(std::vector<am_SourceType_s>& listMainSources));
+- MOCK_CONST_METHOD2(getListMainSinkSoundProperties,
+- am_Error_e(const am_sinkID_t sinkID, std::vector<am_MainSoundProperty_s>& listSoundProperties));
+- MOCK_CONST_METHOD2(getListMainSourceSoundProperties,
+- am_Error_e(const am_sourceID_t sourceID, std::vector<am_MainSoundProperty_s>& listSourceProperties));
+- MOCK_CONST_METHOD1(getListSourceClasses,
+- am_Error_e(std::vector<am_SourceClass_s>& listSourceClasses));
+- MOCK_CONST_METHOD1(getListSinkClasses,
+- am_Error_e(std::vector<am_SinkClass_s>& listSinkClasses));
+- MOCK_CONST_METHOD1(getListSystemProperties,
+- am_Error_e(std::vector<am_SystemProperty_s>& listSystemProperties));
+- MOCK_CONST_METHOD2(getTimingInformation,
+- am_Error_e(const am_mainConnectionID_t mainConnectionID, am_timeSync_t& delay));
+- MOCK_CONST_METHOD1(getDBusConnectionWrapper,
+- am_Error_e(CAmDbusWrapper*& dbusConnectionWrapper));
+- MOCK_CONST_METHOD1(getSocketHandler,
+- am_Error_e(CAmSocketHandler*& socketHandler));
+- MOCK_METHOD2(confirmCommandReady,
+- void(const uint16_t handle, const am_Error_e error));
+- MOCK_METHOD2(confirmCommandRundown,
+- void(const uint16_t handle, const am_Error_e error));
+- MOCK_CONST_METHOD2(getListMainSinkNotificationConfigurations,
+- am_Error_e(const am_sinkID_t sinkID, std::vector<am_NotificationConfiguration_s>& listMainNotificationConfigurations));
+- MOCK_CONST_METHOD2(getListMainSourceNotificationConfigurations,
+- am_Error_e(const am_sourceID_t sourceID, std::vector<am_NotificationConfiguration_s>& listMainNotificationConfigurations));
+- MOCK_METHOD2(setMainSinkNotificationConfiguration,
+- am_Error_e(const am_sinkID_t sinkID, const am_NotificationConfiguration_s& mainNotificationConfiguration));
+- MOCK_METHOD2(setMainSourceNotificationConfiguration,
+- am_Error_e(const am_sourceID_t sourceID, const am_NotificationConfiguration_s& mainNotificationConfiguration));
++ MOCK_CONST_METHOD1(getInterfaceVersion,
++ void(std::string& version));
++ MOCK_METHOD3(connect,
++ am_Error_e(const am_sourceID_t sourceID, const am_sinkID_t sinkID, am_mainConnectionID_t& mainConnectionID));
++ MOCK_METHOD1(disconnect,
++ am_Error_e(const am_mainConnectionID_t mainConnectionID));
++ MOCK_METHOD2(setVolume,
++ am_Error_e(const am_sinkID_t sinkID, const am_mainVolume_t volume));
++ MOCK_METHOD2(volumeStep,
++ am_Error_e(const am_sinkID_t sinkID, const int16_t volumeStep));
++ MOCK_METHOD2(setSinkMuteState,
++ am_Error_e(const am_sinkID_t sinkID, const am_MuteState_e muteState));
++ MOCK_METHOD2(setMainSinkSoundProperty,
++ am_Error_e(const am_MainSoundProperty_s& soundProperty, const am_sinkID_t sinkID));
++ MOCK_METHOD2(setMainSourceSoundProperty,
++ am_Error_e(const am_MainSoundProperty_s& soundProperty, const am_sourceID_t sourceID));
++ MOCK_METHOD1(setSystemProperty,
++ am_Error_e(const am_SystemProperty_s& property));
++ MOCK_CONST_METHOD1(getListMainConnections,
++ am_Error_e(std::vector<am_MainConnectionType_s>& listConnections));
++ MOCK_CONST_METHOD1(getListMainSinks,
++ am_Error_e(std::vector<am_SinkType_s>& listMainSinks));
++ MOCK_CONST_METHOD1(getListMainSources,
++ am_Error_e(std::vector<am_SourceType_s>& listMainSources));
++ MOCK_CONST_METHOD2(getListMainSinkSoundProperties,
++ am_Error_e(const am_sinkID_t sinkID, std::vector<am_MainSoundProperty_s>& listSoundProperties));
++ MOCK_CONST_METHOD2(getListMainSourceSoundProperties,
++ am_Error_e(const am_sourceID_t sourceID, std::vector<am_MainSoundProperty_s>& listSourceProperties));
++ MOCK_CONST_METHOD1(getListSourceClasses,
++ am_Error_e(std::vector<am_SourceClass_s>& listSourceClasses));
++ MOCK_CONST_METHOD1(getListSinkClasses,
++ am_Error_e(std::vector<am_SinkClass_s>& listSinkClasses));
++ MOCK_CONST_METHOD1(getListSystemProperties,
++ am_Error_e(std::vector<am_SystemProperty_s>& listSystemProperties));
++ MOCK_CONST_METHOD2(getTimingInformation,
++ am_Error_e(const am_mainConnectionID_t mainConnectionID, am_timeSync_t& delay));
++ MOCK_CONST_METHOD1(getDBusConnectionWrapper,
++ am_Error_e(CAmDbusWrapper*& dbusConnectionWrapper));
++ MOCK_CONST_METHOD1(getSocketHandler,
++ am_Error_e(CAmSocketHandler*& socketHandler));
++ MOCK_METHOD2(confirmCommandReady,
++ void(const uint16_t handle, const am_Error_e error));
++ MOCK_METHOD2(confirmCommandRundown,
++ void(const uint16_t handle, const am_Error_e error));
++ MOCK_CONST_METHOD2(getListMainSinkNotificationConfigurations,
++ am_Error_e(const am_sinkID_t sinkID, std::vector<am_NotificationConfiguration_s>& listMainNotificationConfigurations));
++ MOCK_CONST_METHOD2(getListMainSourceNotificationConfigurations,
++ am_Error_e(const am_sourceID_t sourceID, std::vector<am_NotificationConfiguration_s>& listMainNotificationConfigurations));
++ MOCK_METHOD2(setMainSinkNotificationConfiguration,
++ am_Error_e(const am_sinkID_t sinkID, const am_NotificationConfiguration_s& mainNotificationConfiguration));
++ MOCK_METHOD2(setMainSourceNotificationConfiguration,
++ am_Error_e(const am_sourceID_t sourceID, const am_NotificationConfiguration_s& mainNotificationConfiguration));
++ MOCK_CONST_METHOD2(getVolume,
++ am_Error_e(const am_sinkID_t sinkID, am_mainVolume_t& mainVolume));
++};
+
+
+-};
+
+ } // namespace am
+ #endif /* MOCKCOMMANDRECEIVENTERFACE_H_ */
+diff --git a/PluginRoutingInterfaceDBus/CMakeLists.txt b/PluginRoutingInterfaceDBus/CMakeLists.txt
+deleted file mode 100644
+index e08b591..0000000
+--- a/PluginRoutingInterfaceDBus/CMakeLists.txt
++++ /dev/null
+@@ -1,113 +0,0 @@
+-# Copyright (c) 2012 GENIVI Alliance
+-# Copyright (c) 2012 BMW
+-#
+-# author Christian Linke, christian.linke@bmw.de BMW 2011,2012
+-#
+-# copyright
+-# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction,
+-# including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
+-# subject to the following conditions:
+-# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+-# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
+-# THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+-#
+-# For further information see http://www.genivi.org/.
+-#
+-cmake_minimum_required(VERSION 2.8.8)
+-
+-PROJECT(PluginRoutingInterfaceDbus)
+-
+-if (NOT DAEMONVERSION)
+- message(STATUS "Building without AudioManager, searching for cmake definition")
+- set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
+- find_package(AudioManager)
+- if (AUDIOMANAGER_FOUND)
+- include ("${AUDIOMANAGER_CMAKE_CONFIG_PATH}/audiomanagerConfig.cmake")
+- set(PLUGINS_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR})
+- set(TEST_EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR})
+- if(WITH_TESTS)
+- add_subdirectory(${GOOGLE_MOCK_PROJECT_FOLDER} ${CMAKE_CURRENT_BINARY_DIR}/gmock)
+- endif(WITH_TESTS)
+-
+- set(COMMONAPI_DBUS_CONFIGURATIONS "")
+- else(AUDIOMANAGER_FOUND)
+- message(FATAL_ERROR "Could not find audiomanager cmake configuration")
+- endif(AUDIOMANAGER_FOUND)
+-endif (NOT DAEMONVERSION)
+-
+-IF(${WITH_ENABLED_IPC} STREQUAL "DBUS")
+-
+- set(LIBRARY_OUTPUT_PATH ${PLUGINS_OUTPUT_PATH}/routing)
+- set(INCLUDE_FOLDER "include")
+- if(WITH_DLT)
+- pkg_check_modules(DLT REQUIRED automotive-dlt>=2.2.0)
+- add_definitions(${DLT_CFLAGS_OTHER})
+- include_directories(${DLT_INCLUDE_DIRS})
+- link_directories(${DLT_LIBRARY_DIRS})
+- endif(WITH_DLT)
+-
+- IF(USE_BUILD_LIBS)
+- SET(ROUTING_DBUS_INTROSPECTION_FOLDER ${EXECUTABLE_OUTPUT_PATH})
+- SET(ROUTING_DBUS_INTROSPECTION_FILE ${EXECUTABLE_OUTPUT_PATH}/RoutingReceiver.xml)
+- ELSE(USE_BUILD_LIBS)
+- SET(ROUTING_DBUS_INTROSPECTION_FOLDER ${AM_SHARE_FOLDER}/${LIB_INSTALL_SUFFIX})
+- SET(ROUTING_DBUS_INTROSPECTION_FILE ${AM_SHARE_FOLDER}/${LIB_INSTALL_SUFFIX}/RoutingReceiver.xml)
+- ENDIF(USE_BUILD_LIBS)
+-
+-
+- CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/config.cmake ${CMAKE_CURRENT_SOURCE_DIR}/include/configRoutingDbus.h )
+-
+- FIND_PACKAGE(DBUS REQUIRED)
+-
+- INCLUDE_DIRECTORIES(
+- ${CMAKE_SOURCE_DIR}
+- ${CMAKE_CURRENT_BINARY_DIR}
+- ${DBUS_INCLUDE_DIR}
+- ${DBUS_ARCH_INCLUDE_DIR}
+- ${AUDIO_INCLUDE_FOLDER}
+- ${AUDIOMANAGER_INCLUDE_FOLDER}
+- ${AUDIOMANAGER_UTILITIES_INCLUDE}
+- ${INCLUDE_FOLDER}
+- )
+-
+- # all source files go here
+- file(GLOB PLUGINDBUS_SRCS_CXX "src/*.cpp")
+-
+- add_library(PluginRoutingInterfaceDbus MODULE ${PLUGINDBUS_SRCS_CXX})
+-
+- TARGET_LINK_LIBRARIES(PluginRoutingInterfaceDbus
+- ${DLT_LIBRARIES}
+- ${DBUS_LIBRARIES}
+- )
+-
+- IF(WITH_TESTS)
+- # add_subdirectory (test)
+- ENDIF(WITH_TESTS)
+-
+- IF(USE_BUILD_LIBS)
+- execute_process(
+- COMMAND mkdir -p "${EXECUTABLE_OUTPUT_PATH}"
+- COMMAND cp "${CMAKE_CURRENT_SOURCE_DIR}/${INCLUDE_FOLDER}/RoutingReceiver.xml" ${EXECUTABLE_OUTPUT_PATH}/RoutingReceiver.xml)
+- execute_process(
+- COMMAND mkdir -p "${EXECUTABLE_OUTPUT_PATH}"
+- COMMAND cp "${CMAKE_CURRENT_SOURCE_DIR}/${INCLUDE_FOLDER}/RoutingSender.xml" ${EXECUTABLE_OUTPUT_PATH}/RoutingSender.xml)
+- ENDIF(USE_BUILD_LIBS)
+-
+-
+-
+-
+- INSTALL(TARGETS PluginRoutingInterfaceDbus
+- DESTINATION lib/${LIB_INSTALL_SUFFIX}/routing
+- PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
+- COMPONENT plugin
+- )
+-
+- INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/RoutingReceiver.xml
+- DESTINATION ${AM_SHARE_FOLDER}/${LIB_INSTALL_SUFFIX}
+- COMPONENT plugin
+- )
+-
+-
+-
+-ENDIF(${WITH_ENABLED_IPC} STREQUAL "DBUS")
+diff --git a/PluginRoutingInterfaceDBus/cmake/FindAudioManager.cmake b/PluginRoutingInterfaceDBus/cmake/FindAudioManager.cmake
+deleted file mode 100644
+index ad97f23..0000000
+--- a/PluginRoutingInterfaceDBus/cmake/FindAudioManager.cmake
++++ /dev/null
+@@ -1,31 +0,0 @@
+-find_path(AUDIOMANAGER_CMAKE_CONFIG_PATH
+- audiomanagerConfig.cmake
+- PATH_SUFFIXES audiomanager/cmake
+- PATHS
+- ${CMAKE_INSTALL_PATH}
+- "${CMAKE_INSTALL_PREFIX}/lib"
+- "/usr/lib"
+- "/usr/local/lib"
+- )
+-
+-find_path(AUDIOMANAGER_INCLUDE_FOLDER
+- audiomanagertypes.h
+- PATH_SUFFIXES audiomanager
+- PATHS
+- ${CMAKE_INSTALL_PATH}
+- "${CMAKE_INSTALL_PREFIX}/include"
+- "/usr/include"
+- "/usr/local/include"
+- )
+-
+-set( AUDIOMANAGER_FOUND "NO" )
+-
+-if(AUDIOMANAGER_CMAKE_CONFIG_PATH)
+- set( AUDIOMANAGER_FOUND "YES" )
+- message(STATUS "Found AudioManager cmake config: ${AUDIOMANAGER_CMAKE_CONFIG_PATH}/audiomanagerConfig.cmake")
+-endif(AUDIOMANAGER_CMAKE_CONFIG_PATH)
+-
+-mark_as_advanced(
+- AUDIOMANAGER_CMAKE_CONFIG_PATH
+- AUDIOMANAGER_INCLUDE_FOLDER
+-)
+diff --git a/PluginRoutingInterfaceDBus/cmake/config.cmake b/PluginRoutingInterfaceDBus/cmake/config.cmake
+deleted file mode 100644
+index 20ce881..0000000
+--- a/PluginRoutingInterfaceDBus/cmake/config.cmake
++++ /dev/null
+@@ -1,6 +0,0 @@
+-#ifndef _ROUTINGDBUS_CONFIG_H
+-#define _ROUTINGDBUS_CONFIG_H
+-
+-#cmakedefine ROUTING_DBUS_INTROSPECTION_FILE "@ROUTING_DBUS_INTROSPECTION_FILE@"
+-
+-#endif /* _ROUTINGDBUS_CONFIG_H */
+diff --git a/PluginRoutingInterfaceDBus/include/CAmDbusMessageHandler.h b/PluginRoutingInterfaceDBus/include/CAmDbusMessageHandler.h
+deleted file mode 100644
+index 2dcdeb7..0000000
+--- a/PluginRoutingInterfaceDBus/include/CAmDbusMessageHandler.h
++++ /dev/null
+@@ -1,147 +0,0 @@
+-/**
+- * Copyright (c) copyright 2011-2012 Aricent® Group and its licensors
+- * Copyright (c) 2012 BMW
+- *
+- * \author Sampreeth Ramavana
+- * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
+- *
+- * \copyright
+- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction,
+- * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
+- * subject to the following conditions:
+- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
+- * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+- *
+- * For further information see http://www.genivi.org/.
+- */
+-
+-#ifndef _CAMSDBUSMESSAGEHANDLER_H_
+-#define _CAMSDBUSMESSAGEHANDLER_H_
+-
+-
+-#include <dbus/dbus.h>
+-#include <vector>
+-#include <sstream>
+-#include <string>
+-#include <list>
+-#include "audiomanagertypes.h"
+-
+-namespace am {
+-
+-
+-/**
+- * handles DBus Messages, is used to extract & append parameters and send messages
+- */
+-class CAmRoutingDbusMessageHandler
+-{
+-public:
+- CAmRoutingDbusMessageHandler();
+- ~CAmRoutingDbusMessageHandler();
+-
+- /**
+- * sets the DBus Connection
+- * @param connection pointer to the DBus Connection
+- */
+- void setDBusConnection(DBusConnection*& connection);
+-
+- /**
+- * is called to initiate the receiving of a message
+- * @param msg pointer to the message to be received
+- */
+- void initReceive(DBusMessage* msg);
+-
+- /**
+- * is called to initiate the reply to a message
+- * @param msg pointer to the message the reply is for
+- */
+- void initReply(DBusMessage* msg);
+-
+- /**
+- * inits a signal to be sent via dbus
+- * parameters can be added before sending the signal
+- * @param path the path
+- * @param signalName the signal name
+- */
+- void initSignal(std::string path, std::string signalName);
+-
+- /**
+- * sends out the message
+- */
+- void sendMessage();
+-
+- /**
+- * the get functions return a value from the received dbus message
+- * @return
+- */
+- dbus_uint16_t getUInt();
+- dbus_uint16_t getUInt(DBusMessageIter& iter, bool next);
+- dbus_int16_t getInt();
+- dbus_int16_t getInt(DBusMessageIter& iter, bool next);
+- dbus_int32_t getInt32();
+- dbus_int32_t getInt32(DBusMessageIter& iter, bool next);
+- dbus_bool_t getBool();
+- dbus_bool_t getBool(DBusMessageIter& iter, bool next);
+- char getByte();
+- char getByte(DBusMessageIter& iter, bool next);
+- double getDouble();
+- double getDouble(DBusMessageIter& iter, bool next);
+- char* getString();
+- char* getString(DBusMessageIter& iter, bool next);
+- am_Availability_s getAvailability();
+- std::vector<am::am_EarlyData_s> getEarlyData();
+- am_Domain_s getDomainData();
+- am_Source_s getSourceData();
+- am_Sink_s getSinkData();
+- am_Gateway_s getGatewayData();
+- am_Converter_s getConverterData();
+- am_Crossfader_s getCrossfaderData();
+- am_SoundProperty_s getSoundProperty();
+- am_MainSoundProperty_s getMainSoundProperty();
+- std::vector<am_CustomAvailabilityReason_t> getListconnectionFormats();
+- std::vector<bool> getListBool();
+- std::vector<am_SoundProperty_s> getListSoundProperties();
+- std::vector<am_MainSoundProperty_s> getListMainSoundProperties();
+- am_NotificationPayload_s getNotificationPayload();
+-
+-
+-
+- /**
+- * the overloaded append function appends different datatypes to the dbusmessage
+- */
+- void append(dbus_int16_t toAppend);
+- void append(dbus_uint16_t toAppend);
+- void append(dbus_uint32_t toAppend);
+- void append(char toAppend);
+- void append(bool toAppend);
+- void append(double toAppend);
+- void append(const am::am_Error_e error);
+- void append(const am::am_SinkType_s& sinkType);
+- void append(const am::am_SourceType_s& sourceType);
+- void append(const am::am_MainSoundProperty_s mainSoundProperty);
+- void append(const am::am_Availability_s & availability);
+- void append(const am::am_SystemProperty_s & SystemProperty);
+- void append(const std::vector<am::am_MainConnectionType_s>& listMainConnections);
+- void append(const std::vector<am::am_SinkType_s>& listMainSinks);
+- void append(const std::vector<am::am_SourceType_s>& listMainSources);
+- void append(const std::vector<am::am_MainSoundProperty_s>& listMainSoundProperties);
+- void append(const std::vector<am::am_SourceClass_s>& listSourceClasses);
+- void append(const std::vector<am::am_SinkClass_s>& listSinkClasses);
+- void append(const std::vector<am::am_SystemProperty_s>& listSystemProperties);
+-
+-private:
+-
+- DBusMessageIter mDBusMessageIter;
+- DBusError mDBusError;
+- dbus_uint32_t mSerial;
+- std::string mErrorName;
+- std::string mErrorMsg;
+- DBusMessage* mpDBusMessage;
+- DBusMessage* mpReveiveMessage;
+- DBusConnection* mpDBusConnection;
+-};
+-
+-}
+-
+-#endif // _CAMSDBUSMESSAGEHANDLER_H_
+diff --git a/PluginRoutingInterfaceDBus/include/CAmDbusSend.h b/PluginRoutingInterfaceDBus/include/CAmDbusSend.h
+deleted file mode 100644
+index b2c4b5b..0000000
+--- a/PluginRoutingInterfaceDBus/include/CAmDbusSend.h
++++ /dev/null
+@@ -1,55 +0,0 @@
+-/**
+- * Copyright (c) copyright 2011-2012 Aricent® Group and its licensors
+- * Copyright (c) 2012 BMW
+- *
+- * \author Sampreeth Ramavana
+- * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
+- *
+- * \copyright
+- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction,
+- * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
+- * subject to the following conditions:
+- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
+- * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+- *
+- * For further information see http://www.genivi.org/.
+- */
+-
+-#ifndef _CAMDBUSSEND_H_
+-#define _CAMDBUSSEND_H_
+-
+-//#include "headers.h"
+-#include <dbus/dbus.h>
+-#include <string>
+-#include <vector>
+-#include "audiomanagertypes.h"
+-
+-namespace am
+-{
+-
+-class CAmRoutingDbusSend
+-{
+-public:
+- CAmRoutingDbusSend(DBusConnection* conn, std::string bus_name, std::string path, std::string interface, std::string method);
+- virtual ~CAmRoutingDbusSend();
+- void append(std::string string);
+- void append(uint16_t integer);
+- void append(int16_t integer);
+- void append(int integer);
+- void append(std::vector<am_SoundProperty_s> listSoundProperties);
+- void append(am_SoundProperty_s soundProperty);
+- am_Error_e send();
+- am_Error_e sendAsync();
+-
+-private:
+- DBusMessage* mpDbusMessage;
+- DBusConnection* mpDbusConnection;
+- DBusMessageIter mDbusMessageIter;
+- DBusError mDBusError;
+- dbus_uint32_t mSerial;
+-};
+-}
+-
+-#endif /* _CAMDBUSSEND_H_ */
+diff --git a/PluginRoutingInterfaceDBus/include/CAmRoutingSenderDbus.h b/PluginRoutingInterfaceDBus/include/CAmRoutingSenderDbus.h
+deleted file mode 100644
+index 12e39fb..0000000
+--- a/PluginRoutingInterfaceDBus/include/CAmRoutingSenderDbus.h
++++ /dev/null
+@@ -1,96 +0,0 @@
+-/**
+- * Copyright (c) 2012 BMW
+- *
+- * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
+- * \author Aleksandar Donchev, aleksander.donchev@partner.bmw.de BMW 2013
+- *
+- * \copyright
+- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction,
+- * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
+- * subject to the following conditions:
+- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
+- * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+- *
+- * For further information see http://www.genivi.org/.
+- */
+-
+-#ifndef ROUTINGSENDER_H_
+-#define ROUTINGSENDER_H_
+-
+-#include "IAmRouting.h"
+-#include "CAmDbusMessageHandler.h"
+-#include "IAmRoutingReceiverShadow.h"
+-
+-namespace am
+-{
+-
+-#define ROUTING_NODE "routinginterface"
+-
+-class CAmRoutingSenderDbus: public IAmRoutingSend
+-{
+-public:
+- CAmRoutingSenderDbus();
+- virtual ~CAmRoutingSenderDbus();
+- am_Error_e startupInterface(IAmRoutingReceive* pIAmRoutingReceive);
+- void setRoutingReady(const uint16_t handle);
+- void setRoutingRundown(const uint16_t handle);
+- am_Error_e asyncAbort(const am_Handle_s handle);
+- am_Error_e asyncConnect(const am_Handle_s handle, const am_connectionID_t connectionID, const am_sourceID_t sourceID, const am_sinkID_t sinkID, const am_CustomAvailabilityReason_t connectionFormat);
+- am_Error_e asyncDisconnect(const am_Handle_s handle, const am_connectionID_t connectionID);
+- am_Error_e asyncSetSinkVolume(const am_Handle_s handle, const am_sinkID_t sinkID, const am_volume_t volume, const am_CustomRampType_t ramp, const am_time_t time);
+- am_Error_e asyncSetSourceVolume(const am_Handle_s handle, const am_sourceID_t sourceID, const am_volume_t volume, const am_CustomRampType_t ramp, const am_time_t time);
+- am_Error_e asyncSetSourceState(const am_Handle_s handle, const am_sourceID_t sourceID, const am_SourceState_e state);
+- am_Error_e asyncSetSinkSoundProperties(const am_Handle_s handle, const am_sinkID_t sinkID, const std::vector<am_SoundProperty_s>& listSoundProperties);
+- am_Error_e asyncSetSinkSoundProperty(const am_Handle_s handle, const am_sinkID_t sinkID, const am_SoundProperty_s& soundProperty);
+- am_Error_e asyncSetSourceSoundProperties(const am_Handle_s handle, const am_sourceID_t sourceID, const std::vector<am_SoundProperty_s>& listSoundProperties);
+- am_Error_e asyncSetSourceSoundProperty(const am_Handle_s handle, const am_sourceID_t sourceID, const am_SoundProperty_s& soundProperty);
+- am_Error_e asyncCrossFade(const am_Handle_s handle, const am_crossfaderID_t crossfaderID, const am_HotSink_e hotSink, const am_CustomRampType_t rampType, const am_time_t time);
+- am_Error_e setDomainState(const am_domainID_t domainID, const am_DomainState_e domainState);
+- am_Error_e returnBusName(std::string& BusName) const;
+- void getInterfaceVersion(std::string& version) const;
+- am_Error_e asyncSetVolumes(const am_Handle_s handle, const std::vector<am_Volumes_s>& listVolumes) ;
+- am_Error_e asyncSetSinkNotificationConfiguration(const am_Handle_s handle, const am_sinkID_t sinkID, const am_NotificationConfiguration_s& notificationConfiguration) ;
+- am_Error_e asyncSetSourceNotificationConfiguration(const am_Handle_s handle, const am_sourceID_t sourceID, const am_NotificationConfiguration_s& notificationConfiguration) ;
+-
+- struct rs_lookupData_s
+- {
+- std::string busname;
+- std::string path;
+- std::string interface;
+- };
+-
+- void removeHandle(uint16_t handle);
+- void addDomainLookup(am_domainID_t domainID, rs_lookupData_s lookupData);
+- void addSourceLookup(am_sourceID_t sourceID, am_domainID_t domainID);
+- void addSinkLookup(am_sinkID_t sinkID, am_domainID_t domainID);
+- void removeDomainLookup(am_domainID_t domainID);
+- void removeSourceLookup(am_sourceID_t sourceID);
+- void removeSinkLookup(am_sinkID_t sinkID);
+-
+-private:
+- CAmDbusWrapper* mpCAmDBusWrapper;
+- IAmRoutingReceive *mpIAmRoutingReceive;
+- DBusConnection* mpDBusConnection;
+- CAmRoutingDbusMessageHandler mCAmRoutingDBusMessageHandler;
+- IAmRoutingReceiverShadowDbus mIAmRoutingReceiverShadowDbus;
+-
+- typedef std::map<am_domainID_t,rs_lookupData_s> mapDomain_t;
+- typedef std::map<am_sinkID_t,rs_lookupData_s> mapSinks_t;
+- typedef std::map<am_sourceID_t,rs_lookupData_s> mapSources_t;
+- typedef std::map<am_connectionID_t,rs_lookupData_s> mapConnections_t;
+- typedef std::map<uint16_t,rs_lookupData_s> mapHandles_t;
+-
+- template <typename TKey> static void removeEntriesForValue(const rs_lookupData_s & value, std::map<TKey,rs_lookupData_s> & map);
+-
+- mapDomain_t mMapDomains;
+- mapSinks_t mMapSinks;
+- mapSources_t mMapSources;
+- mapConnections_t mMapConnections;
+- mapHandles_t mMapHandles;
+-
+-};
+-}
+-
+-#endif /* ROUTINGSENDER_H_ */
+diff --git a/PluginRoutingInterfaceDBus/include/IAmRoutingReceiverShadow.h b/PluginRoutingInterfaceDBus/include/IAmRoutingReceiverShadow.h
+deleted file mode 100644
+index 3a38468..0000000
+--- a/PluginRoutingInterfaceDBus/include/IAmRoutingReceiverShadow.h
++++ /dev/null
+@@ -1,142 +0,0 @@
+-/**
+- * Copyright (c) copyright 2011-2012 Aricent® Group and its licensors
+- * Copyright (c) 2012 BMW
+- *
+- * \author Sampreeth Ramavana
+- * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
+- *
+- * \copyright
+- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction,
+- * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
+- * subject to the following conditions:
+- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
+- * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+- *
+- * For further information see http://www.genivi.org/.
+- */
+-
+-#ifndef _IAMROUTINGRECEIVERSHADOW_H_
+-#define _IAMROUTINGRECEIVERSHADOW_H_
+-
+-#include <dbus/dbus.h>
+-#include <map>
+-#include "CAmDbusMessageHandler.h"
+-
+-namespace am {
+-
+-class CAmRoutingSenderDbus;
+-class IAmRoutingReceive;
+-class CAmDbusWrapper;
+-
+-/**
+- * receives the DBus Callbacks, marhsalls and demarshalls the parameters and calls CommandReceive
+- */
+-class IAmRoutingReceiverShadowDbus
+-{
+-public:
+- IAmRoutingReceiverShadowDbus(CAmRoutingSenderDbus* pRoutingSenderDbus);
+- virtual ~IAmRoutingReceiverShadowDbus();
+- void ackConnect(DBusConnection *conn, DBusMessage *msg);
+- void ackDisconnect(DBusConnection *conn, DBusMessage *msg);
+- void ackSetSinkVolume(DBusConnection *conn, DBusMessage *msg);
+- void ackSetSourceVolume(DBusConnection *conn, DBusMessage *msg);
+- void ackSetSourceState(DBusConnection *conn, DBusMessage *msg);
+- void ackSinkVolumeTick(DBusConnection *conn, DBusMessage *msg);
+- void ackSourceVolumeTick(DBusConnection *conn, DBusMessage *msg);
+- void ackSetSinkSoundProperty(DBusConnection *conn, DBusMessage *msg);
+- void ackSetSourceSoundProperty(DBusConnection *conn, DBusMessage *msg);
+- void ackSetSinkSoundProperties(DBusConnection *conn, DBusMessage *msg);
+- void ackSetSourceSoundProperties(DBusConnection *conn, DBusMessage *msg);
+- void ackCrossFading(DBusConnection *conn, DBusMessage *msg);
+- void registerDomain(DBusConnection *conn, DBusMessage *msg);
+- void registerSource(DBusConnection *conn, DBusMessage *msg);
+- void registerSink(DBusConnection *conn, DBusMessage *msg);
+- void registerGateway(DBusConnection *conn, DBusMessage *msg);
+- void registerConverter(DBusConnection *conn, DBusMessage *msg);
+- void peekDomain(DBusConnection *conn, DBusMessage *msg);
+- void deregisterDomain(DBusConnection *conn, DBusMessage *msg);
+- void deregisterGateway(DBusConnection *conn, DBusMessage *msg);
+- void deregisterConverter(DBusConnection *conn, DBusMessage *msg);
+- void peekSink(DBusConnection *conn, DBusMessage *msg);
+- void deregisterSink(DBusConnection *conn, DBusMessage *msg);
+- void peekSource(DBusConnection *conn, DBusMessage *msg);
+- void deregisterSource(DBusConnection *conn, DBusMessage *msg);
+- void registerCrossfader(DBusConnection *conn, DBusMessage *msg);
+- void deregisterCrossfader(DBusConnection *conn, DBusMessage *msg);
+- void peekSourceClassID(DBusConnection *conn, DBusMessage *msg);
+- void peekSinkClassID(DBusConnection *conn, DBusMessage *msg);
+- void hookInterruptStatusChange(DBusConnection *conn, DBusMessage *msg);
+- void hookDomainRegistrationComplete(DBusConnection *conn, DBusMessage *msg);
+- void hookSinkAvailablityStatusChange(DBusConnection *conn, DBusMessage *msg);
+- void hookSourceAvailablityStatusChange(DBusConnection *conn, DBusMessage *msg);
+- void hookDomainStateChange(DBusConnection *conn, DBusMessage *msg);
+- void hookTimingInformationChanged(DBusConnection *conn, DBusMessage *msg);
+- void sendChangedData(DBusConnection *conn, DBusMessage *msg);
+- void confirmRoutingReady(DBusConnection *conn, DBusMessage *msg);
+- void confirmRoutingRundown(DBusConnection *conn, DBusMessage *msg);
+- void updateGateway(DBusConnection *conn, DBusMessage *msg);
+- void updateConverter(DBusConnection *conn, DBusMessage *msg);
+- void updateSink(DBusConnection *conn, DBusMessage *msg);
+- void updateSource(DBusConnection *conn, DBusMessage *msg);
+- void ackSetVolumes(DBusConnection *conn, DBusMessage *msg);
+- void ackSinkNotificationConfiguration(DBusConnection *conn, DBusMessage *msg);
+- void ackSourceNotificationConfiguration(DBusConnection *conn, DBusMessage *msg);
+- void hookSinkNotificationDataChange(DBusConnection *conn, DBusMessage *msg);
+- void hookSourceNotificationDataChange(DBusConnection *conn, DBusMessage *msg);
+- void getRoutingReadyStatus(DBusConnection* conn, DBusMessage* msg);
+-
+- /**
+- * sets the pointer to the CommandReceiveInterface and registers Callback
+- * @param receiver
+- */
+- void setRoutingReceiver(IAmRoutingReceive*& receiver);
+-
+- void gotReady(int16_t numberDomains, uint16_t handle);
+- void gotRundown(int16_t numberDomains, uint16_t handle);
+-
+-private:
+- typedef void (IAmRoutingReceiverShadowDbus::*CallBackMethod)(DBusConnection *connection, DBusMessage *message);
+- IAmRoutingReceive* mRoutingReceiveInterface;
+- CAmDbusWrapper* mDBusWrapper;
+- CAmRoutingSenderDbus* mpRoutingSenderDbus;
+-
+- typedef std::map<std::string, CallBackMethod> functionMap_t;
+- functionMap_t mFunctionMap;
+- CAmRoutingDbusMessageHandler mDBUSMessageHandler;
+- int16_t mNumberDomains;
+- uint16_t mHandle;
+- bool mRoutingReady;
+-
+- /**
+- * receives a callback whenever the path of the plugin is called
+- */
+- static DBusHandlerResult receiveCallback(DBusConnection *conn, DBusMessage *msg, void *user_data);
+-
+- /**
+- * dynamic delegate that handles the Callback of the static receiveCallback
+- * @param conn DBus connection
+- * @param msg DBus message
+- * @param user_data pointer to instance of IAmRoutingReceiverShadow
+- * @return
+- */
+- DBusHandlerResult receiveCallbackDelegate(DBusConnection *conn, DBusMessage *msg);
+-
+- /**
+- * sends out introspectiondata read from an xml file.
+- * @param conn
+- * @param msg
+- */
+- void sendIntrospection(DBusConnection* conn, DBusMessage* msg);
+-
+- /**
+- * creates the function map needed to combine DBus messages and function adresses
+- * @return the map
+- */
+- functionMap_t createMap();
+-};
+-
+-}
+-
+-#endif /* _IAMROUTINGRECEIVERSHADOW_H_ */
+diff --git a/PluginRoutingInterfaceDBus/include/RoutingReceiver.xml b/PluginRoutingInterfaceDBus/include/RoutingReceiver.xml
+deleted file mode 100644
+index 8e15bb1..0000000
+--- a/PluginRoutingInterfaceDBus/include/RoutingReceiver.xml
++++ /dev/null
+@@ -1,237 +0,0 @@
+-<?xml version="1.0" encoding="UTF-8" ?>
+-<!DOCTYPE node PUBLIC
+- "-//freedesktop//DTD D-Bus Object Introspection 1.0//EN"
+- "http://standards.freedesktop.org/dbus/1.0/introspect.dtd">
+-
+-<node>
+- <interface name="org.genivi.audiomanager.routinginterface">
+- <method name="ackConnect">
+- <arg name="handle" type="q" direction="in" />
+- <arg name="connectionID" type="q" direction="in" />
+- <arg name="error" type="q" direction="in" />
+- </method>
+- <method name="ackDisconnect">
+- <arg name="handle" type="q" direction="in" />
+- <arg name="connectionID" type="q" direction="in" />
+- <arg name="error" type="q" direction="in" />
+- </method>
+- <method name="ackSetSinkVolume">
+- <arg name="handle" type="q" direction="in" />
+- <arg name="volume" type="n" direction="in" />
+- <arg name="error" type="q" direction="in" />
+- </method>
+- <method name="ackSetSourceVolume">
+- <arg name="handle" type="q" direction="in" />
+- <arg name="volume" type="n" direction="in" />
+- <arg name="error" type="q" direction="in" />
+- </method>
+- <method name="ackSetSourceState">
+- <arg name="handle" type="q" direction="in" />
+- <arg name="error" type="q" direction="in" />
+- </method>
+- <method name="ackSetSinkSoundProperties">
+- <arg name="handle" type="q" direction="in" />
+- <arg name="error" type="q" direction="in" />
+- </method>
+- <method name="ackSetSinkSoundProperty">
+- <arg name="handle" type="q" direction="in" />
+- <arg name="error" type="q" direction="in" />
+- </method>
+- <method name="ackSetSourceSoundProperties">
+- <arg name="handle" type="q" direction="in" />
+- <arg name="error" type="q" direction="in" />
+- </method>
+- <method name="ackSetSourceSoundProperty">
+- <arg name="handle" type="q" direction="in" />
+- <arg name="error" type="q" direction="in" />
+- </method>
+- <method name="ackCrossFading">
+- <arg name="handle" type="q" direction="in" />
+- <arg name="hotsink" type="n" direction="in" />
+- <arg name="error" type="q" direction="in" />
+- </method>
+- <method name="ackSourceVolumeTick">
+- <arg name="handle" type="q" direction="in" />
+- <arg name="source" type="q" direction="in" />
+- <arg name="volume" type="n" direction="in" />
+- </method>
+- <method name="ackSinkVolumeTick">
+- <arg name="handle" type="q" direction="in" />
+- <arg name="sink" type="q" direction="in" />
+- <arg name="volume" type="n" direction="in" />
+- </method>
+- <method name="peekDomain">
+- <arg name="name" type="s" direction="in" />
+- <arg name="domainid" type="q" direction="out" />
+- <arg name="error" type="q" direction="out" />
+- </method>
+- <method name="registerDomain">
+- <arg name="domaindata" type="(qsssbbn)" direction="in" /> <!-- am_domainID_t domainID; std::string name; std::string busname; std::string nodename; bool early; bool complete; am_DomainState_e state; -->
+- <arg name="returnBusname" type="s" direction="in" /> <!-- the busname for all communication to this domain -->
+- <arg name="returnPath" type="s" direction="in" /> <!-- the path for all communication to this domain -->
+- <arg name="returnInterface" type="s" direction="in" /> <!-- the interface for all communication to this domain -->
+- <arg name="domainid" type="q" direction="out" />
+- <arg name="error" type="q" direction="out" />
+- </method>
+-<!--check the parameters-->
+- <method name="deregisterDomain">
+- <arg name="handle" type="q" direction="in" />
+- <arg name="error" type="q" direction="in" />
+- <arg name="domainid" type="q" direction="in" />
+- <arg name="error" type="q" direction="out" />
+- </method>
+- <method name="registerGateway">
+- <arg name="gatewayData" type="(qsqqqqqaiaiab)" direction="in" /> <!-- am_gatewayID_t gatewayID; std::string name; am_sinkID_t sinkID; am_sourceID_t sourceID; am_domainID_t domainSinkID; am_domainID_t domainSourceID; am_domainID_t controlDomainID; std::vector<am_CustomAvailabilityReason_t> listSourceFormats; std::vector<am_CustomAvailabilityReason_t> listSinkFormats; std::vector<bool> convertionMatrix; -->
+- <arg name="gatewayID" type="q" direction="out" />
+- <arg name="error" type="q" direction="out" />
+- </method>
+- <method name="registerConverter">
+- <arg name="converterData" type="(qsqqqaiaiab)" direction="in" /> <!-- am_converterID_t converterID; std::string name; am_sinkID_t sinkID; am_sourceID_t sourceID; am_domainID_t domainID; std::vector<am_CustomAvailabilityReason_t> listSourceFormats; std::vector<am_CustomAvailabilityReason_t> listSinkFormats; std::vector<bool> convertionMatrix; -->
+- <arg name="converterID" type="q" direction="out" />
+- <arg name="error" type="q" direction="out" />
+- </method>
+- <method name="deregisterGateway">
+- <arg name="gatewayID" type="q" direction="in" />
+- <arg name="error" type="q" direction="out" />
+- </method>
+- <method name="deregisterConverter">
+- <arg name="converterID" type="q" direction="in" />
+- <arg name="error" type="q" direction="out" />
+- </method>
+- <method name="peekSink">
+- <arg name="name" type="s" direction="in" />
+- <arg name="sinkID" type="q" direction="out" />
+- <arg name="error" type="q" direction="out" />
+- </method>
+- <method name="registerSink">
+- <arg name="sinkData" type="(qsqinb(ii)nna(in)aia(in)a(iin)a(iin))" direction="in" /> <!-- am_sinkID_t sinkID; std::string name; am_domainID_t domainID; am_sinkClass_t sinkClassID; am_volume_t volume; bool visible; am_Availability_s available; am_MuteState_e muteState;am_mainVolume_t mainVolume; std::vector<am_SoundProperty_s> listSoundProperties; std::vector<am_CustomAvailabilityReason_t> listConnectionFormats; std::vector<am_MainSoundProperty_s> listMainSoundProperties; -->
+- <arg name="sinkID" type="q" direction="out" />
+- <arg name="error" type="q" direction="out" />
+- </method>
+- <method name="deregisterSink">
+- <arg name="sinkID" type="q" direction="in" />
+- <arg name="error" type="i" direction="out" />
+- </method>
+- <method name="peekSource">
+- <arg name="name" type="s" direction="in" />
+- <arg name="sourceID" type="q" direction="out" />
+- <arg name="error" type="q" direction="out" />
+- </method>
+- <method name="registerSource">
+- <arg name="sourceData" type="(qqsqinb(ii)qa(in)aia(in)a(iin)a(iin))" direction="in" /> <!-- am_sourceID_t sourceID; am_domainID_t domainID; std::string name; am_sourceClass_t sourceClassID; am_SourceState_e sourceState; am_volume_t volume; bool visible; am_Availability_s available; am_InterruptState_e interruptState; std::vector<am_SoundProperty_s> listSoundProperties; std::vector<am_CustomAvailabilityReason_t> listConnectionFormats; std::vector<am_MainSoundProperty_s> listMainSoundProperties; -->
+- <arg name="sourceID" type="q" direction="out" />
+- <arg name="error" type="q" direction="out" />
+- </method>
+- <method name="deregisterSource">
+- <arg name="sourceid" type="q" direction="in" />
+- <arg name="error" type="q" direction="out" />
+- </method>
+- <method name="registerCrossfader">
+- <arg name="crossfaderData" type="(qsqqqq)" direction="in" /> <!-- am_crossfaderID_t crossfaderID; std::string name; am_sinkID_t sinkID_A; am_sinkID_t sinkID_B; am_sourceID_t sourceID; am_HotSink_e hotSink; -->
+- <arg name="crossfaderID" type="q" direction="out" />
+- <arg name="error" type="q" direction="out" />
+- </method>
+- <method name="deregisterCrossfader">
+- <arg name="crossfaderID" type="q" direction="in" />
+- <arg name="error" type="q" direction="out" />
+- </method>
+- <method name="peekSourceClassID">
+- <arg name="name" type="s" direction="in" />
+- <arg name="sourceClassID" type="q" direction="out" />
+- <arg name="error" type="q" direction="out" />
+- </method>
+- <method name="peekSinkClassID">
+- <arg name="name" type="s" direction="in" />
+- <arg name="sinkClassID" type="q" direction="out" />
+- <arg name="error" type="q" direction="out" />
+- </method>
+- <method name="hookInterruptStatusChange">
+- <arg name="sourceID" type="q" direction="in" />
+- <arg name="interruptState" type="q" direction="in" />
+- </method>
+- <method name="hookDomainRegistrationComplete">
+- <arg name="domainID" type="q" direction="in" />
+- </method>
+- <method name="hookSinkAvailablityStatusChange">
+- <arg name="sinkID" type="q" direction="in" />
+- <arg name="availability" type="(nn)" direction="in"/>
+- </method>
+- <method name="hookSourceAvailablityStatusChange">
+- <arg name="sourceID" type="q" direction="in" />
+- <arg name="availability" type="(nn)" direction="in"/>
+- </method>
+- <method name="hookDomainStateChange">
+- <arg name="domainID" type="q" direction="in" />
+- <arg name="domainState" type="q" direction="in"/>
+- </method>
+- <method name="hookTimingInformationChanged">
+- <arg name="connectionID" type="q" direction="in" />
+- <arg name="delay" type="n" direction="in"/>
+- </method>
+- <method name="sendChangedData"> <!--am_EarlyDataType_e type; am_DataType_u sinksource; am_EarlyData_u data; -->
+- <arg name="earlyData_volumes" type="a(qqn)" direction="in" /> <!-- only the volumes as array -->
+- <arg name="earlyData_soundproperties" type="a(qq(nn))" direction="in" /> <!--only the soundproperties as value -->
+- </method>
+- <method name="confirmRoutingReady">
+- <arg name="domainID" type="q" direction="in" />
+- </method>
+- <method name="confirmRoutingRundown">
+- <arg name="domainID" type="q" direction="in" />
+- </method>
+- <method name="updateGateway">
+- <arg name="gatewayID" type="q" direction="in" />
+- <arg name="listSourceFormats" type="a(q)" direction="in" />
+- <arg name="listSinkFormats" type="a(q)" direction="in" />
+- <arg name="conversionMatrix" type="a(b)" direction="in" />
+- </method>
+- <method name="updateConverter">
+- <arg name="converterID" type="q" direction="in" />
+- <arg name="listSourceFormats" type="a(q)" direction="in" />
+- <arg name="listSinkFormats" type="a(q)" direction="in" />
+- <arg name="conversionMatrix" type="a(b)" direction="in" />
+- </method>
+- <method name="updateSink">
+- <arg name="sinkID" type="q" direction="in" />
+- <arg name="sinkClassID" type="q" direction="in" />
+- <arg name="listSoundProperties" type="a(nn)" direction="in" />
+- <arg name="listConnectionFormats" type="a(q)" direction="in" />
+- <arg name="listMainSoundProperties" type="a(nn)" direction="in" />
+- </method>
+- <method name="updateSource">
+- <arg name="sourceID" type="q" direction="in" />
+- <arg name="sourceClassID" type="q" direction="in" />
+- <arg name="listSoundProperties" type="a(nn)" direction="in" />
+- <arg name="listConnectionFormats" type="a(q)" direction="in" />
+- <arg name="listMainSoundProperties" type="a(nn)" direction="in" />
+- </method>
+- <method name="ackSetVolumes">
+- <arg name="handle" type="q" direction="in" />
+- <arg name="listvolumes" type="a(nqqnq)" direction="in" />
+- <arg name="error" type="q" direction="in" />
+- </method>
+- <method name="ackSinkNotificationConfiguration">
+- <arg name="handle" type="q" direction="in" />
+- <arg name="error" type="q" direction="in" />
+- </method>
+- <method name="ackSourceNotificationConfiguration">
+- <arg name="handle" type="q" direction="in" />
+- <arg name="error" type="q" direction="in" />
+- </method>
+- <method name="hookSinkNotificationDataChange">
+- <arg name="sinkID" type="q" direction="in" />
+- <arg name="payload" type="(nn)" direction="in" />
+- </method>
+- <method name="hookSourceNotificationDataChange">
+- <arg name="sourceID" type="q" direction="in" />
+- <arg name="payload" type="(nn)" direction="in" />
+- </method>
+- <method name='getRoutingReadyState'>
+- <arg name='state' type='b' direction='out' />
+- </method>
+-
+- <signal name="setRoutingReady">
+- </signal>
+- <signal name="setRoutingRundown">
+- </signal>
+- </interface>
+-</node>
+diff --git a/PluginRoutingInterfaceDBus/include/RoutingSender.xml b/PluginRoutingInterfaceDBus/include/RoutingSender.xml
+deleted file mode 100644
+index 133a6fe..0000000
+--- a/PluginRoutingInterfaceDBus/include/RoutingSender.xml
++++ /dev/null
+@@ -1,76 +0,0 @@
+-<?xml version="1.0" encoding="UTF-8" ?>
+-<!DOCTYPE node PUBLIC
+- "-//freedesktop//DTD D-Bus Object Introspection 1.0//EN"
+- "http://standards.freedesktop.org/dbus/1.0/introspect.dtd">
+-
+-<node>
+- <interface name='org.pulseaudio.genivi.routingsend'>
+- <method name='asyncAbort'>
+- <arg name='handle' type='q' direction='in' />
+- <arg name='error' type='n' direction='out' />
+- </method>
+- <method name='asyncConnect'>
+- <arg name='handle' type='q' direction='in' />
+- <arg name='connectionID' type='q' direction='in' />
+- <arg name='sourceID' type='q' direction='in' />
+- <arg name='sinkID' type='q' direction='in' />
+- <arg name='connectionFormat' type='i' direction='in' />
+- </method>
+- <method name='asyncDisconnect'>
+- <arg name='handle' type='q' direction='in' />
+- <arg name='connectionID' type='q' direction='in' />
+- </method>
+- <method name='asyncSetSinkVolume'>
+- <arg name='handle' type='q' direction='in' />
+- <arg name='sinkID' type='q' direction='in' />
+- <arg name='volume' type='n' direction='in' />
+- <arg name='ramp' type='n' direction='in' />
+- <arg name='time' type='q' direction='in' />
+- </method>
+- <method name='asyncSetSourceVolume'>
+- <arg name='handle' type='q' direction='in' />
+- <arg name='sourceID' type='q' direction='in' />
+- <arg name='volume' type='n' direction='in' />
+- <arg name='ramp' type='n' direction='in' />
+- <arg name='time' type='q' direction='in' />
+- </method>
+- <method name='asyncSetSourceState'>
+- <arg name='handle' type='q' direction='in' />
+- <arg name='sourceID' type='q' direction='in' />
+- <arg name='sourceState' type='i' direction='in' />
+- </method>
+- <method name='asyncSetSinkSoundProperties'>
+- <arg name='handle' type='q' direction='in' />
+- <arg name='sinkID' type='q' direction='in' />
+- <arg name='listSoundProperties' type='a(nn)' direction='in' />
+- </method>
+- <method name='asyncSetSinkSoundProperty'>
+- <arg name='handle' type='q' direction='in' />
+- <arg name='sinkID' type='q' direction='in' />
+- <arg name='soundProperty' type='(nn)' direction='in' />
+- </method>
+- <method name='asyncSetSourceSoundProperty'>
+- <arg name='handle' type='q' direction='in' />
+- <arg name='sourceID' type='q' direction='in' />
+- <arg name='soundProperty' type='(nn)' direction='in' />
+- </method>
+- <method name='asyncSetSourceSoundProperties'>
+- <arg name='handle' type='q' direction='in' />
+- <arg name='sourceID' type='q' direction='in' />
+- <arg name='listSoundProperties' type='a(nn)' direction='in' />
+- </method>
+- <method name='asyncCrossFade'>
+- <arg name='handle' type='q' direction='in' />
+- <arg name='crossfaderID' type='q' direction='in' />
+- <arg name='hotSink' type='q' direction='in' />
+- <arg name='rampType' type='q' direction='in' />
+- <arg name='time' type='q' direction='in' />
+- </method>
+- <method name='setDomainState'>
+- <arg name='domainID' type='q' direction='in' />
+- <arg name='domainState' type='q' direction='in' />
+- <arg name='error' type='i' direction='out' />
+- </method>
+-
+- </interface>
+-</node>
+diff --git a/PluginRoutingInterfaceDBus/include/configRoutingDbus.h b/PluginRoutingInterfaceDBus/include/configRoutingDbus.h
+deleted file mode 100644
+index 29e657b..0000000
+--- a/PluginRoutingInterfaceDBus/include/configRoutingDbus.h
++++ /dev/null
+@@ -1,6 +0,0 @@
+-#ifndef _ROUTINGDBUS_CONFIG_H
+-#define _ROUTINGDBUS_CONFIG_H
+-
+-#define ROUTING_DBUS_INTROSPECTION_FILE "/usr/local/share/audiomanager/audiomanager/RoutingReceiver.xml"
+-
+-#endif /* _ROUTINGDBUS_CONFIG_H */
+diff --git a/PluginRoutingInterfaceDBus/src/CAmDbusMessageHandler.cpp b/PluginRoutingInterfaceDBus/src/CAmDbusMessageHandler.cpp
+deleted file mode 100644
+index f3a0682..0000000
+--- a/PluginRoutingInterfaceDBus/src/CAmDbusMessageHandler.cpp
++++ /dev/null
+@@ -1,1194 +0,0 @@
+-/**
+- * Copyright (c) copyright 2011-2012 Aricent® Group and its licensors
+- * Copyright (c) 2012 BMW
+- *
+- * \author Sampreeth Ramavana
+- * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
+- *
+- * \copyright
+- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction,
+- * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
+- * subject to the following conditions:
+- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
+- * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+- *
+- * For further information see http://www.genivi.org/.
+- */
+-
+-#include "CAmDbusMessageHandler.h"
+-#include "audiomanagerconfig.h"
+-#include <cstdlib>
+-#include <cassert>
+-#include <vector>
+-#include "CAmRoutingSenderDbus.h"
+-#include "CAmDltWrapper.h"
+-
+-namespace am
+-{
+-
+-DLT_IMPORT_CONTEXT(routingDbus)
+-
+-CAmRoutingDbusMessageHandler::CAmRoutingDbusMessageHandler() :
+- mDBusMessageIter(), //
+- mDBusError(), //
+- mSerial(0), //
+- mErrorName(""), //
+- mErrorMsg(""), //
+- mpDBusMessage(NULL), //
+- mpReveiveMessage(NULL), //
+- mpDBusConnection(NULL)
+-{
+- //CAmDltWrapper::instance()->registerContext(routingDbus, "DRS", "DBus Plugin");
+- log(&routingDbus, DLT_LOG_INFO, "DBusMessageHandler constructed");
+-}
+-
+-CAmRoutingDbusMessageHandler::~CAmRoutingDbusMessageHandler()
+-{
+- log(&routingDbus, DLT_LOG_INFO, "DBUSMessageHandler destructed");
+-}
+-
+-void CAmRoutingDbusMessageHandler::initReceive(DBusMessage* msg)
+-{
+- assert(msg!=NULL);
+- mpReveiveMessage = msg;
+- if (!dbus_message_iter_init(msg, &mDBusMessageIter))
+- {
+- log(&routingDbus, DLT_LOG_INFO, "DBusMessageHandler::initReceive DBus Message has no arguments!");
+- mErrorName = std::string(DBUS_ERROR_INVALID_ARGS);
+- mErrorMsg = "DBUS Message has no arguments!";
+- }
+-}
+-
+-void CAmRoutingDbusMessageHandler::initReply(DBusMessage* msg)
+-{
+- assert(msg!=NULL);
+- mpDBusMessage = dbus_message_new_method_return(msg);
+- if (mpDBusMessage == NULL)
+- {
+- log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::initReply Cannot allocate DBus message!");
+- mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
+- mErrorMsg = "Cannot create reply!";
+- }
+- dbus_message_iter_init_append(mpDBusMessage, &mDBusMessageIter);
+-}
+-
+-void CAmRoutingDbusMessageHandler::initSignal(std::string path, std::string signalName)
+-{
+- assert(!path.empty());
+- assert(!signalName.empty());
+- std::string completePath = std::string(DBUS_SERVICE_OBJECT_PATH) + "/" + path;
+- std::string completeInterface = std::string(DBUS_SERVICE_PREFIX) + "." + ROUTING_NODE;
+- mpDBusMessage = dbus_message_new_signal(completePath.c_str(), completeInterface.c_str(), signalName.c_str());
+-
+- if (mpDBusMessage == NULL)
+- {
+- log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::initSignal Cannot allocate DBus message!");
+- }
+- dbus_message_iter_init_append(mpDBusMessage, &mDBusMessageIter);
+-}
+-
+-void CAmRoutingDbusMessageHandler::sendMessage()
+-{
+- assert(mpDBusConnection!=NULL);
+- if (mpReveiveMessage != 0)
+- {
+- mSerial = dbus_message_get_serial(mpReveiveMessage);
+- }
+- else
+- {
+- mSerial = 1;
+- }
+- if (!mErrorName.empty())
+- {
+- mpDBusMessage = dbus_message_new_error(mpReveiveMessage, mErrorName.c_str(), mErrorMsg.c_str());
+- }
+- if (!dbus_connection_send(mpDBusConnection, mpDBusMessage, &mSerial))
+- {
+- log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::sendMessage cannot send message!");
+- }
+- dbus_connection_flush(mpDBusConnection);
+- dbus_message_unref(mpDBusMessage);
+- mpDBusMessage = NULL;
+-}
+-
+-char* CAmRoutingDbusMessageHandler::getString(DBusMessageIter& iter, bool next)
+-{
+- char* param = NULL;
+-
+- if (DBUS_TYPE_STRING != dbus_message_iter_get_arg_type(&iter))
+- {
+- log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::getString DBUS handler argument is no String!");
+- mErrorName = std::string(DBUS_ERROR_INVALID_ARGS);
+- mErrorMsg = "DBus argument is no string";
+- }
+- else
+- {
+- dbus_message_iter_get_basic(&iter, &param);
+- if (next)
+- dbus_message_iter_next(&iter);
+- }
+- return (param);
+-}
+-
+-char* CAmRoutingDbusMessageHandler::getString()
+-{
+- return (getString(mDBusMessageIter, true));
+-}
+-
+-dbus_bool_t CAmRoutingDbusMessageHandler::getBool(DBusMessageIter& iter, bool next)
+-{
+- dbus_bool_t boolparam = false;
+-
+- if (DBUS_TYPE_BOOLEAN != dbus_message_iter_get_arg_type(&iter))
+- {
+- log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::getBool DBUS handler argument is no bool!");
+- mErrorName = std::string(DBUS_ERROR_INVALID_ARGS);
+- mErrorMsg = "DBus argument is no bool";
+- }
+- else
+- {
+- dbus_message_iter_get_basic(&iter, &boolparam);
+- if (next)
+- dbus_message_iter_next(&iter);
+- }
+- return (boolparam);
+-}
+-
+-dbus_bool_t CAmRoutingDbusMessageHandler::getBool()
+-{
+- return (getBool(mDBusMessageIter, true));
+-}
+-
+-char CAmRoutingDbusMessageHandler::getByte(DBusMessageIter& iter, bool next)
+-{
+- char param(0);
+-
+- if (DBUS_TYPE_BYTE != dbus_message_iter_get_arg_type(&iter))
+- {
+- log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::getByte DBUS handler argument is no byte!");
+- mErrorName = std::string(DBUS_ERROR_INVALID_ARGS);
+- mErrorMsg = "DBus argument is no byte";
+- }
+- else
+- {
+- dbus_message_iter_get_basic(&iter, &param);
+- if (next)
+- dbus_message_iter_next(&iter);
+- }
+- return (param);
+-}
+-
+-char CAmRoutingDbusMessageHandler::getByte()
+-{
+- return (getByte(mDBusMessageIter, true));
+-}
+-
+-dbus_uint16_t CAmRoutingDbusMessageHandler::getUInt(DBusMessageIter& iter, bool next)
+-{
+- dbus_uint16_t param(0);
+-#ifdef GLIB_DBUS_TYPES_TOLERANT
+- if (DBUS_TYPE_UINT16 != dbus_message_iter_get_arg_type(&iter) && DBUS_TYPE_UINT32 != dbus_message_iter_get_arg_type(&iter))
+-#else
+- if (DBUS_TYPE_UINT16 != dbus_message_iter_get_arg_type(&iter))
+-#endif
+- {
+- log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::getUInt DBUS handler argument is no uint16_t!");
+- mErrorName = std::string(DBUS_ERROR_INVALID_ARGS);
+- mErrorMsg = "DBus argument is no uint16_t";
+- }
+- else
+- {
+- dbus_message_iter_get_basic(&iter, &param);
+- if (next)
+- dbus_message_iter_next(&iter);
+- }
+- return (param);
+-}
+-
+-dbus_uint16_t CAmRoutingDbusMessageHandler::getUInt()
+-{
+- return (getUInt(mDBusMessageIter, true));
+-}
+-
+-dbus_int16_t CAmRoutingDbusMessageHandler::getInt(DBusMessageIter& iter, bool next)
+-{
+- dbus_int16_t param(0);
+-#ifdef GLIB_DBUS_TYPES_TOLERANT
+- if (DBUS_TYPE_INT16 != dbus_message_iter_get_arg_type(&iter) && DBUS_TYPE_INT32 != dbus_message_iter_get_arg_type(&iter))
+-#else
+- if (DBUS_TYPE_INT16 != dbus_message_iter_get_arg_type(&iter))
+-#endif
+- {
+- log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::getInt DBUS handler argument is no int16_t!");
+- mErrorName = std::string(DBUS_ERROR_INVALID_ARGS);
+- mErrorMsg = "DBus argument is no int16_t";
+- }
+- else
+- {
+- dbus_message_iter_get_basic(&iter, &param);
+- if (next)
+- dbus_message_iter_next(&iter);
+- }
+- return (param);
+-}
+-
+-dbus_int16_t CAmRoutingDbusMessageHandler::getInt()
+-{
+- return (getInt(mDBusMessageIter, true));
+-}
+-
+-double CAmRoutingDbusMessageHandler::getDouble(DBusMessageIter& iter, bool next)
+-{
+- double param(0);
+- if (DBUS_TYPE_DOUBLE != dbus_message_iter_get_arg_type(&iter))
+- {
+- log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::getDouble DBUS handler argument is no double!");
+- mErrorName = std::string(DBUS_ERROR_INVALID_ARGS);
+- mErrorMsg = "DBus argument is no double";
+- }
+- else
+- {
+- dbus_message_iter_get_basic(&iter, &param);
+- if (next)
+- dbus_message_iter_next(&iter);
+- }
+- return (param);
+-}
+-
+-double CAmRoutingDbusMessageHandler::getDouble()
+-{
+- return (getDouble(mDBusMessageIter, true));
+-}
+-
+-am_Availability_s CAmRoutingDbusMessageHandler::getAvailability()
+-{
+- am::am_Availability_s availability;
+- availability.availability=A_UNKNOWN;
+- availability.availabilityReason=AR_UNKNOWN;
+- if (DBUS_TYPE_STRUCT != dbus_message_iter_get_arg_type(&mDBusMessageIter))
+- {
+- log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::getAvailability DBUS handler argument is no struct!");
+- mErrorName = std::string(DBUS_ERROR_INVALID_ARGS);
+- mErrorMsg = "DBus argument is no struct";
+- }
+- else
+- {
+- DBusMessageIter structIter;
+- dbus_message_iter_recurse(&mDBusMessageIter, &structIter);
+- availability.availability = static_cast<am_Availability_e>(getInt(structIter, true));
+- availability.availabilityReason = static_cast<am_CustomAvailabilityReason_t>(getInt(structIter, false));
+- dbus_message_iter_next(&mDBusMessageIter);
+- }
+- return (availability);
+-}
+-
+-std::vector<am_EarlyData_s> CAmRoutingDbusMessageHandler::getEarlyData()
+-{
+- std::vector<am_EarlyData_s> listEarlyData;
+- if (DBUS_TYPE_ARRAY != dbus_message_iter_get_arg_type(&mDBusMessageIter))
+- {
+- log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::getProperty DBUS handler argument is no array!");
+- mErrorName = std::string(DBUS_ERROR_INVALID_ARGS);
+- mErrorMsg = "DBus argument is no array";
+- }
+- else
+- {
+- DBusMessageIter arrayIter, structIter, soundpropIter;
+- am_EarlyData_s earlyData;
+-
+- //first the volume array
+- dbus_message_iter_recurse(&mDBusMessageIter, &arrayIter);
+- do
+- {
+- dbus_message_iter_recurse(&arrayIter, &structIter);
+- earlyData.type = static_cast<am_EarlyDataType_e>(getUInt(structIter, true));
+- if (earlyData.type==ED_SINK_VOLUME)
+- earlyData.sinksource.sink = static_cast<am_sinkID_t>(getUInt(structIter, true));
+- else
+- earlyData.sinksource.source = static_cast<am_sourceID_t>(getUInt(structIter, true));
+- earlyData.data.volume = static_cast<am_volume_t>(getInt(structIter, false));
+- listEarlyData.push_back(earlyData);
+- } while (dbus_message_iter_next(&arrayIter));
+- dbus_message_iter_next(&mDBusMessageIter);
+-
+- //then the soundproperty array
+- dbus_message_iter_recurse(&mDBusMessageIter, &arrayIter);
+- do
+- {
+- dbus_message_iter_recurse(&arrayIter, &structIter);
+- earlyData.type = static_cast<am_EarlyDataType_e>(getUInt(structIter, true));
+- if (earlyData.type==ED_SINK_PROPERTY)
+- earlyData.sinksource.sink = static_cast<am_sinkID_t>(getUInt(structIter, true));
+- else
+- earlyData.sinksource.source = static_cast<am_sourceID_t>(getUInt(structIter, true));
+- dbus_message_iter_recurse(&structIter, &soundpropIter);
+- earlyData.data.soundProperty.type = static_cast<am_CustomSoundPropertyType_t>(getInt(soundpropIter, true));
+- earlyData.data.soundProperty.value = (getInt(soundpropIter, false));
+- listEarlyData.push_back(earlyData);
+- } while (dbus_message_iter_next(&arrayIter));
+- }
+- return (listEarlyData);
+-}
+-
+-am_Domain_s CAmRoutingDbusMessageHandler::getDomainData()
+-{
+- am_Domain_s domainData;
+- DBusMessageIter domainDataIter;
+-
+- if (DBUS_TYPE_STRUCT != dbus_message_iter_get_arg_type(&mDBusMessageIter))
+- {
+- log(&routingDbus, DLT_LOG_ERROR, "CAmRoutingDbusMessageHandler::getDomainData DBUS handler argument is no struct!");
+- mErrorName = std::string(DBUS_ERROR_INVALID_ARGS);
+- mErrorMsg = "DBus argument is no struct";
+- }
+- else
+- {
+- dbus_message_iter_recurse(&mDBusMessageIter, &domainDataIter);
+- domainData.domainID = static_cast<am_domainID_t>(getUInt(domainDataIter, true));
+- domainData.name = getString(domainDataIter, true);
+- domainData.busname = getString(domainDataIter, true);
+- domainData.nodename = getString(domainDataIter, true);
+- domainData.early = getBool(domainDataIter, true);
+- domainData.complete = getBool(domainDataIter, true);
+- domainData.state = static_cast<am_DomainState_e>(getInt(domainDataIter, false));
+- dbus_message_iter_next(&mDBusMessageIter);
+- }
+- return (domainData);
+-}
+-
+-am_Source_s CAmRoutingDbusMessageHandler::getSourceData()
+-{
+- am_Source_s sourceData;
+- DBusMessageIter sourceDataIter, availIter, arrayIter, structIter;
+- am_SoundProperty_s soundProperty;
+- am_CustomAvailabilityReason_t connectionFormat;
+- am_MainSoundProperty_s mainSoundProperty;
+- am_NotificationConfiguration_s notificationConfiguration;
+- am_NotificationConfiguration_s MainnotificationConfiguration;
+-
+- if (DBUS_TYPE_STRUCT != dbus_message_iter_get_arg_type(&mDBusMessageIter))
+- {
+- log(&routingDbus, DLT_LOG_ERROR, "CAmRoutingDbusMessageHandler::getSourceData DBUS handler argument is no struct!");
+- mErrorName = std::string(DBUS_ERROR_INVALID_ARGS);
+- mErrorMsg = "DBus argument is no struct";
+- }
+- else
+- {
+- dbus_message_iter_recurse(&mDBusMessageIter, &sourceDataIter);
+- sourceData.sourceID = static_cast<am_sourceID_t>(getUInt(sourceDataIter, true));
+- sourceData.domainID = static_cast<am_domainID_t>(getUInt(sourceDataIter, true));
+- sourceData.name = getString(sourceDataIter, true);
+- sourceData.sourceClassID = static_cast<am_sourceClass_t>(getUInt(sourceDataIter, true));
+- sourceData.sourceState = static_cast<am_SourceState_e>(getInt32(sourceDataIter, true));
+- sourceData.volume = static_cast<am_volume_t>(getInt(sourceDataIter, true));
+- sourceData.visible = getBool(sourceDataIter, true);
+- dbus_message_iter_recurse(&sourceDataIter, &availIter);
+- sourceData.available.availability = static_cast<am_Availability_e>(getInt32(availIter, true));
+- sourceData.available.availabilityReason = static_cast<am_CustomAvailabilityReason_t>(getInt32(availIter, false));
+- dbus_message_iter_next(&sourceDataIter);
+- sourceData.interruptState = static_cast<am_InterruptState_e>(getUInt(sourceDataIter, true));
+- dbus_message_iter_recurse(&sourceDataIter, &arrayIter);
+- do
+- {
+- dbus_message_iter_recurse(&arrayIter, &structIter);
+- soundProperty.type = static_cast<am_CustomSoundPropertyType_t>(getInt32(structIter, true));
+- soundProperty.value = static_cast<int16_t>(getInt(structIter, false));
+- sourceData.listSoundProperties.push_back(soundProperty);
+- } while (dbus_message_iter_next(&arrayIter));
+- dbus_message_iter_next(&sourceDataIter);
+- dbus_message_iter_recurse(&sourceDataIter, &arrayIter);
+- do
+- {
+- connectionFormat = static_cast<am_CustomAvailabilityReason_t>(getInt32(arrayIter, false));
+- sourceData.listConnectionFormats.push_back(connectionFormat);
+- } while (dbus_message_iter_next(&arrayIter));
+- dbus_message_iter_next(&sourceDataIter);
+-
+- dbus_message_iter_recurse(&sourceDataIter, &arrayIter);
+- do
+- {
+- dbus_message_iter_recurse(&arrayIter, &structIter);
+- mainSoundProperty.type = static_cast<am_CustomMainSoundPropertyType_t>(getInt32(structIter, true));
+- mainSoundProperty.value = static_cast<int16_t>(getInt(structIter, false));
+- sourceData.listMainSoundProperties.push_back(mainSoundProperty);
+- } while (dbus_message_iter_next(&arrayIter));
+- dbus_message_iter_next(&sourceDataIter);
+-
+- dbus_message_iter_recurse(&sourceDataIter, &arrayIter);
+- do
+- {
+- dbus_message_iter_recurse(&arrayIter, &structIter);
+- MainnotificationConfiguration.type = static_cast<am_CustomNotificationType_t>(getInt32(structIter, true));
+- MainnotificationConfiguration.parameter = static_cast<int16_t>(getInt32(structIter, false));
+- MainnotificationConfiguration.status = static_cast<am_NotificationStatus_e>(getInt(structIter, true));
+- sourceData.listMainNotificationConfigurations.push_back(MainnotificationConfiguration);
+- } while (dbus_message_iter_next(&arrayIter));
+- dbus_message_iter_next(&sourceDataIter);
+-
+- dbus_message_iter_recurse(&sourceDataIter, &arrayIter);
+- do
+- {
+- dbus_message_iter_recurse(&arrayIter, &structIter);
+- notificationConfiguration.type = static_cast<am_CustomNotificationType_t>(getInt32(structIter, true));
+- notificationConfiguration.parameter = static_cast<int16_t>(getInt32(structIter, false));
+- notificationConfiguration.status = static_cast<am_NotificationStatus_e>(getInt(structIter, true));
+- sourceData.listNotificationConfigurations.push_back(notificationConfiguration);
+- } while (dbus_message_iter_next(&arrayIter));
+- dbus_message_iter_next(&mDBusMessageIter);
+- }
+- return (sourceData);
+-}
+-
+-am_Sink_s CAmRoutingDbusMessageHandler::getSinkData()
+-{
+- am_Sink_s sinkData;
+- DBusMessageIter sinkDataIter, structIter, availIter, arrayIter;
+- am_SoundProperty_s soundProperty;
+- am_CustomAvailabilityReason_t connectionFormat;
+- am_MainSoundProperty_s mainSoundProperty;
+- am_NotificationConfiguration_s notificationConfiguration;
+- am_NotificationConfiguration_s MainnotificationConfiguration;
+-
+- if (DBUS_TYPE_STRUCT != dbus_message_iter_get_arg_type(&mDBusMessageIter))
+- {
+- log(&routingDbus, DLT_LOG_ERROR, "CAmRoutingDbusMessageHandler::getSinkData DBUS handler argument is no struct!");
+- mErrorName = std::string(DBUS_ERROR_INVALID_ARGS);
+- mErrorMsg = "DBus argument is no struct";
+- }
+- else
+- {
+- dbus_message_iter_recurse(&mDBusMessageIter, &sinkDataIter);
+- sinkData.sinkID = static_cast<am_sinkID_t>(getUInt(sinkDataIter, true));
+- sinkData.name = getString(sinkDataIter, true);
+- sinkData.domainID = static_cast<am_domainID_t>(getUInt(sinkDataIter, true));
+- sinkData.sinkClassID = static_cast<am_sinkClass_t>(getInt32(sinkDataIter, true));
+- sinkData.volume = static_cast<am_volume_t>(getInt(sinkDataIter, true));
+- sinkData.visible = getBool(sinkDataIter, true);
+- dbus_message_iter_recurse(&sinkDataIter, &availIter);
+- sinkData.available.availability = static_cast<am_Availability_e>(getInt32(availIter, true));
+- sinkData.available.availabilityReason = static_cast<am_CustomAvailabilityReason_t>(getInt32(availIter, false));
+- dbus_message_iter_next(&sinkDataIter);
+- sinkData.muteState = static_cast<am_MuteState_e>(getInt(sinkDataIter, true));
+- sinkData.mainVolume = static_cast<am_mainVolume_t>(getInt(sinkDataIter, true));
+-
+- dbus_message_iter_recurse(&sinkDataIter, &arrayIter);
+- do
+- {
+- dbus_message_iter_recurse(&arrayIter, &structIter);
+- soundProperty.type = static_cast<am_CustomSoundPropertyType_t>(getInt32(structIter, true));
+- soundProperty.value = static_cast<int16_t>(getInt(structIter, false));
+- sinkData.listSoundProperties.push_back(soundProperty);
+- } while (dbus_message_iter_next(&arrayIter));
+-
+- dbus_message_iter_next(&sinkDataIter);
+-
+- dbus_message_iter_recurse(&sinkDataIter, &arrayIter);
+- do
+- {
+- connectionFormat = static_cast<am_CustomAvailabilityReason_t>(getInt32(arrayIter, false));
+- sinkData.listConnectionFormats.push_back(connectionFormat);
+- } while (dbus_message_iter_next(&arrayIter));
+- dbus_message_iter_next(&sinkDataIter);
+-
+- dbus_message_iter_recurse(&sinkDataIter, &arrayIter);
+- do
+- {
+- dbus_message_iter_recurse(&arrayIter, &structIter);
+- mainSoundProperty.type = static_cast<am_CustomMainSoundPropertyType_t>(getInt32(structIter, true));
+- mainSoundProperty.value = static_cast<int16_t>(getInt(structIter, false));
+- sinkData.listMainSoundProperties.push_back(mainSoundProperty);
+- } while (dbus_message_iter_next(&arrayIter));
+- dbus_message_iter_next(&sinkDataIter);
+-
+- dbus_message_iter_recurse(&sinkDataIter, &arrayIter);
+- do
+- {
+- dbus_message_iter_recurse(&arrayIter, &structIter);
+- MainnotificationConfiguration.type = static_cast<am_CustomNotificationType_t>(getInt32(structIter, true));
+- MainnotificationConfiguration.parameter = static_cast<int16_t>(getInt32(structIter, false));
+- MainnotificationConfiguration.status = static_cast<am_NotificationStatus_e>(getInt(structIter, true));
+- sinkData.listMainNotificationConfigurations.push_back(MainnotificationConfiguration);
+- } while (dbus_message_iter_next(&arrayIter));
+- dbus_message_iter_next(&sinkDataIter);
+-
+- dbus_message_iter_recurse(&sinkDataIter, &arrayIter);
+- do
+- {
+- dbus_message_iter_recurse(&arrayIter, &structIter);
+- notificationConfiguration.type = static_cast<am_CustomNotificationType_t>(getInt32(structIter, true));
+- notificationConfiguration.parameter = static_cast<int16_t>(getInt32(structIter, false));
+- notificationConfiguration.status = static_cast<am_NotificationStatus_e>(getInt(structIter, true));
+- sinkData.listNotificationConfigurations.push_back(notificationConfiguration);
+- } while (dbus_message_iter_next(&arrayIter));
+- dbus_message_iter_next(&mDBusMessageIter);
+- }
+- return (sinkData);
+-}
+-
+-am_Gateway_s CAmRoutingDbusMessageHandler::getGatewayData()
+-{
+- am_Gateway_s gatewayData;
+- DBusMessageIter gatewayDataIter, arrayIter;
+- am_CustomAvailabilityReason_t connectionFormat;
+- bool convertion;
+- if (DBUS_TYPE_STRUCT != dbus_message_iter_get_arg_type(&mDBusMessageIter))
+- {
+- log(&routingDbus, DLT_LOG_ERROR, "CAmRoutingDbusMessageHandler::getDomainData DBUS handler argument is no struct!");
+- mErrorName = std::string(DBUS_ERROR_INVALID_ARGS);
+- mErrorMsg = "DBus argument is no struct";
+- }
+- else
+- {
+- dbus_message_iter_recurse(&mDBusMessageIter, &gatewayDataIter);
+- gatewayData.gatewayID = static_cast<am_gatewayID_t>(getUInt(gatewayDataIter, true));
+- gatewayData.name = getString(gatewayDataIter, true);
+- gatewayData.sinkID = static_cast<am_sinkID_t>(getUInt(gatewayDataIter, true));
+- gatewayData.sourceID = static_cast<am_sourceID_t>(getUInt(gatewayDataIter, true));
+- gatewayData.domainSinkID = static_cast<am_domainID_t>(getUInt(gatewayDataIter, true));
+- gatewayData.domainSourceID = static_cast<am_domainID_t>(getUInt(gatewayDataIter, true));
+- gatewayData.controlDomainID = static_cast<am_domainID_t>(getUInt(gatewayDataIter, true));
+- dbus_message_iter_recurse(&gatewayDataIter, &arrayIter);
+- do
+- {
+- connectionFormat = static_cast<am_CustomAvailabilityReason_t>(getInt32(arrayIter, false));
+- gatewayData.listSourceFormats.push_back(connectionFormat);
+- } while (dbus_message_iter_next(&arrayIter));
+- dbus_message_iter_next(&gatewayDataIter);
+- dbus_message_iter_recurse(&gatewayDataIter, &arrayIter);
+- do
+- {
+- connectionFormat = static_cast<am_CustomAvailabilityReason_t>(getInt32(arrayIter, false));
+- gatewayData.listSinkFormats.push_back(connectionFormat);
+- } while (dbus_message_iter_next(&arrayIter));
+- dbus_message_iter_next(&gatewayDataIter);
+- dbus_message_iter_recurse(&gatewayDataIter, &arrayIter);
+- do
+- {
+- convertion = getBool(arrayIter, false);
+- gatewayData.convertionMatrix.push_back(convertion);
+- } while (dbus_message_iter_next(&arrayIter));
+- dbus_message_iter_next(&mDBusMessageIter);
+- }
+- return (gatewayData);
+-}
+-
+-am_Converter_s CAmRoutingDbusMessageHandler::getConverterData()
+-{
+- am_Converter_s gatewayData;
+- DBusMessageIter gatewayDataIter, arrayIter;
+- am_CustomAvailabilityReason_t connectionFormat;
+- bool convertion;
+- if (DBUS_TYPE_STRUCT != dbus_message_iter_get_arg_type(&mDBusMessageIter))
+- {
+- log(&routingDbus, DLT_LOG_ERROR, "CAmRoutingDbusMessageHandler::getDomainData DBUS handler argument is no struct!");
+- mErrorName = std::string(DBUS_ERROR_INVALID_ARGS);
+- mErrorMsg = "DBus argument is no struct";
+- }
+- else
+- {
+- dbus_message_iter_recurse(&mDBusMessageIter, &gatewayDataIter);
+- gatewayData.converterID = static_cast<am_gatewayID_t>(getUInt(gatewayDataIter, true));
+- gatewayData.name = getString(gatewayDataIter, true);
+- gatewayData.sinkID = static_cast<am_sinkID_t>(getUInt(gatewayDataIter, true));
+- gatewayData.sourceID = static_cast<am_sourceID_t>(getUInt(gatewayDataIter, true));
+- gatewayData.domainID = static_cast<am_domainID_t>(getUInt(gatewayDataIter, true));
+- dbus_message_iter_recurse(&gatewayDataIter, &arrayIter);
+- do
+- {
+- connectionFormat = static_cast<am_CustomAvailabilityReason_t>(getInt32(arrayIter, false));
+- gatewayData.listSourceFormats.push_back(connectionFormat);
+- } while (dbus_message_iter_next(&arrayIter));
+- dbus_message_iter_next(&gatewayDataIter);
+- dbus_message_iter_recurse(&gatewayDataIter, &arrayIter);
+- do
+- {
+- connectionFormat = static_cast<am_CustomAvailabilityReason_t>(getInt32(arrayIter, false));
+- gatewayData.listSinkFormats.push_back(connectionFormat);
+- } while (dbus_message_iter_next(&arrayIter));
+- dbus_message_iter_next(&gatewayDataIter);
+- dbus_message_iter_recurse(&gatewayDataIter, &arrayIter);
+- do
+- {
+- convertion = getBool(arrayIter, false);
+- gatewayData.convertionMatrix.push_back(convertion);
+- } while (dbus_message_iter_next(&arrayIter));
+- dbus_message_iter_next(&mDBusMessageIter);
+- }
+- return (gatewayData);
+-}
+-
+-am_Crossfader_s CAmRoutingDbusMessageHandler::getCrossfaderData()
+-{
+- am_Crossfader_s crossfaderData;
+- DBusMessageIter crossfaderDataIter;
+-
+- if (DBUS_TYPE_STRUCT != dbus_message_iter_get_arg_type(&mDBusMessageIter))
+- {
+- log(&routingDbus, DLT_LOG_ERROR, "CAmRoutingDbusMessageHandler::getCrossfaderData DBUS handler argument is no struct!");
+- mErrorName = std::string(DBUS_ERROR_INVALID_ARGS);
+- mErrorMsg = "DBus argument is no struct";
+- }
+- else
+- {
+- dbus_message_iter_recurse(&mDBusMessageIter, &crossfaderDataIter);
+- crossfaderData.crossfaderID = static_cast<am_crossfaderID_t> (getUInt(crossfaderDataIter, true));
+- crossfaderData.name = static_cast<std::string> (getString(crossfaderDataIter, true));
+- crossfaderData.sinkID_A = static_cast<am_sinkID_t> (getUInt(crossfaderDataIter, true));
+- crossfaderData.sinkID_B = static_cast<am_sinkID_t> (getUInt(crossfaderDataIter, true));
+- crossfaderData.sourceID = static_cast<am_sourceID_t> (getUInt(crossfaderDataIter, true));
+- crossfaderData.hotSink = static_cast<am_HotSink_e> (getUInt(crossfaderDataIter, false));
+- dbus_message_iter_next(&mDBusMessageIter);
+- }
+- return (crossfaderData);
+-}
+-
+-am_MainSoundProperty_s CAmRoutingDbusMessageHandler::getMainSoundProperty()
+-{
+- am_MainSoundProperty_s mainSoundProperty;
+- DBusMessageIter structIter;
+-
+- dbus_message_iter_recurse(&mDBusMessageIter, &structIter);
+- mainSoundProperty.type = static_cast<am_CustomMainSoundPropertyType_t>(getInt(structIter, true));
+- mainSoundProperty.value = static_cast<int16_t>(getInt(structIter, false));
+- dbus_message_iter_next(&mDBusMessageIter);
+-
+- return (mainSoundProperty);
+-}
+-
+-void CAmRoutingDbusMessageHandler::append(bool toAppend)
+-{
+- dbus_bool_t mybool = toAppend;
+- if (!dbus_message_iter_append_basic(&mDBusMessageIter, DBUS_TYPE_BOOLEAN, &mybool))
+- {
+- log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
+- mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
+- mErrorMsg = "Cannot create reply!";
+- }
+-}
+-
+-void CAmRoutingDbusMessageHandler::append(double toAppend)
+-{
+- if (!dbus_message_iter_append_basic(&mDBusMessageIter, DBUS_TYPE_DOUBLE, &toAppend))
+- {
+- log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
+- mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
+- mErrorMsg = "Cannot create reply!";
+- }
+-}
+-
+-void CAmRoutingDbusMessageHandler::append(char toAppend)
+-{
+- if (!dbus_message_iter_append_basic(&mDBusMessageIter, DBUS_TYPE_BYTE, &toAppend))
+- {
+- log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
+- mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
+- mErrorMsg = "Cannot create reply!";
+- }
+-}
+-
+-void CAmRoutingDbusMessageHandler::append(dbus_int16_t toAppend)
+-{
+- if (!dbus_message_iter_append_basic(&mDBusMessageIter, DBUS_TYPE_INT16, &toAppend))
+- {
+- log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
+- mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
+- mErrorMsg = "Cannot create reply!";
+- }
+-}
+-
+-void CAmRoutingDbusMessageHandler::append(dbus_uint16_t toAppend)
+-{
+- if (!dbus_message_iter_append_basic(&mDBusMessageIter, DBUS_TYPE_UINT16, &toAppend))
+- {
+- log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
+- mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
+- mErrorMsg = "Cannot create reply!";
+- }
+-}
+-
+-void CAmRoutingDbusMessageHandler::setDBusConnection(DBusConnection*& connection)
+-{
+- assert(connection != NULL);
+- mpDBusConnection = connection;
+-}
+-
+-void CAmRoutingDbusMessageHandler::append(const am::am_SinkType_s& sinkType)
+-{
+- DBusMessageIter structIter;
+- DBusMessageIter structAvailIter;
+- dbus_bool_t success = true;
+- success = success && dbus_message_iter_open_container(&mDBusMessageIter, DBUS_TYPE_STRUCT, NULL, &structIter);
+- success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_UINT16, &sinkType.sinkID);
+- success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_STRING, &sinkType.name);
+- success = success && dbus_message_iter_open_container(&structIter, DBUS_TYPE_STRUCT, NULL, &structAvailIter);
+- success = success && dbus_message_iter_append_basic(&structAvailIter, DBUS_TYPE_INT16, &sinkType.availability.availability);
+- success = success && dbus_message_iter_append_basic(&structAvailIter, DBUS_TYPE_INT16, &sinkType.availability.availabilityReason);
+- success = success && dbus_message_iter_close_container(&structIter, &structAvailIter);
+- success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &sinkType.volume);
+- success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &sinkType.muteState);
+- success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_UINT16, &sinkType.sinkClassID);
+- success = success && dbus_message_iter_close_container(&mDBusMessageIter, &structIter);
+- if (!success)
+- {
+- log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
+- mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
+- mErrorMsg = "Cannot create reply!";
+- }
+-}
+-
+-void CAmRoutingDbusMessageHandler::append(const am::am_SourceType_s& sourceType)
+-{
+- DBusMessageIter structIter;
+- DBusMessageIter structAvailIter;
+- dbus_bool_t success = true;
+- success = success && dbus_message_iter_open_container(&mDBusMessageIter, DBUS_TYPE_STRUCT, NULL, &structIter);
+- success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_UINT16, &sourceType.sourceID);
+- success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_STRING, &sourceType.name);
+- success = success && dbus_message_iter_open_container(&structIter, DBUS_TYPE_STRUCT, NULL, &structAvailIter);
+- success = success && dbus_message_iter_append_basic(&structAvailIter, DBUS_TYPE_INT16, &sourceType.availability.availability);
+- success = success && dbus_message_iter_append_basic(&structAvailIter, DBUS_TYPE_INT16, &sourceType.availability.availabilityReason);
+- success = success && dbus_message_iter_close_container(&structIter, &structAvailIter);
+- success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_UINT16, &sourceType.sourceClassID);
+- success = success && dbus_message_iter_close_container(&mDBusMessageIter, &structIter);
+- if (!success)
+- {
+- log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
+- mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
+- mErrorMsg = "Cannot create reply!";
+- }
+-}
+-
+-void CAmRoutingDbusMessageHandler::append(const am::am_MainSoundProperty_s mainSoundProperty)
+-{
+- DBusMessageIter structIter;
+- dbus_bool_t success = true;
+- success = success && dbus_message_iter_open_container(&mDBusMessageIter, DBUS_TYPE_STRUCT, NULL, &structIter);
+- success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &mainSoundProperty.type);
+- success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &mainSoundProperty.value);
+- success = success && dbus_message_iter_close_container(&mDBusMessageIter, &structIter);
+- if (!success)
+- {
+- log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
+- mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
+- mErrorMsg = "Cannot create reply!";
+- }
+-}
+-
+-void CAmRoutingDbusMessageHandler::append(const am::am_Availability_s& availability)
+-{
+- DBusMessageIter structAvailIter;
+- dbus_bool_t success = true;
+- success = success && dbus_message_iter_open_container(&mDBusMessageIter, DBUS_TYPE_STRUCT, NULL, &structAvailIter);
+- success = success && dbus_message_iter_append_basic(&structAvailIter, DBUS_TYPE_INT16, &availability.availability);
+- success = success && dbus_message_iter_append_basic(&structAvailIter, DBUS_TYPE_INT16, &availability.availabilityReason);
+- success = success && dbus_message_iter_close_container(&mDBusMessageIter, &structAvailIter);
+- if (!success)
+- {
+- log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
+- mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
+- mErrorMsg = "Cannot create reply!";
+- }
+-}
+-
+-void CAmRoutingDbusMessageHandler::append(const am::am_SystemProperty_s& SystemProperty)
+-{
+- DBusMessageIter structIter;
+- dbus_bool_t success = true;
+- success = success && dbus_message_iter_open_container(&mDBusMessageIter, DBUS_TYPE_STRUCT, NULL, &structIter);
+- success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &SystemProperty.type);
+- success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &SystemProperty.value);
+- success = success && dbus_message_iter_close_container(&mDBusMessageIter, &structIter);
+- if (!success)
+- {
+- log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
+- mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
+- mErrorMsg = "Cannot create reply!";
+- }
+-}
+-
+-void CAmRoutingDbusMessageHandler::append(const std::vector<am::am_MainConnectionType_s>& listMainConnections)
+-{
+- DBusMessageIter arrayIter;
+- DBusMessageIter structIter;
+- std::vector<am::am_MainConnectionType_s>::const_iterator listIterator = listMainConnections.begin();
+- dbus_bool_t success = true;
+- success = success && dbus_message_iter_open_container(&mDBusMessageIter, DBUS_TYPE_ARRAY, "(qqqnn)", &arrayIter);
+- for (; listIterator < listMainConnections.end(); ++listIterator)
+- {
+- success = success && dbus_message_iter_open_container(&arrayIter, DBUS_TYPE_STRUCT, NULL, &structIter);
+- success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_UINT16, &listIterator->mainConnectionID);
+- success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_UINT16, &listIterator->sourceID);
+- success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_UINT16, &listIterator->sinkID);
+- success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &listIterator->delay);
+- success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &listIterator->connectionState);
+- success = success && dbus_message_iter_close_container(&arrayIter, &structIter);
+- }
+- success = success && dbus_message_iter_close_container(&mDBusMessageIter, &arrayIter);
+- if (!success)
+- {
+- log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
+- mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
+- mErrorMsg = "Cannot create reply!";
+- }
+-}
+-
+-void CAmRoutingDbusMessageHandler::append(const std::vector<am::am_SinkType_s>& listMainSinks)
+-{
+- DBusMessageIter arrayIter;
+- DBusMessageIter structIter;
+- DBusMessageIter availIter;
+- std::vector<am::am_SinkType_s>::const_iterator listIterator = listMainSinks.begin();
+- dbus_bool_t success = true;
+- success = success && dbus_message_iter_open_container(&mDBusMessageIter, DBUS_TYPE_ARRAY, "(qs(nn)nnq)", &arrayIter);
+- for (; listIterator < listMainSinks.end(); ++listIterator)
+- {
+- success = success && dbus_message_iter_open_container(&arrayIter, DBUS_TYPE_STRUCT, NULL, &structIter);
+- success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_UINT16, &listIterator->sinkID);
+- success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_STRING, &listIterator->name);
+- success = success && dbus_message_iter_open_container(&structIter, DBUS_TYPE_STRUCT, NULL, &availIter);
+- success = success && dbus_message_iter_append_basic(&availIter, DBUS_TYPE_INT16, &listIterator->availability.availability);
+- success = success && dbus_message_iter_append_basic(&availIter, DBUS_TYPE_INT16, &listIterator->availability.availabilityReason);
+- success = success && dbus_message_iter_close_container(&structIter, &availIter);
+- success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &listIterator->volume);
+- success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &listIterator->muteState);
+- success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_UINT16, &listIterator->sinkClassID);
+- success = success && dbus_message_iter_close_container(&arrayIter, &structIter);
+- }
+- success = success && dbus_message_iter_close_container(&mDBusMessageIter, &arrayIter);
+- if (!success)
+- {
+- log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
+- mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
+- mErrorMsg = "Cannot create reply!";
+- }
+-}
+-
+-void CAmRoutingDbusMessageHandler::append(const std::vector<am::am_SourceType_s>& listMainSources)
+-{
+- DBusMessageIter arrayIter;
+- DBusMessageIter structIter;
+- DBusMessageIter availIter;
+- std::vector<am::am_SourceType_s>::const_iterator listIterator = listMainSources.begin();
+- dbus_bool_t success = true;
+- success = success && dbus_message_iter_open_container(&mDBusMessageIter, DBUS_TYPE_ARRAY, "(qs(nn)q)", &arrayIter);
+- for (; listIterator < listMainSources.end(); ++listIterator)
+- {
+- success = success && dbus_message_iter_open_container(&arrayIter, DBUS_TYPE_STRUCT, NULL, &structIter);
+- success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_UINT16, &listIterator->sourceID);
+- success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_STRING, &listIterator->name);
+- success = success && dbus_message_iter_open_container(&structIter, DBUS_TYPE_STRUCT, NULL, &availIter);
+- success = success && dbus_message_iter_append_basic(&availIter, DBUS_TYPE_INT16, &listIterator->availability.availability);
+- success = success && dbus_message_iter_append_basic(&availIter, DBUS_TYPE_INT16, &listIterator->availability.availabilityReason);
+- success = success && dbus_message_iter_close_container(&structIter, &availIter);
+- success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_UINT16, &listIterator->sourceClassID);
+- success = success && dbus_message_iter_close_container(&arrayIter, &structIter);
+- }
+- success = success && dbus_message_iter_close_container(&mDBusMessageIter, &arrayIter);
+- if (!success)
+- {
+- log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
+- mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
+- mErrorMsg = "Cannot create reply!";
+- }
+-}
+-
+-void CAmRoutingDbusMessageHandler::append(const std::vector<am::am_MainSoundProperty_s>& listMainSoundProperties)
+-{
+- DBusMessageIter arrayIter;
+- DBusMessageIter structIter;
+- std::vector<am::am_MainSoundProperty_s>::const_iterator listIterator = listMainSoundProperties.begin();
+- dbus_bool_t success = true;
+- success = success && dbus_message_iter_open_container(&mDBusMessageIter, DBUS_TYPE_ARRAY, "(nn)", &arrayIter);
+- for (; listIterator < listMainSoundProperties.end(); ++listIterator)
+- {
+- success = success && dbus_message_iter_open_container(&arrayIter, DBUS_TYPE_STRUCT, NULL, &structIter);
+- success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &listIterator->type);
+- success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &listIterator->value);
+- success = success && dbus_message_iter_close_container(&arrayIter, &structIter);
+- }
+- success = success && dbus_message_iter_close_container(&mDBusMessageIter, &arrayIter);
+- if (!success)
+- {
+- log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
+- mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
+- mErrorMsg = "Cannot create reply!";
+- }
+-}
+-
+-void CAmRoutingDbusMessageHandler::append(const std::vector<am::am_SourceClass_s>& listSourceClasses)
+-{
+- DBusMessageIter arrayIter;
+- DBusMessageIter structIter;
+- DBusMessageIter propIter;
+- DBusMessageIter innerIter;
+- std::vector<am::am_SourceClass_s>::const_iterator listIterator = listSourceClasses.begin();
+- dbus_bool_t success = true;
+- success = success && dbus_message_iter_open_container(&mDBusMessageIter, DBUS_TYPE_ARRAY, "(qsa(nn))", &arrayIter);
+- for (; listIterator < listSourceClasses.end(); ++listIterator)
+- {
+- success = success && dbus_message_iter_open_container(&arrayIter, DBUS_TYPE_STRUCT, NULL, &structIter);
+- success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_UINT16, &listIterator->sourceClassID);
+- success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_STRING, &listIterator->name);
+- success = success && dbus_message_iter_open_container(&structIter, DBUS_TYPE_ARRAY, "(nn)", &innerIter);
+-
+- std::vector<am::am_ClassProperty_s>::const_iterator listInnerIterator = listIterator->listClassProperties.begin();
+- for (; listInnerIterator < listIterator->listClassProperties.end(); ++listInnerIterator)
+- {
+- success = success && dbus_message_iter_open_container(&innerIter, DBUS_TYPE_STRUCT, NULL, &propIter);
+- success = success && dbus_message_iter_append_basic(&propIter, DBUS_TYPE_INT16, &listInnerIterator->classProperty);
+- success = success && dbus_message_iter_append_basic(&propIter, DBUS_TYPE_INT16, &listInnerIterator->value);
+- success = success && dbus_message_iter_close_container(&innerIter, &propIter);
+- }
+- success = success && dbus_message_iter_close_container(&structIter, &innerIter);
+- success = success && dbus_message_iter_close_container(&arrayIter, &structIter);
+- }
+- success = success && dbus_message_iter_close_container(&mDBusMessageIter, &arrayIter);
+- if (!success)
+- {
+- log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
+- mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
+- mErrorMsg = "Cannot create reply!";
+- }
+-}
+-
+-void CAmRoutingDbusMessageHandler::append(const std::vector<am::am_SinkClass_s>& listSinkClasses)
+-{
+- DBusMessageIter arrayIter;
+- DBusMessageIter structIter;
+- DBusMessageIter propIter;
+- DBusMessageIter innerIter;
+- std::vector<am::am_SinkClass_s>::const_iterator listIterator = listSinkClasses.begin();
+- dbus_bool_t success = true;
+- success = success && dbus_message_iter_open_container(&mDBusMessageIter, DBUS_TYPE_ARRAY, "(qsa(nn))", &arrayIter);
+- for (; listIterator < listSinkClasses.end(); ++listIterator)
+- {
+- success = success && dbus_message_iter_open_container(&arrayIter, DBUS_TYPE_STRUCT, NULL, &structIter);
+- success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_UINT16, &listIterator->sinkClassID);
+- success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_STRING, &listIterator->name);
+- success = success && dbus_message_iter_open_container(&structIter, DBUS_TYPE_ARRAY, "(nn)", &innerIter);
+-
+- std::vector<am::am_ClassProperty_s>::const_iterator listInnerIterator = listIterator->listClassProperties.begin();
+- for (; listInnerIterator < listIterator->listClassProperties.end(); ++listInnerIterator)
+- {
+- success = success && dbus_message_iter_open_container(&innerIter, DBUS_TYPE_STRUCT, NULL, &propIter);
+- success = success && dbus_message_iter_append_basic(&propIter, DBUS_TYPE_INT16, &listInnerIterator->classProperty);
+- success = success && dbus_message_iter_append_basic(&propIter, DBUS_TYPE_INT16, &listInnerIterator->value);
+- success = success && dbus_message_iter_close_container(&innerIter, &propIter);
+- }
+- success = success && dbus_message_iter_close_container(&structIter, &innerIter);
+- success = success && dbus_message_iter_close_container(&arrayIter, &structIter);
+- }
+- success = success && dbus_message_iter_close_container(&mDBusMessageIter, &arrayIter);
+- if (!success)
+- {
+- {
+- log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
+- mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
+- mErrorMsg = "Cannot create reply!";
+- }
+- }
+-}
+-
+-std::vector<am_CustomAvailabilityReason_t> CAmRoutingDbusMessageHandler::getListconnectionFormats()
+-{
+- DBusMessageIter arrayIter;
+- std::vector<am_CustomAvailabilityReason_t> listConnectionFormats;
+- if (DBUS_TYPE_ARRAY != dbus_message_iter_get_arg_type(&mDBusMessageIter))
+- {
+- log(&routingDbus, DLT_LOG_ERROR, "CAmRoutingDbusMessageHandler::getListconnectionFormats DBUS handler argument is no array!");
+- mErrorName = std::string(DBUS_ERROR_INVALID_ARGS);
+- mErrorMsg = "DBus argument is no array";
+- }
+- else
+- {
+- dbus_message_iter_recurse(&mDBusMessageIter, &arrayIter);
+- do
+- {
+- am_CustomAvailabilityReason_t connectionformat(static_cast<am_CustomAvailabilityReason_t>(getUInt(arrayIter, false)));
+- listConnectionFormats.push_back(connectionformat);
+- } while (dbus_message_iter_next(&arrayIter));
+- dbus_message_iter_next(&mDBusMessageIter);
+- }
+- return (listConnectionFormats);
+-
+-}
+-
+-std::vector<bool> CAmRoutingDbusMessageHandler::getListBool()
+-{
+- DBusMessageIter arrayIter;
+- std::vector<bool> listBools;
+- if (DBUS_TYPE_ARRAY != dbus_message_iter_get_arg_type(&mDBusMessageIter))
+- {
+- log(&routingDbus, DLT_LOG_ERROR, "CAmRoutingDbusMessageHandler::getListBool DBUS handler argument is no array!");
+- mErrorName = std::string(DBUS_ERROR_INVALID_ARGS);
+- mErrorMsg = "DBus argument is no array";
+- }
+- else
+- {
+- dbus_message_iter_recurse(&mDBusMessageIter, &arrayIter);
+- do
+- {
+- bool myBool(static_cast<bool>(getBool(arrayIter, false)));
+- listBools.push_back(myBool);
+- } while (dbus_message_iter_next(&arrayIter));
+- dbus_message_iter_next(&mDBusMessageIter);
+- }
+- return (listBools);
+-}
+-
+-am_SoundProperty_s CAmRoutingDbusMessageHandler::getSoundProperty()
+-{
+- am_SoundProperty_s soundProperty;
+- DBusMessageIter structIter;
+-
+- dbus_message_iter_recurse(&mDBusMessageIter, &structIter);
+- soundProperty.type = static_cast<am_CustomSoundPropertyType_t>(getInt(structIter, true));
+- soundProperty.value = static_cast<int16_t>(getInt(structIter, false));
+- dbus_message_iter_next(&mDBusMessageIter);
+-
+- return(soundProperty);
+-}
+-
+-std::vector<am_SoundProperty_s> CAmRoutingDbusMessageHandler::getListSoundProperties()
+-{
+- DBusMessageIter arrayIter;
+- DBusMessageIter structIter;
+- am_SoundProperty_s soundProperty;
+- std::vector<am_SoundProperty_s> listSoundProperties;
+- if (DBUS_TYPE_ARRAY != dbus_message_iter_get_arg_type(&mDBusMessageIter))
+- {
+- log(&routingDbus, DLT_LOG_ERROR, "CAmRoutingDbusMessageHandler::getListSoundProperties DBUS handler argument is no array!");
+- mErrorName = std::string(DBUS_ERROR_INVALID_ARGS);
+- mErrorMsg = "DBus argument is no array";
+- }
+- else
+- {
+- dbus_message_iter_recurse(&mDBusMessageIter, &arrayIter);
+- do
+- {
+- dbus_message_iter_recurse(&arrayIter, &structIter);
+- soundProperty.type = static_cast<am_CustomSoundPropertyType_t>(getInt(structIter, true));
+- soundProperty.value = static_cast<int16_t>(getInt(structIter, false));
+- listSoundProperties.push_back(soundProperty);
+- } while (dbus_message_iter_next(&arrayIter));
+- dbus_message_iter_next(&structIter);
+- }
+- return (listSoundProperties);
+-}
+-
+-std::vector<am_MainSoundProperty_s> CAmRoutingDbusMessageHandler::getListMainSoundProperties()
+-{
+- DBusMessageIter arrayIter;
+- DBusMessageIter structIter;
+- am_MainSoundProperty_s soundProperty;
+- std::vector<am_MainSoundProperty_s> listSoundProperties;
+- if (DBUS_TYPE_ARRAY != dbus_message_iter_get_arg_type(&mDBusMessageIter))
+- {
+- log(&routingDbus, DLT_LOG_ERROR, "CAmRoutingDbusMessageHandler::getListSoundProperties DBUS handler argument is no array!");
+- mErrorName = std::string(DBUS_ERROR_INVALID_ARGS);
+- mErrorMsg = "DBus argument is no array";
+- }
+- else
+- {
+- dbus_message_iter_recurse(&mDBusMessageIter, &arrayIter);
+- do
+- {
+- dbus_message_iter_recurse(&arrayIter, &structIter);
+- soundProperty.type = static_cast<am_CustomMainSoundPropertyType_t>(getInt(structIter, true));
+- soundProperty.value = static_cast<int16_t>(getInt(structIter, false));
+- listSoundProperties.push_back(soundProperty);
+- } while (dbus_message_iter_next(&arrayIter));
+- dbus_message_iter_next(&structIter);
+- }
+- return (listSoundProperties);
+-}
+-
+-am_NotificationPayload_s CAmRoutingDbusMessageHandler::getNotificationPayload()
+-{
+- am_NotificationPayload_s notificationPayload;
+- DBusMessageIter structIter;
+-
+- dbus_message_iter_recurse(&mDBusMessageIter, &structIter);
+- notificationPayload.type = static_cast<am_CustomNotificationType_t>(getInt(structIter, true));
+- notificationPayload.value = static_cast<int16_t>(getInt(structIter, false));
+- dbus_message_iter_next(&mDBusMessageIter);
+-
+- return (notificationPayload);
+-}
+-
+-dbus_int32_t CAmRoutingDbusMessageHandler::getInt32()
+-{
+- return (getInt32(mDBusMessageIter, true));
+-}
+-
+-dbus_int32_t CAmRoutingDbusMessageHandler::getInt32(DBusMessageIter& iter, bool next)
+-{
+- dbus_int32_t param(0);
+- #ifdef GLIB_DBUS_TYPES_TOLERANT
+- if (DBUS_TYPE_INT32 != dbus_message_iter_get_arg_type(&iter) && DBUS_TYPE_INT32 != dbus_message_iter_get_arg_type(&iter))
+- #else
+- if (DBUS_TYPE_INT32 != dbus_message_iter_get_arg_type(&iter))
+- #endif
+- {
+- log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::getInt DBUS handler argument is no int32_t!");
+- mErrorName = std::string(DBUS_ERROR_INVALID_ARGS);
+- mErrorMsg = "DBus argument is no int32_t";
+- }
+- else
+- {
+- dbus_message_iter_get_basic(&iter, &param);
+- if (next)
+- dbus_message_iter_next(&iter);
+- }
+- return (param);
+-}
+-
+-void CAmRoutingDbusMessageHandler::append(const std::vector<am::am_SystemProperty_s>& listSystemProperties)
+-{
+- DBusMessageIter arrayIter;
+- DBusMessageIter structIter;
+- std::vector<am::am_SystemProperty_s>::const_iterator listIterator = listSystemProperties.begin();
+- dbus_bool_t success = true;
+- success = success && dbus_message_iter_open_container(&mDBusMessageIter, DBUS_TYPE_ARRAY, "(nn)", &arrayIter);
+- for (; listIterator < listSystemProperties.end(); ++listIterator)
+- {
+- success = success && dbus_message_iter_open_container(&arrayIter, DBUS_TYPE_STRUCT, NULL, &structIter);
+- success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &listIterator->type);
+- success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &listIterator->value);
+- success = success && dbus_message_iter_close_container(&arrayIter, &structIter);
+- }
+- success = success && dbus_message_iter_close_container(&mDBusMessageIter, &arrayIter);
+- if (!success)
+- {
+- log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
+- mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
+- mErrorMsg = "Cannot create reply!";
+- }
+-}
+-
+-void CAmRoutingDbusMessageHandler::append(const am::am_Error_e error)
+-{
+- if (!dbus_message_iter_append_basic(&mDBusMessageIter, DBUS_TYPE_UINT16, &error))
+- {
+- log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
+- mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
+- mErrorMsg = "Cannot create reply!";
+- }
+-}
+-
+-}
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+diff --git a/PluginRoutingInterfaceDBus/src/CAmDbusSend.cpp b/PluginRoutingInterfaceDBus/src/CAmDbusSend.cpp
+deleted file mode 100644
+index 43ea274..0000000
+--- a/PluginRoutingInterfaceDBus/src/CAmDbusSend.cpp
++++ /dev/null
+@@ -1,154 +0,0 @@
+-/**
+- * Copyright (c) copyright 2011-2012 Aricent® Group and its licensors
+- * Copyright (c) 2012 BMW
+- *
+- * \author Sampreeth Ramavana
+- * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
+- *
+- * \copyright
+- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction,
+- * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
+- * subject to the following conditions:
+- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
+- * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+- *
+- * For further information see http://www.genivi.org/.
+- */
+-
+-#include "CAmDbusSend.h"
+-#include "CAmDltWrapper.h"
+-
+-namespace am
+-{
+-
+-DLT_IMPORT_CONTEXT(routingDbus)
+-
+-CAmRoutingDbusSend::CAmRoutingDbusSend(DBusConnection* conn, std::string bus_name, std::string path, std::string interface, std::string method) :
+- mpDbusMessage(NULL), //
+- mpDbusConnection(conn), //
+- mDbusMessageIter(), //
+- mDBusError(), //
+- mSerial(1)
+-{
+- dbus_error_init(&mDBusError);
+- mpDbusMessage = dbus_message_new_method_call(bus_name.c_str(), path.c_str(), interface.c_str(), method.c_str());
+- if (NULL == mpDbusMessage)
+- {
+- log(&routingDbus, DLT_LOG_ERROR, "CAmRoutingDbusSend::CAmRoutingDbusSend dbus error:", mDBusError.message);
+- this->~CAmRoutingDbusSend();
+- }
+-}
+-
+-CAmRoutingDbusSend::~CAmRoutingDbusSend()
+-{
+-}
+-
+-void CAmRoutingDbusSend::append(std::string string)
+-{
+- dbus_message_iter_init_append(mpDbusMessage, &mDbusMessageIter);
+- if (!dbus_message_iter_append_basic(&mDbusMessageIter, DBUS_TYPE_STRING, string.c_str()))
+- {
+- log(&routingDbus, DLT_LOG_ERROR, "CAmRoutingDbusSend::append no more memory");
+- this->~CAmRoutingDbusSend();
+- }
+-}
+-
+-void CAmRoutingDbusSend::append(uint16_t integer)
+-{
+- dbus_message_iter_init_append(mpDbusMessage, &mDbusMessageIter);
+- if (!dbus_message_iter_append_basic(&mDbusMessageIter, DBUS_TYPE_UINT16, &integer))
+- {
+- log(&routingDbus, DLT_LOG_ERROR, "CAmRoutingDbusSend::append no more memory");
+- this->~CAmRoutingDbusSend();
+- }
+-}
+-
+-void CAmRoutingDbusSend::append(int16_t integer)
+-{
+- dbus_message_iter_init_append(mpDbusMessage, &mDbusMessageIter);
+- if (!dbus_message_iter_append_basic(&mDbusMessageIter, DBUS_TYPE_INT16, &integer))
+- {
+- log(&routingDbus, DLT_LOG_ERROR, "CAmRoutingDbusSend::append no more memory");
+- this->~CAmRoutingDbusSend();
+- }
+-}
+-
+-void CAmRoutingDbusSend::append(std::vector<am_SoundProperty_s> listSoundProperties)
+-{
+- DBusMessageIter arrayIter;
+- DBusMessageIter structIter;
+- std::vector<am_SoundProperty_s>::const_iterator listIterator = listSoundProperties.begin();
+- dbus_bool_t success = true;
+-
+- success = success && dbus_message_iter_open_container(&mDbusMessageIter, DBUS_TYPE_ARRAY, "(nn)", &arrayIter);
+- for (; listIterator < listSoundProperties.end(); ++listIterator)
+- {
+- success = success && dbus_message_iter_open_container(&arrayIter, DBUS_TYPE_STRUCT, NULL, &structIter);
+- success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &listIterator->type);
+- success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &listIterator->value);
+- success = success && dbus_message_iter_close_container(&arrayIter, &structIter);
+- }
+- success = success && dbus_message_iter_close_container(&mDbusMessageIter, &arrayIter);
+-
+- if (!success)
+- {
+- log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::append error", mDBusError.message);
+- }
+-}
+-
+-void CAmRoutingDbusSend::append(am_SoundProperty_s soundProperty)
+-{
+- DBusMessageIter structIter;
+- dbus_bool_t success = true;
+-
+- success = success && dbus_message_iter_open_container(&mDbusMessageIter, DBUS_TYPE_STRUCT, NULL, &structIter);
+- success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &soundProperty.type);
+- success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &soundProperty.value);
+- success = success && dbus_message_iter_close_container(&mDbusMessageIter, &structIter);
+-
+- if (!success)
+- {
+- log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::append error", mDBusError.message);
+- }
+-}
+-
+-void CAmRoutingDbusSend::append(int integer)
+-{
+- dbus_message_iter_init_append(mpDbusMessage, &mDbusMessageIter);
+- if (!dbus_message_iter_append_basic(&mDbusMessageIter, DBUS_TYPE_INT32, &integer))
+- {
+- log(&routingDbus, DLT_LOG_ERROR, "CAmRoutingDbusSend::append no more memory");
+- this->~CAmRoutingDbusSend();
+- }
+-}
+-
+-am_Error_e CAmRoutingDbusSend::send()
+-{
+-
+- int32_t error;
+- DBusMessage* reply(dbus_connection_send_with_reply_and_block(mpDbusConnection, mpDbusMessage, -1, &mDBusError));
+- if (!reply)
+- {
+- log(&routingDbus, DLT_LOG_ERROR, "CAmRoutingDbusSend::send failed, dbus error", mDBusError.message);
+- return (E_UNKNOWN);
+- }
+- if(!dbus_message_get_args(reply, &mDBusError, //
+- DBUS_TYPE_INT32, &error, //
+- DBUS_TYPE_INVALID))
+- return (E_UNKNOWN);
+- dbus_message_unref(reply);
+- return (static_cast<am_Error_e>(error));
+-}
+-
+-am_Error_e CAmRoutingDbusSend::sendAsync()
+-{
+-
+- dbus_connection_send(mpDbusConnection, mpDbusMessage, &mSerial);
+- mSerial++;
+- return (E_OK);
+-
+-}
+-
+-}
+diff --git a/PluginRoutingInterfaceDBus/src/CAmRoutingSenderDbus.cpp b/PluginRoutingInterfaceDBus/src/CAmRoutingSenderDbus.cpp
+deleted file mode 100644
+index 8a78b7f..0000000
+--- a/PluginRoutingInterfaceDBus/src/CAmRoutingSenderDbus.cpp
++++ /dev/null
+@@ -1,408 +0,0 @@
+-/**
+- * Copyright (c) 2012 BMW
+- * Copyright (c) copyright 2011-2012 Aricent® Group and its licensors
+- *
+- * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
+- * \author Sampreeth Ramavana
+- * \author Aleksandar Donchev, aleksander.donchev@partner.bmw.de BMW 2013
+- *
+- * \copyright
+- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction,
+- * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
+- * subject to the following conditions:
+- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
+- * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+- *
+- * For further information see http://www.genivi.org/.
+- */
+-
+-#include "CAmRoutingSenderDbus.h"
+-#include <cassert>
+-#include <map>
+-#include "CAmDbusSend.h"
+-#include "CAmDltWrapper.h"
+-#include "CAmDbusWrapper.h"
+-
+-namespace am
+-{
+-DLT_DECLARE_CONTEXT(routingDbus)
+-
+-extern "C" IAmRoutingSend* PluginRoutingInterfaceDbusFactory()
+-{
+- CAmDltWrapper::instance()->registerContext(routingDbus, "DRS", "DBus Plugin");
+- return (new CAmRoutingSenderDbus());
+-}
+-
+-extern "C" void destroyRoutingPluginInterfaceDbus(IAmRoutingSend* routingSendInterface)
+-{
+- delete routingSendInterface;
+-}
+-
+-CAmRoutingSenderDbus::CAmRoutingSenderDbus() :
+- mpCAmDBusWrapper(), //
+- mpIAmRoutingReceive(), //
+- mpDBusConnection(), //
+- mCAmRoutingDBusMessageHandler(), //
+- mIAmRoutingReceiverShadowDbus(this)
+-{
+- log(&routingDbus, DLT_LOG_INFO, "RoutingSender constructed");
+-}
+-
+-CAmRoutingSenderDbus::~CAmRoutingSenderDbus()
+-{
+- log(&routingDbus, DLT_LOG_INFO, "RoutingSender destructed");
+- CAmDltWrapper::instance()->unregisterContext(routingDbus);
+-}
+-
+-am_Error_e CAmRoutingSenderDbus::startupInterface(IAmRoutingReceive* pIAmRoutingReceive)
+-{
+- log(&routingDbus, DLT_LOG_INFO, "startupInterface called");
+- mpIAmRoutingReceive = pIAmRoutingReceive;
+- mIAmRoutingReceiverShadowDbus.setRoutingReceiver(mpIAmRoutingReceive);
+- mpIAmRoutingReceive->getDBusConnectionWrapper(mpCAmDBusWrapper);
+- assert(mpCAmDBusWrapper!=NULL);
+- mpCAmDBusWrapper->getDBusConnection(mpDBusConnection);
+- assert(mpDBusConnection!=NULL);
+- mCAmRoutingDBusMessageHandler.setDBusConnection(mpDBusConnection);
+- return (E_OK);
+-}
+-
+-void CAmRoutingSenderDbus::getInterfaceVersion(std::string & version) const
+-{
+- version = RoutingSendVersion;
+-}
+-
+-void CAmRoutingSenderDbus::setRoutingReady(const uint16_t handle)
+-{
+- log(&routingDbus, DLT_LOG_INFO, "sending routingReady signal");
+- mCAmRoutingDBusMessageHandler.initSignal(std::string(ROUTING_NODE), "setRoutingReady");
+- mCAmRoutingDBusMessageHandler.sendMessage();
+- mIAmRoutingReceiverShadowDbus.gotReady(mMapDomains.size(),handle);
+-}
+-
+-void CAmRoutingSenderDbus::setRoutingRundown(const uint16_t handle)
+-{
+- mCAmRoutingDBusMessageHandler.initSignal(std::string(ROUTING_NODE), "setRoutingRundown");
+- mCAmRoutingDBusMessageHandler.sendMessage();
+- mIAmRoutingReceiverShadowDbus.gotRundown(mMapDomains.size(),handle);
+-}
+-
+-am_Error_e CAmRoutingSenderDbus::asyncAbort(const am_Handle_s handle)
+-{
+- log(&routingDbus, DLT_LOG_INFO, "CAmRoutingSenderDbus::asyncAbort called");
+- mapHandles_t::iterator iter = mMapHandles.begin();
+- iter = mMapHandles.find(handle.handle);
+- if (iter != mMapHandles.end())
+- {
+- CAmRoutingDbusSend send(mpDBusConnection, iter->second.busname, iter->second.path, iter->second.interface, "asyncAbort");
+- send.append(handle.handle);
+- return (send.send());
+- }
+- log(&routingDbus, DLT_LOG_ERROR, "CAmRoutingSenderDbus::asyncAbort could not find interface");
+- return (E_UNKNOWN);
+-
+-}
+-
+-am_Error_e CAmRoutingSenderDbus::asyncConnect(const am_Handle_s handle, const am_connectionID_t connectionID, const am_sourceID_t sourceID, const am_sinkID_t sinkID, const am_CustomAvailabilityReason_t connectionFormat)
+-{
+- log(&routingDbus, DLT_LOG_INFO, "CAmRoutingSenderDbus::asyncConnect called");
+- mapSources_t::iterator iter = mMapSources.begin();
+- iter = mMapSources.find(sourceID);
+- if (iter != mMapSources.end())
+- {
+- CAmRoutingDbusSend send(mpDBusConnection, iter->second.busname, iter->second.path, iter->second.interface, "asyncConnect");
+- send.append(handle.handle);
+- send.append(connectionID);
+- send.append(sourceID);
+- send.append(sinkID);
+- send.append(static_cast<int32_t>(connectionFormat));
+- mMapConnections.insert(std::make_pair(connectionID, (iter->second)));
+- mMapHandles.insert(std::make_pair(+handle.handle, iter->second));
+- return (send.sendAsync());
+- }
+- log(&routingDbus, DLT_LOG_ERROR, "CAmRoutingSenderDbus::asyncConnect could not find interface");
+- return (E_UNKNOWN);
+-}
+-
+-am_Error_e CAmRoutingSenderDbus::asyncDisconnect(const am_Handle_s handle, const am_connectionID_t connectionID)
+-{
+- log(&routingDbus, DLT_LOG_INFO, "CAmRoutingSenderDbus::asyncDisconnect called");
+- mapConnections_t::iterator iter = mMapConnections.begin();
+- iter = mMapConnections.find(connectionID);
+- if (iter != mMapConnections.end())
+- {
+- CAmRoutingDbusSend send(mpDBusConnection, iter->second.busname, iter->second.path, iter->second.interface, "asyncDisconnect");
+- send.append(handle.handle);
+- send.append(connectionID);
+- mMapHandles.insert(std::make_pair(+handle.handle, iter->second));
+- return (send.sendAsync());
+- }
+- log(&routingDbus, DLT_LOG_ERROR, "CAmRoutingSenderDbus::asyncDisconnect could not find interface");
+- return (E_UNKNOWN);
+-}
+-
+-am_Error_e CAmRoutingSenderDbus::asyncSetSinkVolume(const am_Handle_s handle, const am_sinkID_t sinkID, const am_volume_t volume, const am_CustomRampType_t ramp, const am_time_t time)
+-{
+- log(&routingDbus, DLT_LOG_INFO, "CAmRoutingSenderDbus::asyncSetSinkVolume called");
+- mapSinks_t::iterator iter = mMapSinks.begin();
+- iter = mMapSinks.find(sinkID);
+- if (iter != mMapSinks.end())
+- {
+- CAmRoutingDbusSend send(mpDBusConnection, iter->second.busname, iter->second.path, iter->second.interface, "asyncSetSinkVolume");
+- send.append(handle.handle);
+- send.append(sinkID);
+- send.append(volume);
+- send.append(static_cast<int16_t>(ramp));
+- send.append(time);
+- mMapHandles.insert(std::make_pair(+handle.handle, iter->second));
+- return (send.sendAsync());
+- }
+- log(&routingDbus, DLT_LOG_ERROR, "CAmRoutingSenderDbus::asyncSetSinkVolume could not find interface");
+- return (E_UNKNOWN);
+-}
+-
+-am_Error_e CAmRoutingSenderDbus::asyncSetSourceVolume(const am_Handle_s handle, const am_sourceID_t sourceID, const am_volume_t volume, const am_CustomRampType_t ramp, const am_time_t time)
+-{
+- log(&routingDbus, DLT_LOG_INFO, "CAmRoutingSenderDbus::asyncSetSourceVolume called");
+- mapSources_t::iterator iter = mMapSources.begin();
+- iter = mMapSources.find(sourceID);
+- if (iter != mMapSources.end())
+- {
+- CAmRoutingDbusSend send(mpDBusConnection, iter->second.busname, iter->second.path, iter->second.interface, "asyncSetSourceVolume");
+- send.append(handle.handle);
+- send.append(sourceID);
+- send.append(volume);
+- send.append(static_cast<int16_t>(ramp));
+- send.append(time);
+- mMapHandles.insert(std::make_pair(+handle.handle, iter->second));
+- return (send.sendAsync());
+- }
+- log(&routingDbus, DLT_LOG_ERROR, "CAmRoutingSenderDbus::asyncSetSourceVolume could not find interface");
+- return (E_UNKNOWN);
+-}
+-
+-am_Error_e CAmRoutingSenderDbus::asyncSetSourceState(const am_Handle_s handle, const am_sourceID_t sourceID, const am_SourceState_e state)
+-{
+- log(&routingDbus, DLT_LOG_INFO, "CAmRoutingSenderDbus::asyncSetSourceState called");
+- mapSources_t::iterator iter = mMapSources.begin();
+- iter = mMapSources.find(sourceID);
+- if (iter != mMapSources.end())
+- {
+- CAmRoutingDbusSend send(mpDBusConnection, iter->second.busname, iter->second.path, iter->second.interface, "asyncSetSourceState");
+- send.append(handle.handle);
+- send.append(sourceID);
+- send.append(static_cast<int32_t>(state));
+- mMapHandles.insert(std::make_pair(+handle.handle, iter->second));
+- return (send.sendAsync());
+- }
+- log(&routingDbus, DLT_LOG_ERROR, "CAmRoutingSenderDbus::asyncSetSourceState could not find interface");
+- return (E_UNKNOWN);
+-}
+-
+-am_Error_e CAmRoutingSenderDbus::asyncSetSinkSoundProperties(const am_Handle_s handle, const am_sinkID_t sinkID, const std::vector<am_SoundProperty_s>& listSoundProperties)
+-{
+- log(&routingDbus, DLT_LOG_INFO, "CAmRoutingSenderDbus::asyncSetSinkSoundProperties called");
+- mapSinks_t::iterator iter = mMapSinks.begin();
+- iter = mMapSinks.find(sinkID);
+- if (iter != mMapSinks.end())
+- {
+- CAmRoutingDbusSend send(mpDBusConnection, iter->second.busname, iter->second.path, iter->second.interface, "asyncSetSinkSoundProperties");
+- send.append(handle.handle);
+- send.append(sinkID);
+- send.append(listSoundProperties);
+- mMapHandles.insert(std::make_pair(+handle.handle, iter->second));
+- return (send.sendAsync());
+- }
+- log(&routingDbus, DLT_LOG_ERROR, "CAmRoutingSenderDbus::asyncSetSinkSoundProperties could not find interface");
+- return (E_UNKNOWN);
+-}
+-
+-am_Error_e CAmRoutingSenderDbus::asyncSetSinkSoundProperty(const am_Handle_s handle, const am_sinkID_t sinkID, const am_SoundProperty_s& soundProperty)
+-{
+- log(&routingDbus, DLT_LOG_INFO, "CAmRoutingSenderDbus::asyncSetSinkSoundProperty called");
+- mapSinks_t::iterator iter = mMapSinks.begin();
+- iter = mMapSinks.find(sinkID);
+- if (iter != mMapSinks.end())
+- {
+- CAmRoutingDbusSend send(mpDBusConnection, iter->second.busname, iter->second.path, iter->second.interface, "asyncSetSinkSoundProperty");
+- send.append(handle.handle);
+- send.append(sinkID);
+- send.append(soundProperty);
+- mMapHandles.insert(std::make_pair(+handle.handle, iter->second));
+- return (send.sendAsync());
+- }
+- log(&routingDbus, DLT_LOG_ERROR, "CAmRoutingSenderDbus::asyncSetSinkSoundProperty could not find interface");
+- return (E_UNKNOWN);
+-}
+-
+-am_Error_e CAmRoutingSenderDbus::asyncSetSourceSoundProperties(const am_Handle_s handle, const am_sourceID_t sourceID, const std::vector<am_SoundProperty_s>& listSoundProperties)
+-{
+- log(&routingDbus, DLT_LOG_INFO, "CAmRoutingSenderDbus::asyncSetSourceSoundProperties called");
+- mapSources_t::iterator iter = mMapSources.begin();
+- iter = mMapSources.find(sourceID);
+- if (iter != mMapSources.end())
+- {
+- CAmRoutingDbusSend send(mpDBusConnection, iter->second.busname, iter->second.path, iter->second.interface, "asyncSetSourceSoundProperties");
+- send.append(handle.handle);
+- send.append(sourceID);
+- send.append(listSoundProperties);
+- mMapHandles.insert(std::make_pair(+handle.handle, iter->second));
+- return (send.sendAsync());
+- }
+- log(&routingDbus, DLT_LOG_ERROR, "CAmRoutingSenderDbus::asyncSetSourceSoundProperties could not find interface");
+- return (E_UNKNOWN);
+-}
+-
+-am_Error_e CAmRoutingSenderDbus::asyncSetSourceSoundProperty(const am_Handle_s handle, const am_sourceID_t sourceID, const am_SoundProperty_s& soundProperty)
+-{
+- log(&routingDbus, DLT_LOG_INFO, "CAmRoutingSenderDbus::asyncSetSourceSoundProperty called");
+- mapSources_t::iterator iter = mMapSources.begin();
+- iter = mMapSources.find(sourceID);
+- if (iter != mMapSources.end())
+- {
+- CAmRoutingDbusSend send(mpDBusConnection, iter->second.busname, iter->second.path, iter->second.interface, "asyncSetSourceSoundProperty");
+- send.append(handle.handle);
+- send.append(sourceID);
+- send.append(soundProperty);
+- mMapHandles.insert(std::make_pair(+handle.handle, iter->second));
+- return (send.sendAsync());
+- }
+- log(&routingDbus, DLT_LOG_ERROR, "CAmRoutingSenderDbus::asyncSetSourceSoundProperty could not find interface");
+- return (E_UNKNOWN);
+-}
+-
+-am_Error_e CAmRoutingSenderDbus::asyncCrossFade(const am_Handle_s handle, const am_crossfaderID_t crossfaderID, const am_HotSink_e hotSink, const am_CustomRampType_t rampType, const am_time_t time)
+-{
+- (void)handle;
+- (void)crossfaderID;
+- (void)hotSink;
+- (void)rampType;
+- (void)time;
+- //todo implement
+- return (E_NON_EXISTENT);
+-}
+-
+-am_Error_e CAmRoutingSenderDbus::setDomainState(const am_domainID_t domainID, const am_DomainState_e domainState)
+-{
+- log(&routingDbus, DLT_LOG_INFO, "CAmRoutingSenderDbus::setDomainState called");
+- mapDomain_t::iterator iter = mMapDomains.begin();
+- iter = mMapDomains.find(domainID);
+- if (iter != mMapDomains.end())
+- {
+- CAmRoutingDbusSend send(mpDBusConnection, iter->second.busname, iter->second.path, iter->second.interface, "setDomainState");
+- send.append(domainID);
+- send.append(static_cast<uint16_t>(domainState));
+- return (send.send());
+- }
+- log(&routingDbus, DLT_LOG_ERROR, "CAmRoutingSenderDbus::setDomainState could not find interface");
+- return (E_UNKNOWN);
+-}
+-
+-am_Error_e CAmRoutingSenderDbus::returnBusName(std::string& BusName) const
+-{
+- BusName = "DbusRoutingPlugin";
+- return (E_OK);
+-}
+-
+-void CAmRoutingSenderDbus::removeHandle(uint16_t handle)
+-{
+- mMapHandles.erase(handle);
+-}
+-
+-void CAmRoutingSenderDbus::addDomainLookup(am_domainID_t domainID, rs_lookupData_s lookupData)
+-{
+- mMapDomains.insert(std::make_pair(domainID, lookupData));
+-}
+-
+-void CAmRoutingSenderDbus::addSourceLookup(am_sourceID_t sourceID, am_domainID_t domainID)
+-{
+- mapDomain_t::iterator iter(mMapDomains.begin());
+- iter = mMapDomains.find(domainID);
+- if (iter != mMapDomains.end())
+- {
+- mMapSources.insert(std::make_pair(sourceID, iter->second));
+- }
+-}
+-
+-void CAmRoutingSenderDbus::addSinkLookup(am_sinkID_t sinkID, am_domainID_t domainID)
+-{
+- mapDomain_t::iterator iter(mMapDomains.begin());
+- iter = mMapDomains.find(domainID);
+- if (iter != mMapDomains.end())
+- {
+- mMapSinks.insert(std::make_pair(sinkID, iter->second));
+- }
+-}
+-
+-template <typename TKey> void CAmRoutingSenderDbus::removeEntriesForValue(const rs_lookupData_s & value, std::map<TKey,rs_lookupData_s> & map)
+-{
+- typename std::map<TKey,rs_lookupData_s>::iterator it = map.begin();
+- while ( it != map.end() )
+- {
+- if (it->second.busname == value.busname &&
+- it->second.interface == value.interface &&
+- it->second.path == value.path)
+- {
+- typename std::map<TKey,rs_lookupData_s>::iterator it_tmp = it;
+- it++;
+- map.erase(it_tmp);
+- }
+- else
+- ++it;
+- }
+-}
+-
+-void CAmRoutingSenderDbus::removeDomainLookup(am_domainID_t domainID)
+-{
+- mapDomain_t::iterator iter(mMapDomains.begin());
+- iter = mMapDomains.find(domainID);
+- if (iter != mMapDomains.end())
+- {
+- CAmRoutingSenderDbus::removeEntriesForValue(iter->second, mMapSources);
+- CAmRoutingSenderDbus::removeEntriesForValue(iter->second, mMapSinks);
+- CAmRoutingSenderDbus::removeEntriesForValue(iter->second, mMapHandles);
+- CAmRoutingSenderDbus::removeEntriesForValue(iter->second, mMapConnections);
+- mMapDomains.erase(domainID);
+- }
+-}
+-
+-void CAmRoutingSenderDbus::removeSourceLookup(am_sourceID_t sourceID)
+-{
+- mMapSources.erase(sourceID);
+-}
+-
+-void CAmRoutingSenderDbus::removeSinkLookup(am_sinkID_t sinkID)
+-{
+- mMapSinks.erase(sinkID);
+-}
+-
+-am_Error_e CAmRoutingSenderDbus::asyncSetVolumes(const am_Handle_s handle, const std::vector<am_Volumes_s>& listVolumes)
+-{
+- (void) handle;
+- (void) listVolumes;
+- //todo: implement asyncSetVolumes;
+- return (E_NOT_USED);
+-}
+-
+-am_Error_e CAmRoutingSenderDbus::asyncSetSinkNotificationConfiguration(const am_Handle_s handle, const am_sinkID_t sinkID, const am_NotificationConfiguration_s& notificationConfiguration)
+-{
+- (void) handle;
+- (void) sinkID;
+- (void) notificationConfiguration;
+- //todo: implement asyncSetSinkNotificationConfiguration;
+- return (E_NOT_USED);
+-}
+-
+-am_Error_e CAmRoutingSenderDbus::asyncSetSourceNotificationConfiguration(const am_Handle_s handle, const am_sourceID_t sourceID, const am_NotificationConfiguration_s& notificationConfiguration)
+-{
+- (void) handle;
+- (void) sourceID;
+- (void) notificationConfiguration;
+- //todo: implement asyncSetSourceNotificationConfiguration;
+- return (E_NOT_USED);
+-}
+-
+-}
+-
+diff --git a/PluginRoutingInterfaceDBus/src/IAmRoutingReceiverShadow.cpp b/PluginRoutingInterfaceDBus/src/IAmRoutingReceiverShadow.cpp
+deleted file mode 100644
+index 8ac73d1..0000000
+--- a/PluginRoutingInterfaceDBus/src/IAmRoutingReceiverShadow.cpp
++++ /dev/null
+@@ -1,975 +0,0 @@
+-/**
+- * Copyright (c) copyright 2011-2012 Aricent® Group and its licensors
+- * Copyright (c) 2012 BMW
+- *
+- * \author Sampreeth Ramavana
+- * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
+- *
+- * \copyright
+- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction,
+- * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
+- * subject to the following conditions:
+- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
+- * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+- *
+- * For further information see http://www.genivi.org/.
+- */
+-
+-#include "IAmRoutingReceiverShadow.h"
+-#include <string.h>
+-#include <fstream>
+-#include <stdexcept>
+-#include <cassert>
+-#include "CAmRoutingSenderDbus.h"
+-#include "CAmDbusWrapper.h"
+-#include "CAmDltWrapper.h"
+-#include "configRoutingDbus.h"
+-
+-namespace am
+-{
+-
+-DLT_IMPORT_CONTEXT(routingDbus)
+-
+-
+-/**
+- * static ObjectPathTable is needed for DBus Callback handling
+- */
+-static DBusObjectPathVTable gObjectPathVTable;
+-
+-IAmRoutingReceiverShadowDbus::IAmRoutingReceiverShadowDbus(CAmRoutingSenderDbus* pRoutingSenderDbus) :
+- mRoutingReceiveInterface(NULL), //
+- mDBusWrapper(NULL), //
+- mpRoutingSenderDbus(pRoutingSenderDbus), //
+- mFunctionMap(createMap()), //
+- mDBUSMessageHandler(), //
+- mNumberDomains(0), //
+- mHandle(0), //
+- mRoutingReady(false)
+-{
+- log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow constructed");
+-}
+-
+-IAmRoutingReceiverShadowDbus::~IAmRoutingReceiverShadowDbus()
+-{
+- log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow destructed");
+-}
+-
+-void IAmRoutingReceiverShadowDbus::registerDomain(DBusConnection *conn, DBusMessage *msg)
+-{
+- log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::registerDomain called");
+-
+- (void) ((conn));
+- assert(mRoutingReceiveInterface != NULL);
+- mDBUSMessageHandler.initReceive(msg);
+- am_Domain_s domain(mDBUSMessageHandler.getDomainData());
+- CAmRoutingSenderDbus::rs_lookupData_s lookupData;
+- lookupData.busname = mDBUSMessageHandler.getString();
+- lookupData.path = mDBUSMessageHandler.getString();
+- lookupData.interface = mDBUSMessageHandler.getString();
+- log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::registerDomain called, name ", domain.name, "nodename ", domain.nodename);
+- domain.busname = "DbusRoutingPlugin";
+- am_Error_e returnCode = mRoutingReceiveInterface->registerDomain(domain, domain.domainID);
+- mDBUSMessageHandler.initReply(msg);
+- mDBUSMessageHandler.append(domain.domainID);
+- mDBUSMessageHandler.append(returnCode);
+- mDBUSMessageHandler.sendMessage();
+- if (returnCode != E_OK)
+- {
+- log(&routingDbus, DLT_LOG_INFO, "error registering domain");
+- return;
+- }
+- mpRoutingSenderDbus->addDomainLookup(domain.domainID, lookupData);
+-}
+-
+-void IAmRoutingReceiverShadowDbus::registerSource(DBusConnection* conn, DBusMessage* msg)
+-{
+- log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::RegisterSource called");
+- (void) ((conn));
+- assert(mRoutingReceiveInterface != NULL);
+- mDBUSMessageHandler.initReceive(msg);
+- am_Source_s sourceData(mDBUSMessageHandler.getSourceData());
+- log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::registerSource called, name", sourceData.name, "mSource.sourceClassID", sourceData.sourceClassID, "mSource.domainID", sourceData.domainID);
+- am_Error_e returnCode = mRoutingReceiveInterface->registerSource(sourceData, sourceData.sourceID);
+- mDBUSMessageHandler.initReply(msg);
+- mDBUSMessageHandler.append(sourceData.sourceID);
+- mDBUSMessageHandler.append(returnCode);
+- mDBUSMessageHandler.sendMessage();
+- if (returnCode != E_OK)
+- {
+- log(&routingDbus, DLT_LOG_INFO, "error registering source");
+- return;
+- }
+- mpRoutingSenderDbus->addSourceLookup(sourceData.sourceID, sourceData.domainID);
+-}
+-
+-void IAmRoutingReceiverShadowDbus::registerSink(DBusConnection* conn, DBusMessage* msg)
+-{
+- (void) ((conn));
+- assert(mRoutingReceiveInterface != NULL);
+- mDBUSMessageHandler.initReceive(msg);
+- am_Sink_s sinkData(mDBUSMessageHandler.getSinkData());
+- log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::registerSink called, name", sinkData.name, "mSink.sinkClassID", sinkData.sinkClassID, "mSink.domainID", sinkData.domainID);
+- am_Error_e returnCode = mRoutingReceiveInterface->registerSink(sinkData, sinkData.sinkID);
+- mDBUSMessageHandler.initReply(msg);
+- mDBUSMessageHandler.append(sinkData.sinkID);
+- mDBUSMessageHandler.append(returnCode);
+- mDBUSMessageHandler.sendMessage();
+- if (returnCode != E_OK)
+- {
+- log(&routingDbus, DLT_LOG_INFO, "error registering sink");
+- return;
+- }
+- mpRoutingSenderDbus->addSinkLookup(sinkData.sinkID, sinkData.domainID);
+-}
+-
+-void IAmRoutingReceiverShadowDbus::registerGateway(DBusConnection* conn, DBusMessage* msg)
+-{
+- (void) ((conn));
+- assert(mRoutingReceiveInterface != NULL);
+- mDBUSMessageHandler.initReceive(msg);
+- am_Gateway_s gatewayData(mDBUSMessageHandler.getGatewayData());
+- am_Error_e returnCode = mRoutingReceiveInterface->registerGateway(gatewayData, gatewayData.gatewayID);
+- mDBUSMessageHandler.initReply(msg);
+- mDBUSMessageHandler.append(gatewayData.gatewayID);
+- mDBUSMessageHandler.append(returnCode);
+- mDBUSMessageHandler.sendMessage();
+- if (returnCode != E_OK)
+- {
+- log(&routingDbus, DLT_LOG_INFO, "error registering gateway");
+- return;
+- }
+-}
+-
+-void IAmRoutingReceiverShadowDbus::registerConverter(DBusConnection* conn, DBusMessage* msg)
+-{
+- (void) ((conn));
+- assert(mRoutingReceiveInterface != NULL);
+- mDBUSMessageHandler.initReceive(msg);
+- am_Converter_s gatewayData(mDBUSMessageHandler.getConverterData());
+- am_Error_e returnCode = mRoutingReceiveInterface->registerConverter(gatewayData, gatewayData.converterID);
+- mDBUSMessageHandler.initReply(msg);
+- mDBUSMessageHandler.append(gatewayData.converterID);
+- mDBUSMessageHandler.append(returnCode);
+- mDBUSMessageHandler.sendMessage();
+- if (returnCode != E_OK)
+- {
+- log(&routingDbus, DLT_LOG_INFO, "error registering gateway");
+- return;
+- }
+-}
+-
+-void IAmRoutingReceiverShadowDbus::hookDomainRegistrationComplete(DBusConnection* conn, DBusMessage* msg)
+-{
+- (void) ((conn));
+- assert(mRoutingReceiveInterface != NULL);
+- mDBUSMessageHandler.initReceive(msg);
+- am_domainID_t domainID(mDBUSMessageHandler.getUInt());
+- log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::hookDomainRegistrationComplete called, domainID", domainID);
+- mRoutingReceiveInterface->hookDomainRegistrationComplete((am_domainID_t)((domainID)));
+- mDBUSMessageHandler.initReply(msg);
+- mDBUSMessageHandler.sendMessage();
+-}
+-
+-void IAmRoutingReceiverShadowDbus::ackConnect(DBusConnection* conn, DBusMessage* msg)
+-{
+- (void) ((conn));
+- assert(mRoutingReceiveInterface != NULL);
+- mDBUSMessageHandler.initReceive(msg);
+- uint16_t handle(mDBUSMessageHandler.getUInt());
+- am_connectionID_t connectionID(mDBUSMessageHandler.getUInt());
+- am_Error_e error((am_Error_e)((mDBUSMessageHandler.getUInt())));
+- log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::ackConnect called, handle", handle, "connectionID", connectionID, "error", error);
+- am_Handle_s myhandle;
+- myhandle.handleType = H_CONNECT;
+- myhandle.handle = handle;
+- mRoutingReceiveInterface->ackConnect(myhandle, connectionID, error);
+- mpRoutingSenderDbus->removeHandle(handle);
+- mDBUSMessageHandler.initReply(msg);
+- mDBUSMessageHandler.sendMessage();
+-}
+-
+-void IAmRoutingReceiverShadowDbus::ackDisconnect(DBusConnection* conn, DBusMessage* msg)
+-{
+- (void) ((conn));
+- assert(mRoutingReceiveInterface != NULL);
+- mDBUSMessageHandler.initReceive(msg);
+- uint16_t handle(mDBUSMessageHandler.getUInt());
+- am_connectionID_t connectionID(mDBUSMessageHandler.getUInt());
+- am_Error_e error((am_Error_e)((mDBUSMessageHandler.getUInt())));
+- log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::ackDisconnect called, handle", handle, "connectionID", connectionID, "error", error);
+- am_Handle_s myhandle;
+- myhandle.handleType = H_DISCONNECT;
+- myhandle.handle = handle;
+- mRoutingReceiveInterface->ackDisconnect(myhandle, connectionID, error);
+- mpRoutingSenderDbus->removeHandle(handle);
+- //todo: Connection removal ???
+- mDBUSMessageHandler.initReply(msg);
+- mDBUSMessageHandler.sendMessage();
+-}
+-
+-void IAmRoutingReceiverShadowDbus::ackSetSinkVolume(DBusConnection* conn, DBusMessage* msg)
+-{
+- (void) ((conn));
+- assert(mRoutingReceiveInterface != NULL);
+- mDBUSMessageHandler.initReceive(msg);
+- uint16_t handle(mDBUSMessageHandler.getUInt());
+- am_volume_t volume(mDBUSMessageHandler.getInt());
+- am_Error_e error((am_Error_e)((mDBUSMessageHandler.getUInt())));
+- log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::ackSetSinkVolume called, handle", handle, "error", error, "volume", volume);
+- am_Handle_s myhandle;
+- myhandle.handleType = H_SETSINKVOLUME;
+- myhandle.handle = handle;
+- mRoutingReceiveInterface->ackSetSinkVolumeChange(myhandle, volume, error);
+- mpRoutingSenderDbus->removeHandle(handle);
+- mDBUSMessageHandler.initReply(msg);
+- mDBUSMessageHandler.sendMessage();
+-}
+-
+-void IAmRoutingReceiverShadowDbus::ackSetSourceState(DBusConnection* conn, DBusMessage* msg)
+-{
+- (void) ((conn));
+- assert(mRoutingReceiveInterface != NULL);
+- mDBUSMessageHandler.initReceive(msg);
+- uint16_t handle(mDBUSMessageHandler.getUInt());
+- am_Error_e error((am_Error_e)((mDBUSMessageHandler.getUInt())));
+- log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::ackSetSourceState called, handle", handle, "error", error);
+- am_Handle_s myhandle;
+- myhandle.handleType = H_SETSOURCESTATE;
+- myhandle.handle = handle;
+- mRoutingReceiveInterface->ackSetSourceState(myhandle, error);
+- mpRoutingSenderDbus->removeHandle(handle);
+- mDBUSMessageHandler.initReply(msg);
+- mDBUSMessageHandler.sendMessage();
+-}
+-
+-void IAmRoutingReceiverShadowDbus::ackSinkVolumeTick(DBusConnection* conn, DBusMessage* msg)
+-{
+- (void) ((conn));
+- assert(mRoutingReceiveInterface != NULL);
+- mDBUSMessageHandler.initReceive(msg);
+- uint16_t handle(mDBUSMessageHandler.getUInt());
+- am_sinkID_t sinkID(mDBUSMessageHandler.getUInt());
+- am_volume_t volume(mDBUSMessageHandler.getInt());
+- log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::ackSinkVolumeTick called, handle", handle, "sinkID", sinkID, "volume", volume);
+- am_Handle_s myhandle;
+- myhandle.handleType = H_SETSINKVOLUME;
+- myhandle.handle = handle;
+- mRoutingReceiveInterface->ackSinkVolumeTick(myhandle, sinkID, volume);
+- mDBUSMessageHandler.initReply(msg);
+- mDBUSMessageHandler.sendMessage();
+-}
+-
+-void IAmRoutingReceiverShadowDbus::ackSourceVolumeTick(DBusConnection* conn, DBusMessage* msg)
+-{
+- (void) ((conn));
+- assert(mRoutingReceiveInterface != NULL);
+- mDBUSMessageHandler.initReceive(msg);
+- uint16_t handle(mDBUSMessageHandler.getUInt());
+- am_sourceID_t sourceID(mDBUSMessageHandler.getUInt());
+- am_volume_t volume(mDBUSMessageHandler.getInt());
+- log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::ackSourceVolumeTick called, handle", handle, "sourceID", sourceID, "volume", volume);
+- am_Handle_s myhandle;
+- myhandle.handleType = H_SETSOURCEVOLUME;
+- myhandle.handle = handle;
+- mRoutingReceiveInterface->ackSourceVolumeTick(myhandle, sourceID, volume);
+- mDBUSMessageHandler.initReply(msg);
+- mDBUSMessageHandler.sendMessage();
+-}
+-
+-void IAmRoutingReceiverShadowDbus::ackSetSourceVolume(DBusConnection* conn, DBusMessage* msg)
+-{
+- (void) ((conn));
+- assert(mRoutingReceiveInterface != NULL);
+- mDBUSMessageHandler.initReceive(msg);
+- uint16_t handle(mDBUSMessageHandler.getUInt());
+- am_volume_t volume(mDBUSMessageHandler.getInt());
+- am_Error_e error((am_Error_e)((mDBUSMessageHandler.getUInt())));
+- log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::ackSetSourceVolume called, handle", handle, "volume", volume, "error", error);
+- am_Handle_s myhandle;
+- myhandle.handleType = H_SETSOURCEVOLUME;
+- myhandle.handle = handle;
+- mRoutingReceiveInterface->ackSetSourceVolumeChange(myhandle, volume, error);
+- mpRoutingSenderDbus->removeHandle(handle);
+- mDBUSMessageHandler.initReply(msg);
+- mDBUSMessageHandler.sendMessage();
+-}
+-
+-void IAmRoutingReceiverShadowDbus::ackSetSinkSoundProperty(DBusConnection* conn, DBusMessage* msg)
+-{
+- (void) ((conn));
+- assert(mRoutingReceiveInterface != NULL);
+- mDBUSMessageHandler.initReceive(msg);
+- uint16_t handle(mDBUSMessageHandler.getUInt());
+- am_Error_e error((am_Error_e)((mDBUSMessageHandler.getUInt())));
+- log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::ackSetSinkSoundProperty called, handle", handle, "error", error);
+- am_Handle_s myhandle;
+- myhandle.handleType = H_SETSINKSOUNDPROPERTY;
+- myhandle.handle = handle;
+- mRoutingReceiveInterface->ackSetSinkSoundProperty(myhandle, error);
+- mpRoutingSenderDbus->removeHandle(handle);
+- mDBUSMessageHandler.initReply(msg);
+- mDBUSMessageHandler.sendMessage();
+-}
+-
+-void IAmRoutingReceiverShadowDbus::ackSetSourceSoundProperty(DBusConnection* conn, DBusMessage* msg)
+-{
+- (void) ((conn));
+- assert(mRoutingReceiveInterface != NULL);
+- mDBUSMessageHandler.initReceive(msg);
+- uint16_t handle(mDBUSMessageHandler.getUInt());
+- am_Error_e error((am_Error_e)((mDBUSMessageHandler.getUInt())));
+- log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::ackSetSinkSoundProperty called, handle", handle, "error", error);
+- am_Handle_s myhandle;
+- myhandle.handleType = H_SETSOURCESOUNDPROPERTY;
+- myhandle.handle = handle;
+- mRoutingReceiveInterface->ackSetSourceSoundProperty(myhandle, error);
+- mpRoutingSenderDbus->removeHandle(handle);
+- mDBUSMessageHandler.initReply(msg);
+- mDBUSMessageHandler.sendMessage();
+-}
+-
+-void IAmRoutingReceiverShadowDbus::ackSetSinkSoundProperties(DBusConnection* conn, DBusMessage* msg)
+-{
+- (void) ((conn));
+- assert(mRoutingReceiveInterface != NULL);
+- mDBUSMessageHandler.initReceive(msg);
+- uint16_t handle = mDBUSMessageHandler.getUInt();
+- am_Error_e error = (am_Error_e)((mDBUSMessageHandler.getUInt()));
+- log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::ackSetSinkSoundProperties called, handle", handle, "error", error);
+- am_Handle_s myhandle;
+- myhandle.handleType = H_SETSINKSOUNDPROPERTIES;
+- myhandle.handle = handle;
+- mRoutingReceiveInterface->ackSetSinkSoundProperties(myhandle, error);
+- mpRoutingSenderDbus->removeHandle(handle);
+- mDBUSMessageHandler.initReply(msg);
+- mDBUSMessageHandler.sendMessage();
+-}
+-
+-void IAmRoutingReceiverShadowDbus::ackSetSourceSoundProperties(DBusConnection* conn, DBusMessage* msg)
+-{
+- (void) ((conn));
+- assert(mRoutingReceiveInterface != NULL);
+- mDBUSMessageHandler.initReceive(msg);
+- uint16_t handle = mDBUSMessageHandler.getUInt();
+- am_Error_e error = (am_Error_e)((mDBUSMessageHandler.getUInt()));
+- log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::ackSetSourceSoundProperties called, handle", handle, "error", error);
+- am_Handle_s myhandle;
+- myhandle.handleType = H_SETSOURCESOUNDPROPERTIES;
+- myhandle.handle = handle;
+- mRoutingReceiveInterface->ackSetSourceSoundProperties(myhandle, error);
+- mpRoutingSenderDbus->removeHandle(handle);
+- mDBUSMessageHandler.initReply(msg);
+- mDBUSMessageHandler.sendMessage();
+-}
+-
+-void IAmRoutingReceiverShadowDbus::ackCrossFading(DBusConnection* conn, DBusMessage* msg)
+-{
+- (void) ((conn));
+- assert(mRoutingReceiveInterface != NULL);
+- mDBUSMessageHandler.initReceive(msg);
+- uint16_t handle = mDBUSMessageHandler.getUInt();
+- am_HotSink_e hotsink = (am_HotSink_e)((mDBUSMessageHandler.getInt()));
+- am_Error_e error = (am_Error_e)((mDBUSMessageHandler.getUInt()));
+- log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::ackCrossFading called, handle", handle, "error", error);
+- am_Handle_s myhandle;
+- myhandle.handleType = H_CROSSFADE;
+- myhandle.handle = handle;
+- mRoutingReceiveInterface->ackCrossFading(myhandle, hotsink, error);
+- mpRoutingSenderDbus->removeHandle(handle);
+- mDBUSMessageHandler.initReply(msg);
+- mDBUSMessageHandler.sendMessage();
+-}
+-
+-void IAmRoutingReceiverShadowDbus::peekDomain(DBusConnection* conn, DBusMessage* msg)
+-{
+- (void) ((conn));
+- assert(mRoutingReceiveInterface != NULL);
+- mDBUSMessageHandler.initReceive(msg);
+- std::string name = std::string(mDBUSMessageHandler.getString());
+- log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::peekDomain called, name", name);
+- am_domainID_t domainID;
+- am_Error_e returnCode = mRoutingReceiveInterface->peekDomain(name, domainID);
+- mDBUSMessageHandler.initReply(msg);
+- mDBUSMessageHandler.append(domainID);
+- mDBUSMessageHandler.append(returnCode);
+- mDBUSMessageHandler.sendMessage();
+-}
+-
+-void IAmRoutingReceiverShadowDbus::deregisterDomain(DBusConnection* conn, DBusMessage* msg)
+-{
+- (void) ((conn));
+- assert(mRoutingReceiveInterface != NULL);
+- mDBUSMessageHandler.initReceive(msg);
+- am_domainID_t domainID = mDBUSMessageHandler.getUInt();
+- log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::deregisterDomain called, id", domainID);
+- am_Error_e returnCode = mRoutingReceiveInterface->deregisterDomain(domainID);
+- mDBUSMessageHandler.initReply(msg);
+- mDBUSMessageHandler.append(returnCode);
+- mDBUSMessageHandler.sendMessage();
+- mpRoutingSenderDbus->removeDomainLookup(domainID);
+-}
+-
+-void IAmRoutingReceiverShadowDbus::deregisterGateway(DBusConnection* conn, DBusMessage* msg)
+-{
+- (void) ((conn));
+- assert(mRoutingReceiveInterface != NULL);
+- mDBUSMessageHandler.initReceive(msg);
+- am_gatewayID_t gatewayID = mDBUSMessageHandler.getUInt();
+- log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::deregisterGateway called, id", gatewayID);
+- am_Error_e returnCode = mRoutingReceiveInterface->deregisterGateway(gatewayID);
+- mDBUSMessageHandler.initReply(msg);
+- mDBUSMessageHandler.append(returnCode);
+- mDBUSMessageHandler.sendMessage();
+-}
+-
+-void IAmRoutingReceiverShadowDbus::deregisterConverter(DBusConnection* conn, DBusMessage* msg)
+-{
+- (void) ((conn));
+- assert(mRoutingReceiveInterface != NULL);
+- mDBUSMessageHandler.initReceive(msg);
+- am_converterID_t converterID = mDBUSMessageHandler.getUInt();
+- log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::deregisterGateway called, id", converterID);
+- am_Error_e returnCode = mRoutingReceiveInterface->deregisterConverter(converterID);
+- mDBUSMessageHandler.initReply(msg);
+- mDBUSMessageHandler.append(returnCode);
+- mDBUSMessageHandler.sendMessage();
+-}
+-
+-void IAmRoutingReceiverShadowDbus::peekSink(DBusConnection* conn, DBusMessage* msg)
+-{
+- (void) ((conn));
+- assert(mRoutingReceiveInterface != NULL);
+- mDBUSMessageHandler.initReceive(msg);
+- std::string name = std::string(mDBUSMessageHandler.getString());
+- log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::peekSink called, name", name);
+- am_sinkID_t sinkID;
+- am_Error_e returnCode = mRoutingReceiveInterface->peekSink(name, sinkID);
+- mDBUSMessageHandler.initReply(msg);
+- mDBUSMessageHandler.append(sinkID);
+- mDBUSMessageHandler.append(returnCode);
+- mDBUSMessageHandler.sendMessage();
+-}
+-
+-void IAmRoutingReceiverShadowDbus::deregisterSink(DBusConnection* conn, DBusMessage* msg)
+-{
+- (void) ((conn));
+- assert(mRoutingReceiveInterface != NULL);
+- mDBUSMessageHandler.initReceive(msg);
+- am_sinkID_t sinkID = mDBUSMessageHandler.getInt();
+- log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::deregisterSink called, id", sinkID);
+- am_Error_e returnCode = mRoutingReceiveInterface->deregisterSink(sinkID);
+- mDBUSMessageHandler.initReply(msg);
+- mDBUSMessageHandler.append(returnCode);
+- mDBUSMessageHandler.sendMessage();
+- mpRoutingSenderDbus->removeSinkLookup(sinkID);
+-}
+-
+-void IAmRoutingReceiverShadowDbus::peekSource(DBusConnection* conn, DBusMessage* msg)
+-{
+- (void) ((conn));
+- assert(mRoutingReceiveInterface != NULL);
+- mDBUSMessageHandler.initReceive(msg);
+- std::string name = std::string(mDBUSMessageHandler.getString());
+- log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::peekSource called, name", name);
+- am_sourceID_t sourceID;
+- am_Error_e returnCode = mRoutingReceiveInterface->peekSource(name, sourceID);
+- mDBUSMessageHandler.initReply(msg);
+- mDBUSMessageHandler.append(sourceID);
+- mDBUSMessageHandler.append(returnCode);
+- mDBUSMessageHandler.sendMessage();
+-}
+-
+-void IAmRoutingReceiverShadowDbus::deregisterSource(DBusConnection* conn, DBusMessage* msg)
+-{
+- (void) ((conn));
+- assert(mRoutingReceiveInterface != NULL);
+- mDBUSMessageHandler.initReceive(msg);
+- am_sourceID_t sourceID = mDBUSMessageHandler.getInt();
+- log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::deregisterSource called, id", sourceID);
+- am_Error_e returnCode = mRoutingReceiveInterface->deregisterSource(sourceID);
+- mDBUSMessageHandler.initReply(msg);
+- mDBUSMessageHandler.append(returnCode);
+- mDBUSMessageHandler.sendMessage();
+- mpRoutingSenderDbus->removeSourceLookup(sourceID);
+-}
+-
+-void IAmRoutingReceiverShadowDbus::registerCrossfader(DBusConnection* conn, DBusMessage* msg)
+-{
+- (void) ((conn));
+- assert(mRoutingReceiveInterface != NULL);
+- mDBUSMessageHandler.initReceive(msg);
+- am_Crossfader_s crossfader (mDBUSMessageHandler.getCrossfaderData());
+- log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::registerCrossfader called, name", crossfader.name);
+- am_Error_e returnCode = mRoutingReceiveInterface->registerCrossfader(crossfader, crossfader.crossfaderID);
+- mDBUSMessageHandler.initReply(msg);
+- mDBUSMessageHandler.append(crossfader.crossfaderID);
+- mDBUSMessageHandler.append(returnCode);
+- mDBUSMessageHandler.sendMessage();
+- if (returnCode != E_OK)
+- {
+- log(&routingDbus, DLT_LOG_INFO, "error registering crossfader");
+- return;
+- }
+- //todo: add Crossfader lookup
+-}
+-
+-void IAmRoutingReceiverShadowDbus::deregisterCrossfader(DBusConnection* conn, DBusMessage* msg)
+-{
+- (void) ((conn));
+- assert(mRoutingReceiveInterface != NULL);
+- mDBUSMessageHandler.initReceive(msg);
+- am_crossfaderID_t crossfaderID = mDBUSMessageHandler.getInt();
+- log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::deregisterCrossfader called, id", crossfaderID);
+- am_Error_e returnCode = mRoutingReceiveInterface->deregisterCrossfader(crossfaderID);
+- mDBUSMessageHandler.initReply(msg);
+- mDBUSMessageHandler.append(returnCode);
+- mDBUSMessageHandler.sendMessage();
+- //todo: remove Crossfader lookup
+-}
+-
+-void IAmRoutingReceiverShadowDbus::peekSourceClassID(DBusConnection* conn, DBusMessage* msg)
+-{
+- (void) ((conn));
+- assert(mRoutingReceiveInterface != NULL);
+- mDBUSMessageHandler.initReceive(msg);
+- std::string name = std::string(mDBUSMessageHandler.getString());
+- log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::peekSourceClassID called, name", name);
+- am_sourceClass_t sourceClassID;
+- am_Error_e returnCode = mRoutingReceiveInterface->peekSourceClassID(name, sourceClassID);
+- mDBUSMessageHandler.initReply(msg);
+- mDBUSMessageHandler.append(sourceClassID);
+- mDBUSMessageHandler.append(returnCode);
+- mDBUSMessageHandler.sendMessage();
+-}
+-
+-void IAmRoutingReceiverShadowDbus::peekSinkClassID(DBusConnection* conn, DBusMessage* msg)
+-{
+- (void) ((conn));
+- assert(mRoutingReceiveInterface != NULL);
+- mDBUSMessageHandler.initReceive(msg);
+- std::string name = std::string(mDBUSMessageHandler.getString());
+- log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::peekSinkClassID called, name", name);
+- am_sinkClass_t sinkClassID;
+- am_Error_e returnCode = mRoutingReceiveInterface->peekSinkClassID(name, sinkClassID);
+- mDBUSMessageHandler.initReply(msg);
+- mDBUSMessageHandler.append(sinkClassID);
+- mDBUSMessageHandler.append(returnCode);
+- mDBUSMessageHandler.sendMessage();
+-}
+-
+-void IAmRoutingReceiverShadowDbus::hookInterruptStatusChange(DBusConnection* conn, DBusMessage* msg)
+-{
+- (void) ((conn));
+- assert(mRoutingReceiveInterface != NULL);
+- mDBUSMessageHandler.initReceive(msg);
+- am_sourceID_t sourceID = mDBUSMessageHandler.getUInt();
+- am_InterruptState_e interruptState = (am_InterruptState_e)((mDBUSMessageHandler.getUInt()));
+- log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::hookInterruptStatusChange called, sourceID", sourceID);
+- mRoutingReceiveInterface->hookInterruptStatusChange(sourceID, interruptState);
+- mDBUSMessageHandler.initReply(msg);
+- mDBUSMessageHandler.sendMessage();
+-}
+-
+-void IAmRoutingReceiverShadowDbus::hookSinkAvailablityStatusChange(DBusConnection* conn, DBusMessage* msg)
+-{
+- (void) ((conn));
+- assert(mRoutingReceiveInterface != NULL);
+- mDBUSMessageHandler.initReceive(msg);
+- am_sinkID_t sinkID = mDBUSMessageHandler.getInt();
+- am_Availability_s avialabilty = mDBUSMessageHandler.getAvailability();
+- log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::hookSinkAvailablityStatusChange called, sinkID", sinkID);
+- mRoutingReceiveInterface->hookSinkAvailablityStatusChange(sinkID, avialabilty);
+-}
+-
+-void IAmRoutingReceiverShadowDbus::hookSourceAvailablityStatusChange(DBusConnection* conn, DBusMessage* msg)
+-{
+- (void) ((conn));
+- assert(mRoutingReceiveInterface != NULL);
+- mDBUSMessageHandler.initReceive(msg);
+- am_sourceID_t sourceID = mDBUSMessageHandler.getInt();
+- am_Availability_s avialabilty = mDBUSMessageHandler.getAvailability();
+- log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::hookSourceAvailablityStatusChange called, sourceID", sourceID);
+- mRoutingReceiveInterface->hookSourceAvailablityStatusChange(sourceID, avialabilty);
+-}
+-
+-void IAmRoutingReceiverShadowDbus::hookDomainStateChange(DBusConnection* conn, DBusMessage* msg)
+-{
+- (void) ((conn));
+- assert(mRoutingReceiveInterface != NULL);
+- mDBUSMessageHandler.initReceive(msg);
+- am_domainID_t domainID = mDBUSMessageHandler.getUInt();
+- am_DomainState_e domainState = (am_DomainState_e)((mDBUSMessageHandler.getInt()));
+- log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::hookDomainStateChange called, hookDomainStateChange", domainID);
+- mRoutingReceiveInterface->hookDomainStateChange(domainID, domainState);
+-}
+-
+-void IAmRoutingReceiverShadowDbus::hookTimingInformationChanged(DBusConnection* conn, DBusMessage* msg)
+-{
+- (void) ((conn));
+- assert(mRoutingReceiveInterface != NULL);
+- mDBUSMessageHandler.initReceive(msg);
+- am_connectionID_t connectionID(mDBUSMessageHandler.getInt());
+- am_timeSync_t time(mDBUSMessageHandler.getInt());
+- log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::hookTimingInformationChanged called, connectionID", connectionID);
+- mRoutingReceiveInterface->hookTimingInformationChanged(connectionID, time);
+-}
+-
+-void IAmRoutingReceiverShadowDbus::sendChangedData(DBusConnection* conn, DBusMessage* msg)
+-{
+- (void) ((conn));
+- assert(mRoutingReceiveInterface != NULL);
+- mDBUSMessageHandler.initReceive(msg);
+- std::vector < am_EarlyData_s > listEarlyData(mDBUSMessageHandler.getEarlyData());
+- log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::hookTimingInformationChanged called, sendChangedData");
+- mRoutingReceiveInterface->sendChangedData(listEarlyData);
+-}
+-
+-DBusHandlerResult IAmRoutingReceiverShadowDbus::receiveCallback(DBusConnection* conn, DBusMessage* msg, void* user_data)
+-{
+- assert(conn != NULL);
+- assert(msg != NULL);
+- assert(user_data != NULL);
+- IAmRoutingReceiverShadowDbus* reference = (IAmRoutingReceiverShadowDbus*) ((user_data));
+- return (reference->receiveCallbackDelegate(conn, msg));
+-}
+-
+-void IAmRoutingReceiverShadowDbus::getRoutingReadyStatus(DBusConnection* conn, DBusMessage* msg)
+-{
+- (void) ((conn));
+- assert(mRoutingReceiveInterface != NULL);
+- mDBUSMessageHandler.initReply(msg);
+- mDBUSMessageHandler.append(mRoutingReady);
+- mDBUSMessageHandler.sendMessage();
+-}
+-
+-
+-void IAmRoutingReceiverShadowDbus::sendIntrospection(DBusConnection* conn, DBusMessage* msg)
+-{
+- assert(conn != NULL);
+- assert(msg != NULL);
+- DBusMessage* reply;
+- DBusMessageIter args;
+- dbus_uint32_t serial = 0;
+-
+- // create a reply from the message
+- reply = dbus_message_new_method_return(msg);
+- std::string fullpath(ROUTING_DBUS_INTROSPECTION_FILE);
+- std::ifstream in(fullpath.c_str(), std::ifstream::in);
+- if (!in)
+- {
+- logError("IAmCommandReceiverShadow::sendIntrospection could not load xml file ",fullpath);
+- throw std::runtime_error("IAmCommandReceiverShadow::sendIntrospection Could not load introspecton XML");
+- }
+- std::string introspect((std::istreambuf_iterator<char>(in)), std::istreambuf_iterator<char>());
+- const char* string = introspect.c_str();
+-
+- // add the arguments to the reply
+- dbus_message_iter_init_append(reply, &args);
+- if (!dbus_message_iter_append_basic(&args, DBUS_TYPE_STRING, &string))
+- {
+- log(&routingDbus, DLT_LOG_INFO, "DBUS handler Out Of Memory!");
+- }
+-
+- // send the reply && flush the connection
+- if (!dbus_connection_send(conn, reply, &serial))
+- {
+- log(&routingDbus, DLT_LOG_INFO, "DBUS handler Out Of Memory!");
+- }
+- dbus_connection_flush(conn);
+-
+- // free the reply
+- dbus_message_unref(reply);
+-}
+-
+-DBusHandlerResult IAmRoutingReceiverShadowDbus::receiveCallbackDelegate(DBusConnection* conn, DBusMessage* msg)
+-{
+- if (dbus_message_is_method_call(msg, DBUS_INTERFACE_INTROSPECTABLE, "Introspect"))
+- {
+- sendIntrospection(conn, msg);
+- return (DBUS_HANDLER_RESULT_HANDLED);
+- }
+- functionMap_t::iterator iter = mFunctionMap.begin();
+- std::string k(dbus_message_get_member(msg));
+- log(&routingDbus, DLT_LOG_INFO, k.c_str());
+- iter = mFunctionMap.find(k);
+- if (iter != mFunctionMap.end())
+- {
+- std::string p(iter->first);
+- CallBackMethod cb = iter->second;
+- (this->*cb)(conn, msg);
+- return (DBUS_HANDLER_RESULT_HANDLED);
+- }
+- return (DBUS_HANDLER_RESULT_NOT_YET_HANDLED);
+-}
+-
+-void IAmRoutingReceiverShadowDbus::setRoutingReceiver(IAmRoutingReceive*& receiver)
+-{
+- assert(receiver != NULL);
+- mRoutingReceiveInterface = receiver;
+- gObjectPathVTable.message_function = IAmRoutingReceiverShadowDbus::receiveCallback;
+- DBusConnection* connection;
+- mRoutingReceiveInterface->getDBusConnectionWrapper(mDBusWrapper);
+- assert(mDBusWrapper != NULL);
+- mDBusWrapper->getDBusConnection(connection);
+- assert(connection != NULL);
+- mDBUSMessageHandler.setDBusConnection(connection);
+- std::string path(ROUTING_NODE);
+- {
+- assert(receiver != NULL);
+- }
+- mDBusWrapper->registerCallback(&gObjectPathVTable, path, this);
+-}
+-
+-void IAmRoutingReceiverShadowDbus::confirmRoutingReady(DBusConnection* conn, DBusMessage* msg)
+-{
+- (void) ((conn));
+- assert(mRoutingReceiveInterface != NULL);
+- mDBUSMessageHandler.initReceive(msg);
+- am_domainID_t domainID(mDBUSMessageHandler.getUInt());
+- log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadowDbus::confirmRoutingReady called, domainID", domainID);
+-
+- mRoutingReceiveInterface->confirmRoutingReady(mHandle, E_OK);
+- mNumberDomains++;
+-
+- mDBUSMessageHandler.initReply(msg);
+- mDBUSMessageHandler.sendMessage();
+-}
+-
+-void IAmRoutingReceiverShadowDbus::confirmRoutingRundown(DBusConnection* conn, DBusMessage* msg)
+-{
+- (void) ((conn));
+- assert(mRoutingReceiveInterface != NULL);
+- mDBUSMessageHandler.initReceive(msg);
+- am_domainID_t domainID(mDBUSMessageHandler.getUInt());
+- log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadowDbus::confirmRoutingRundown called, domainID", domainID);
+-
+- mNumberDomains--;
+- if(mNumberDomains==0)
+- {
+- logInfo("sending out");
+- mRoutingReceiveInterface->confirmRoutingRundown(mHandle,E_OK);
+- }
+- mDBUSMessageHandler.initReply(msg);
+- mDBUSMessageHandler.sendMessage();
+-}
+-
+-void IAmRoutingReceiverShadowDbus::gotReady(int16_t numberDomains, uint16_t handle)
+-{
+- mRoutingReady=true;
+- mNumberDomains=numberDomains;
+- mHandle=handle;
+-}
+-void IAmRoutingReceiverShadowDbus::gotRundown(int16_t numberDomains, uint16_t handle)
+-{
+- mRoutingReady=false;
+- mNumberDomains=numberDomains;
+- mHandle=handle;
+-}
+-
+-void IAmRoutingReceiverShadowDbus::updateGateway(DBusConnection* conn, DBusMessage* msg)
+-{
+- (void) ((conn));
+- assert(mRoutingReceiveInterface != NULL);
+- mDBUSMessageHandler.initReceive(msg);
+- am_gatewayID_t gatewayID(mDBUSMessageHandler.getInt());
+- std::vector<am_CustomAvailabilityReason_t> listSourceConnectionFormats(mDBUSMessageHandler.getListconnectionFormats());
+- std::vector<am_CustomAvailabilityReason_t> listSinkConnectionFormats(mDBUSMessageHandler.getListconnectionFormats());
+- std::vector<bool> convertionMatrix(mDBUSMessageHandler.getListBool());
+-
+- am_Error_e returnCode = mRoutingReceiveInterface->updateGateway(gatewayID,listSourceConnectionFormats,listSinkConnectionFormats,convertionMatrix);
+- mDBUSMessageHandler.initReply(msg);
+- mDBUSMessageHandler.append(returnCode);
+- mDBUSMessageHandler.sendMessage();
+- if (returnCode != E_OK)
+- {
+- log(&routingDbus, DLT_LOG_INFO, "error updateGateway");
+- return;
+- }
+-}
+-
+-void IAmRoutingReceiverShadowDbus::updateConverter(DBusConnection* conn, DBusMessage* msg)
+-{
+- (void) ((conn));
+- assert(mRoutingReceiveInterface != NULL);
+- mDBUSMessageHandler.initReceive(msg);
+- am_converterID_t converterID(mDBUSMessageHandler.getInt());
+- std::vector<am_CustomAvailabilityReason_t> listSourceConnectionFormats(mDBUSMessageHandler.getListconnectionFormats());
+- std::vector<am_CustomAvailabilityReason_t> listSinkConnectionFormats(mDBUSMessageHandler.getListconnectionFormats());
+- std::vector<bool> convertionMatrix(mDBUSMessageHandler.getListBool());
+-
+- am_Error_e returnCode = mRoutingReceiveInterface->updateConverter(converterID,listSourceConnectionFormats,listSinkConnectionFormats,convertionMatrix);
+- mDBUSMessageHandler.initReply(msg);
+- mDBUSMessageHandler.append(returnCode);
+- mDBUSMessageHandler.sendMessage();
+- if (returnCode != E_OK)
+- {
+- log(&routingDbus, DLT_LOG_INFO, "error updateGateway");
+- return;
+- }
+-}
+-
+-void IAmRoutingReceiverShadowDbus::updateSink(DBusConnection* conn, DBusMessage* msg)
+-{
+- (void) ((conn));
+- assert(mRoutingReceiveInterface != NULL);
+- mDBUSMessageHandler.initReceive(msg);
+- am_sinkID_t sinkID(mDBUSMessageHandler.getInt());
+- am_sinkClass_t sinkClassID(mDBUSMessageHandler.getInt());
+- std::vector<am_SoundProperty_s> listSoundProperties(mDBUSMessageHandler.getListSoundProperties());
+- std::vector<am_CustomAvailabilityReason_t> listSinkConnectionFormats(mDBUSMessageHandler.getListconnectionFormats());
+- std::vector<am_MainSoundProperty_s> listMainSoundProperties(mDBUSMessageHandler.getListMainSoundProperties());
+-
+- am_Error_e returnCode = mRoutingReceiveInterface->updateSink(sinkID,sinkClassID,listSoundProperties,listSinkConnectionFormats,listMainSoundProperties);
+- mDBUSMessageHandler.initReply(msg);
+- mDBUSMessageHandler.append(returnCode);
+- mDBUSMessageHandler.sendMessage();
+- if (returnCode != E_OK)
+- {
+- log(&routingDbus, DLT_LOG_INFO, "error updateSink");
+- return;
+- }
+-}
+-
+-void IAmRoutingReceiverShadowDbus::updateSource(DBusConnection* conn, DBusMessage* msg)
+-{
+- (void) ((conn));
+- assert(mRoutingReceiveInterface != NULL);
+- mDBUSMessageHandler.initReceive(msg);
+- am_sourceID_t sourceID(mDBUSMessageHandler.getInt());
+- am_sourceClass_t sourceClassID(mDBUSMessageHandler.getInt());
+- std::vector<am_SoundProperty_s> listSoundProperties(mDBUSMessageHandler.getListSoundProperties());
+- std::vector<am_CustomAvailabilityReason_t> listSinkConnectionFormats(mDBUSMessageHandler.getListconnectionFormats());
+- std::vector<am_MainSoundProperty_s> listMainSoundProperties(mDBUSMessageHandler.getListMainSoundProperties());
+-
+- am_Error_e returnCode = mRoutingReceiveInterface->updateSource(sourceID,sourceClassID,listSoundProperties,listSinkConnectionFormats,listMainSoundProperties);
+- mDBUSMessageHandler.initReply(msg);
+- mDBUSMessageHandler.append(returnCode);
+- mDBUSMessageHandler.sendMessage();
+- if (returnCode != E_OK)
+- {
+- log(&routingDbus, DLT_LOG_INFO, "error updateSink");
+- return;
+- }
+-}
+-
+-void IAmRoutingReceiverShadowDbus::ackSetVolumes(DBusConnection* conn, DBusMessage* msg)
+-{
+- (void) ((conn));
+- am_Error_e returnCode(am_Error_e::E_NOT_USED);
+- mDBUSMessageHandler.initReply(msg);
+- mDBUSMessageHandler.append(returnCode);
+- mDBUSMessageHandler.sendMessage();
+- log(&routingDbus, DLT_LOG_INFO, "error ackSetVolumes was called - not implemented yet");
+- return;
+-}
+-
+-void IAmRoutingReceiverShadowDbus::ackSinkNotificationConfiguration(DBusConnection* conn, DBusMessage* msg)
+-{
+- (void) ((conn));
+- assert(mRoutingReceiveInterface != NULL);
+- mDBUSMessageHandler.initReceive(msg);
+- uint16_t handle(mDBUSMessageHandler.getUInt());
+- am_Error_e error((am_Error_e)((mDBUSMessageHandler.getUInt())));
+- log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::ackSinkNotificationConfiguration called, handle", handle, "error", error);
+- am_Handle_s myhandle;
+- myhandle.handleType = H_CONNECT;
+- myhandle.handle = handle;
+- mRoutingReceiveInterface->ackSinkNotificationConfiguration(myhandle, error);
+- mpRoutingSenderDbus->removeHandle(handle);
+- mDBUSMessageHandler.initReply(msg);
+- mDBUSMessageHandler.sendMessage();
+-}
+-
+-void IAmRoutingReceiverShadowDbus::ackSourceNotificationConfiguration(DBusConnection* conn, DBusMessage* msg)
+-{
+- (void) ((conn));
+- assert(mRoutingReceiveInterface != NULL);
+- mDBUSMessageHandler.initReceive(msg);
+- uint16_t handle(mDBUSMessageHandler.getUInt());
+- am_Error_e error((am_Error_e)((mDBUSMessageHandler.getUInt())));
+- log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::ackSourceNotificationConfiguration called, handle", handle, "error", error);
+- am_Handle_s myhandle;
+- myhandle.handleType = H_CONNECT;
+- myhandle.handle = handle;
+- mRoutingReceiveInterface->ackSourceNotificationConfiguration(myhandle, error);
+- mpRoutingSenderDbus->removeHandle(handle);
+- mDBUSMessageHandler.initReply(msg);
+- mDBUSMessageHandler.sendMessage();
+-}
+-
+-void IAmRoutingReceiverShadowDbus::hookSinkNotificationDataChange(DBusConnection* conn, DBusMessage* msg)
+-{
+- (void) ((conn));
+- assert(mRoutingReceiveInterface != NULL);
+- mDBUSMessageHandler.initReceive(msg);
+- am_sinkID_t sinkID(mDBUSMessageHandler.getUInt());
+- am_NotificationPayload_s payload(mDBUSMessageHandler.getNotificationPayload());
+- log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::hookSinkNotificationDataChange called, sinkID", sinkID);
+- mRoutingReceiveInterface->hookSinkNotificationDataChange(sinkID, payload);
+- mDBUSMessageHandler.initReply(msg);
+- mDBUSMessageHandler.sendMessage();
+-}
+-
+-void IAmRoutingReceiverShadowDbus::hookSourceNotificationDataChange(DBusConnection* conn, DBusMessage* msg)
+-{
+- (void) ((conn));
+- assert(mRoutingReceiveInterface != NULL);
+- mDBUSMessageHandler.initReceive(msg);
+- am_sourceID_t sourceID(mDBUSMessageHandler.getUInt());
+- am_NotificationPayload_s payload(mDBUSMessageHandler.getNotificationPayload());
+- log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::hookSourceNotificationDataChange called, sourceID", sourceID);
+- mRoutingReceiveInterface->hookSourceNotificationDataChange(sourceID, payload);
+- mDBUSMessageHandler.initReply(msg);
+- mDBUSMessageHandler.sendMessage();
+-}
+-
+-IAmRoutingReceiverShadowDbus::functionMap_t IAmRoutingReceiverShadowDbus::createMap()
+-{
+- functionMap_t m;
+- m["ackConnect"] = &IAmRoutingReceiverShadowDbus::ackConnect;
+- m["ackDisconnect"] = &IAmRoutingReceiverShadowDbus::ackDisconnect;
+- m["ackSetSinkVolume"] = &IAmRoutingReceiverShadowDbus::ackSetSinkVolume;
+- m["ackSetSourceVolume"] = &IAmRoutingReceiverShadowDbus::ackSetSourceVolume;
+- m["ackSetSourceState"] = &IAmRoutingReceiverShadowDbus::ackSetSourceState;
+- m["ackSinkVolumeTick"] = &IAmRoutingReceiverShadowDbus::ackSinkVolumeTick;
+- m["ackSourceVolumeTick"] = &IAmRoutingReceiverShadowDbus::ackSourceVolumeTick;
+- m["ackSetSinkSoundProperty"] = &IAmRoutingReceiverShadowDbus::ackSetSinkSoundProperty;
+- m["ackSetSourceSoundProperty"] = &IAmRoutingReceiverShadowDbus::ackSetSourceSoundProperty;
+- m["ackSetSinkSoundProperties"] = &IAmRoutingReceiverShadowDbus::ackSetSinkSoundProperties;
+- m["ackSetSourceSoundProperties"] = &IAmRoutingReceiverShadowDbus::ackSetSourceSoundProperties;
+- m["ackCrossFading"] = &IAmRoutingReceiverShadowDbus::ackCrossFading;
+- m["registerDomain"] = &IAmRoutingReceiverShadowDbus::registerDomain;
+- m["registerSource"] = &IAmRoutingReceiverShadowDbus::registerSource;
+- m["registerSink"] = &IAmRoutingReceiverShadowDbus::registerSink;
+- m["registerGateway"] = &IAmRoutingReceiverShadowDbus::registerGateway;
+- m["peekDomain"] = &IAmRoutingReceiverShadowDbus::peekDomain;
+- m["deregisterDomain"] = &IAmRoutingReceiverShadowDbus::deregisterDomain;
+- m["deregisterGateway"] = &IAmRoutingReceiverShadowDbus::deregisterGateway;
+- m["peekSink"] = &IAmRoutingReceiverShadowDbus::peekSink;
+- m["deregisterSink"] = &IAmRoutingReceiverShadowDbus::deregisterSink;
+- m["peekSource"] = &IAmRoutingReceiverShadowDbus::peekSource;
+- m["deregisterSource"] = &IAmRoutingReceiverShadowDbus::deregisterSource;
+- m["registerCrossfader"] = &IAmRoutingReceiverShadowDbus::registerCrossfader;
+- m["deregisterCrossfader"] = &IAmRoutingReceiverShadowDbus::deregisterCrossfader;
+- m["peekSourceClassID"] = &IAmRoutingReceiverShadowDbus::peekSourceClassID;
+- m["peekSinkClassID"] = &IAmRoutingReceiverShadowDbus::peekSinkClassID;
+- m["hookInterruptStatusChange"] = &IAmRoutingReceiverShadowDbus::hookInterruptStatusChange;
+- m["hookDomainRegistrationComplete"] = &IAmRoutingReceiverShadowDbus::hookDomainRegistrationComplete;
+- m["hookSinkAvailablityStatusChange"] = &IAmRoutingReceiverShadowDbus::hookSinkAvailablityStatusChange;
+- m["hookSourceAvailablityStatusChange"] = &IAmRoutingReceiverShadowDbus::hookSourceAvailablityStatusChange;
+- m["hookDomainStateChange"] = &IAmRoutingReceiverShadowDbus::hookDomainStateChange;
+- m["hookTimingInformationChanged"] = &IAmRoutingReceiverShadowDbus::hookTimingInformationChanged;
+- m["sendChangedData"] = &IAmRoutingReceiverShadowDbus::sendChangedData;
+- m["confirmRoutingReady"] = &IAmRoutingReceiverShadowDbus::confirmRoutingReady;
+- m["confirmRoutingRundown"] = &IAmRoutingReceiverShadowDbus::confirmRoutingRundown;
+- m["ackSetVolumes"] = &IAmRoutingReceiverShadowDbus::ackSetVolumes;
+- m["ackSinkNotificationConfiguration"] = &IAmRoutingReceiverShadowDbus::ackSinkNotificationConfiguration;
+- m["ackSourceNotificationConfiguration"] = &IAmRoutingReceiverShadowDbus::ackSourceNotificationConfiguration;
+- m["hookSinkNotificationDataChange"] = &IAmRoutingReceiverShadowDbus::hookSinkNotificationDataChange;
+- m["hookSourceNotificationDataChange"] = &IAmRoutingReceiverShadowDbus::hookSourceNotificationDataChange;
+- m["getRoutingReadyState"] = &IAmRoutingReceiverShadowDbus::getRoutingReadyStatus;
+- return (m);
+-}
+-}
+diff --git a/PluginRoutingInterfaceDbus/CMakeLists.txt b/PluginRoutingInterfaceDbus/CMakeLists.txt
+new file mode 100644
+index 0000000..99170f5
+--- /dev/null
++++ b/PluginRoutingInterfaceDbus/CMakeLists.txt
+@@ -0,0 +1,108 @@
++# Copyright (c) 2012 GENIVI Alliance
++# Copyright (c) 2012 BMW
++#
++# author Christian Linke, christian.linke@bmw.de BMW 2011,2012
++#
++# copyright
++# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction,
++# including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
++# subject to the following conditions:
++# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
++# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
++# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
++# THE USE OR OTHER DEALINGS IN THE SOFTWARE.
++#
++# For further information see http://www.genivi.org/.
++#
++cmake_minimum_required(VERSION 2.8.8)
++
++PROJECT(PluginRoutingInterfaceDbus)
++
++if (NOT DAEMONVERSION)
++ message(STATUS "Building without AudioManager, searching for cmake definition")
++ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
++ find_package(AudioManager)
++ if (AUDIOMANAGER_FOUND)
++ include ("${AUDIOMANAGER_CMAKE_CONFIG_PATH}/audiomanagerConfig.cmake")
++ set(PLUGINS_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR})
++ set(TEST_EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR})
++
++ set(COMMONAPI_DBUS_CONFIGURATIONS "")
++ else(AUDIOMANAGER_FOUND)
++ message(FATAL_ERROR "Could not find audiomanager cmake configuration")
++ endif(AUDIOMANAGER_FOUND)
++endif (NOT DAEMONVERSION)
++
++IF(NOT WITH_DBUS_WRAPPER)
++ message (FATAL_ERROR "For Dbus plugins you need to compile the AM WITH_DBUS_WRAPPER")
++ENDIF(NOT WITH_DBUS_WRAPPER)
++
++ set(LIBRARY_OUTPUT_PATH ${PLUGINS_OUTPUT_PATH}/routing)
++ set(INCLUDE_FOLDER "include")
++ if(WITH_DLT)
++ pkg_check_modules(DLT REQUIRED automotive-dlt>=2.2.0)
++ add_definitions(${DLT_CFLAGS_OTHER})
++ include_directories(${DLT_INCLUDE_DIRS})
++ link_directories(${DLT_LIBRARY_DIRS})
++ endif(WITH_DLT)
++
++ IF(USE_BUILD_LIBS)
++ SET(ROUTING_DBUS_INTROSPECTION_FOLDER ${EXECUTABLE_OUTPUT_PATH})
++ SET(ROUTING_DBUS_INTROSPECTION_FILE ${EXECUTABLE_OUTPUT_PATH}/RoutingReceiver.xml)
++ ELSE(USE_BUILD_LIBS)
++ SET(ROUTING_DBUS_INTROSPECTION_FOLDER ${AM_SHARE_FOLDER}/${LIB_INSTALL_SUFFIX})
++ SET(ROUTING_DBUS_INTROSPECTION_FILE ${AM_SHARE_FOLDER}/${LIB_INSTALL_SUFFIX}/RoutingReceiver.xml)
++ ENDIF(USE_BUILD_LIBS)
++
++
++ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/config.cmake ${CMAKE_CURRENT_SOURCE_DIR}/include/configRoutingDbus.h )
++
++ pkg_check_modules (DBUS "dbus-1 >= 1.4" REQUIRED)
++
++ INCLUDE_DIRECTORIES(
++ ${CMAKE_SOURCE_DIR}
++ ${CMAKE_CURRENT_BINARY_DIR}
++ ${DBUS_INCLUDE_DIRS}
++ ${AUDIO_INCLUDE_FOLDER}
++ ${AUDIOMANAGER_INCLUDE_FOLDER}
++ ${AUDIOMANAGER_UTILITIES_INCLUDE}
++ ${INCLUDE_FOLDER}
++ )
++
++ # all source files go here
++ file(GLOB PLUGINDBUS_SRCS_CXX "src/*.cpp")
++
++ add_library(PluginRoutingInterfaceDbus MODULE ${PLUGINDBUS_SRCS_CXX})
++
++ TARGET_LINK_LIBRARIES(PluginRoutingInterfaceDbus
++ ${DLT_LIBRARIES}
++ ${DBUS_LIBRARIES}
++ )
++
++ IF(WITH_TESTS)
++ # add_subdirectory (test)
++ ENDIF(WITH_TESTS)
++
++ IF(USE_BUILD_LIBS)
++ execute_process(
++ COMMAND mkdir -p "${EXECUTABLE_OUTPUT_PATH}"
++ COMMAND cp "${CMAKE_CURRENT_SOURCE_DIR}/${INCLUDE_FOLDER}/RoutingReceiver.xml" ${EXECUTABLE_OUTPUT_PATH}/RoutingReceiver.xml)
++ execute_process(
++ COMMAND mkdir -p "${EXECUTABLE_OUTPUT_PATH}"
++ COMMAND cp "${CMAKE_CURRENT_SOURCE_DIR}/${INCLUDE_FOLDER}/RoutingSender.xml" ${EXECUTABLE_OUTPUT_PATH}/RoutingSender.xml)
++ ENDIF(USE_BUILD_LIBS)
++
++
++
++
++ INSTALL(TARGETS PluginRoutingInterfaceDbus
++ DESTINATION lib/${LIB_INSTALL_SUFFIX}/routing
++ PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
++ COMPONENT plugin
++ )
++
++ INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/RoutingReceiver.xml
++ DESTINATION ${AM_SHARE_FOLDER}/${LIB_INSTALL_SUFFIX}
++ COMPONENT plugin
++ )
++
+diff --git a/PluginRoutingInterfaceDbus/cmake/FindAudioManager.cmake b/PluginRoutingInterfaceDbus/cmake/FindAudioManager.cmake
+new file mode 100644
+index 0000000..ad97f23
+--- /dev/null
++++ b/PluginRoutingInterfaceDbus/cmake/FindAudioManager.cmake
+@@ -0,0 +1,31 @@
++find_path(AUDIOMANAGER_CMAKE_CONFIG_PATH
++ audiomanagerConfig.cmake
++ PATH_SUFFIXES audiomanager/cmake
++ PATHS
++ ${CMAKE_INSTALL_PATH}
++ "${CMAKE_INSTALL_PREFIX}/lib"
++ "/usr/lib"
++ "/usr/local/lib"
++ )
++
++find_path(AUDIOMANAGER_INCLUDE_FOLDER
++ audiomanagertypes.h
++ PATH_SUFFIXES audiomanager
++ PATHS
++ ${CMAKE_INSTALL_PATH}
++ "${CMAKE_INSTALL_PREFIX}/include"
++ "/usr/include"
++ "/usr/local/include"
++ )
++
++set( AUDIOMANAGER_FOUND "NO" )
++
++if(AUDIOMANAGER_CMAKE_CONFIG_PATH)
++ set( AUDIOMANAGER_FOUND "YES" )
++ message(STATUS "Found AudioManager cmake config: ${AUDIOMANAGER_CMAKE_CONFIG_PATH}/audiomanagerConfig.cmake")
++endif(AUDIOMANAGER_CMAKE_CONFIG_PATH)
++
++mark_as_advanced(
++ AUDIOMANAGER_CMAKE_CONFIG_PATH
++ AUDIOMANAGER_INCLUDE_FOLDER
++)
+diff --git a/PluginRoutingInterfaceDbus/cmake/config.cmake b/PluginRoutingInterfaceDbus/cmake/config.cmake
+new file mode 100644
+index 0000000..20ce881
+--- /dev/null
++++ b/PluginRoutingInterfaceDbus/cmake/config.cmake
+@@ -0,0 +1,6 @@
++#ifndef _ROUTINGDBUS_CONFIG_H
++#define _ROUTINGDBUS_CONFIG_H
++
++#cmakedefine ROUTING_DBUS_INTROSPECTION_FILE "@ROUTING_DBUS_INTROSPECTION_FILE@"
++
++#endif /* _ROUTINGDBUS_CONFIG_H */
+diff --git a/PluginRoutingInterfaceDbus/include/CAmDbusMessageHandler.h b/PluginRoutingInterfaceDbus/include/CAmDbusMessageHandler.h
+new file mode 100644
+index 0000000..2dcdeb7
+--- /dev/null
++++ b/PluginRoutingInterfaceDbus/include/CAmDbusMessageHandler.h
+@@ -0,0 +1,147 @@
++/**
++ * Copyright (c) copyright 2011-2012 Aricent® Group and its licensors
++ * Copyright (c) 2012 BMW
++ *
++ * \author Sampreeth Ramavana
++ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
++ *
++ * \copyright
++ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction,
++ * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
++ * subject to the following conditions:
++ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
++ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
++ * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
++ *
++ * For further information see http://www.genivi.org/.
++ */
++
++#ifndef _CAMSDBUSMESSAGEHANDLER_H_
++#define _CAMSDBUSMESSAGEHANDLER_H_
++
++
++#include <dbus/dbus.h>
++#include <vector>
++#include <sstream>
++#include <string>
++#include <list>
++#include "audiomanagertypes.h"
++
++namespace am {
++
++
++/**
++ * handles DBus Messages, is used to extract & append parameters and send messages
++ */
++class CAmRoutingDbusMessageHandler
++{
++public:
++ CAmRoutingDbusMessageHandler();
++ ~CAmRoutingDbusMessageHandler();
++
++ /**
++ * sets the DBus Connection
++ * @param connection pointer to the DBus Connection
++ */
++ void setDBusConnection(DBusConnection*& connection);
++
++ /**
++ * is called to initiate the receiving of a message
++ * @param msg pointer to the message to be received
++ */
++ void initReceive(DBusMessage* msg);
++
++ /**
++ * is called to initiate the reply to a message
++ * @param msg pointer to the message the reply is for
++ */
++ void initReply(DBusMessage* msg);
++
++ /**
++ * inits a signal to be sent via dbus
++ * parameters can be added before sending the signal
++ * @param path the path
++ * @param signalName the signal name
++ */
++ void initSignal(std::string path, std::string signalName);
++
++ /**
++ * sends out the message
++ */
++ void sendMessage();
++
++ /**
++ * the get functions return a value from the received dbus message
++ * @return
++ */
++ dbus_uint16_t getUInt();
++ dbus_uint16_t getUInt(DBusMessageIter& iter, bool next);
++ dbus_int16_t getInt();
++ dbus_int16_t getInt(DBusMessageIter& iter, bool next);
++ dbus_int32_t getInt32();
++ dbus_int32_t getInt32(DBusMessageIter& iter, bool next);
++ dbus_bool_t getBool();
++ dbus_bool_t getBool(DBusMessageIter& iter, bool next);
++ char getByte();
++ char getByte(DBusMessageIter& iter, bool next);
++ double getDouble();
++ double getDouble(DBusMessageIter& iter, bool next);
++ char* getString();
++ char* getString(DBusMessageIter& iter, bool next);
++ am_Availability_s getAvailability();
++ std::vector<am::am_EarlyData_s> getEarlyData();
++ am_Domain_s getDomainData();
++ am_Source_s getSourceData();
++ am_Sink_s getSinkData();
++ am_Gateway_s getGatewayData();
++ am_Converter_s getConverterData();
++ am_Crossfader_s getCrossfaderData();
++ am_SoundProperty_s getSoundProperty();
++ am_MainSoundProperty_s getMainSoundProperty();
++ std::vector<am_CustomAvailabilityReason_t> getListconnectionFormats();
++ std::vector<bool> getListBool();
++ std::vector<am_SoundProperty_s> getListSoundProperties();
++ std::vector<am_MainSoundProperty_s> getListMainSoundProperties();
++ am_NotificationPayload_s getNotificationPayload();
++
++
++
++ /**
++ * the overloaded append function appends different datatypes to the dbusmessage
++ */
++ void append(dbus_int16_t toAppend);
++ void append(dbus_uint16_t toAppend);
++ void append(dbus_uint32_t toAppend);
++ void append(char toAppend);
++ void append(bool toAppend);
++ void append(double toAppend);
++ void append(const am::am_Error_e error);
++ void append(const am::am_SinkType_s& sinkType);
++ void append(const am::am_SourceType_s& sourceType);
++ void append(const am::am_MainSoundProperty_s mainSoundProperty);
++ void append(const am::am_Availability_s & availability);
++ void append(const am::am_SystemProperty_s & SystemProperty);
++ void append(const std::vector<am::am_MainConnectionType_s>& listMainConnections);
++ void append(const std::vector<am::am_SinkType_s>& listMainSinks);
++ void append(const std::vector<am::am_SourceType_s>& listMainSources);
++ void append(const std::vector<am::am_MainSoundProperty_s>& listMainSoundProperties);
++ void append(const std::vector<am::am_SourceClass_s>& listSourceClasses);
++ void append(const std::vector<am::am_SinkClass_s>& listSinkClasses);
++ void append(const std::vector<am::am_SystemProperty_s>& listSystemProperties);
++
++private:
++
++ DBusMessageIter mDBusMessageIter;
++ DBusError mDBusError;
++ dbus_uint32_t mSerial;
++ std::string mErrorName;
++ std::string mErrorMsg;
++ DBusMessage* mpDBusMessage;
++ DBusMessage* mpReveiveMessage;
++ DBusConnection* mpDBusConnection;
++};
++
++}
++
++#endif // _CAMSDBUSMESSAGEHANDLER_H_
+diff --git a/PluginRoutingInterfaceDbus/include/CAmDbusSend.h b/PluginRoutingInterfaceDbus/include/CAmDbusSend.h
+new file mode 100644
+index 0000000..b2c4b5b
+--- /dev/null
++++ b/PluginRoutingInterfaceDbus/include/CAmDbusSend.h
+@@ -0,0 +1,55 @@
++/**
++ * Copyright (c) copyright 2011-2012 Aricent® Group and its licensors
++ * Copyright (c) 2012 BMW
++ *
++ * \author Sampreeth Ramavana
++ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
++ *
++ * \copyright
++ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction,
++ * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
++ * subject to the following conditions:
++ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
++ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
++ * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
++ *
++ * For further information see http://www.genivi.org/.
++ */
++
++#ifndef _CAMDBUSSEND_H_
++#define _CAMDBUSSEND_H_
++
++//#include "headers.h"
++#include <dbus/dbus.h>
++#include <string>
++#include <vector>
++#include "audiomanagertypes.h"
++
++namespace am
++{
++
++class CAmRoutingDbusSend
++{
++public:
++ CAmRoutingDbusSend(DBusConnection* conn, std::string bus_name, std::string path, std::string interface, std::string method);
++ virtual ~CAmRoutingDbusSend();
++ void append(std::string string);
++ void append(uint16_t integer);
++ void append(int16_t integer);
++ void append(int integer);
++ void append(std::vector<am_SoundProperty_s> listSoundProperties);
++ void append(am_SoundProperty_s soundProperty);
++ am_Error_e send();
++ am_Error_e sendAsync();
++
++private:
++ DBusMessage* mpDbusMessage;
++ DBusConnection* mpDbusConnection;
++ DBusMessageIter mDbusMessageIter;
++ DBusError mDBusError;
++ dbus_uint32_t mSerial;
++};
++}
++
++#endif /* _CAMDBUSSEND_H_ */
+diff --git a/PluginRoutingInterfaceDbus/include/CAmRoutingSenderDbus.h b/PluginRoutingInterfaceDbus/include/CAmRoutingSenderDbus.h
+new file mode 100644
+index 0000000..3997402
+--- /dev/null
++++ b/PluginRoutingInterfaceDbus/include/CAmRoutingSenderDbus.h
+@@ -0,0 +1,96 @@
++/**
++ * Copyright (c) 2012 BMW
++ *
++ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
++ * \author Aleksandar Donchev, aleksander.donchev@partner.bmw.de BMW 2013
++ *
++ * \copyright
++ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction,
++ * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
++ * subject to the following conditions:
++ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
++ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
++ * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
++ *
++ * For further information see http://www.genivi.org/.
++ */
++
++#ifndef ROUTINGSENDER_H_
++#define ROUTINGSENDER_H_
++
++#include "../../PluginRoutingInterfaceDbus/include/CAmDbusMessageHandler.h"
++#include "../../PluginRoutingInterfaceDbus/include/IAmRoutingReceiverShadow.h"
++#include "IAmRouting.h"
++
++namespace am
++{
++
++#define ROUTING_NODE "routinginterface"
++
++class CAmRoutingSenderDbus: public IAmRoutingSend
++{
++public:
++ CAmRoutingSenderDbus();
++ virtual ~CAmRoutingSenderDbus();
++ am_Error_e startupInterface(IAmRoutingReceive* pIAmRoutingReceive);
++ void setRoutingReady(const uint16_t handle);
++ void setRoutingRundown(const uint16_t handle);
++ am_Error_e asyncAbort(const am_Handle_s handle);
++ am_Error_e asyncConnect(const am_Handle_s handle, const am_connectionID_t connectionID, const am_sourceID_t sourceID, const am_sinkID_t sinkID, const am_CustomAvailabilityReason_t connectionFormat);
++ am_Error_e asyncDisconnect(const am_Handle_s handle, const am_connectionID_t connectionID);
++ am_Error_e asyncSetSinkVolume(const am_Handle_s handle, const am_sinkID_t sinkID, const am_volume_t volume, const am_CustomRampType_t ramp, const am_time_t time);
++ am_Error_e asyncSetSourceVolume(const am_Handle_s handle, const am_sourceID_t sourceID, const am_volume_t volume, const am_CustomRampType_t ramp, const am_time_t time);
++ am_Error_e asyncSetSourceState(const am_Handle_s handle, const am_sourceID_t sourceID, const am_SourceState_e state);
++ am_Error_e asyncSetSinkSoundProperties(const am_Handle_s handle, const am_sinkID_t sinkID, const std::vector<am_SoundProperty_s>& listSoundProperties);
++ am_Error_e asyncSetSinkSoundProperty(const am_Handle_s handle, const am_sinkID_t sinkID, const am_SoundProperty_s& soundProperty);
++ am_Error_e asyncSetSourceSoundProperties(const am_Handle_s handle, const am_sourceID_t sourceID, const std::vector<am_SoundProperty_s>& listSoundProperties);
++ am_Error_e asyncSetSourceSoundProperty(const am_Handle_s handle, const am_sourceID_t sourceID, const am_SoundProperty_s& soundProperty);
++ am_Error_e asyncCrossFade(const am_Handle_s handle, const am_crossfaderID_t crossfaderID, const am_HotSink_e hotSink, const am_CustomRampType_t rampType, const am_time_t time);
++ am_Error_e setDomainState(const am_domainID_t domainID, const am_DomainState_e domainState);
++ am_Error_e returnBusName(std::string& BusName) const;
++ void getInterfaceVersion(std::string& version) const;
++ am_Error_e asyncSetVolumes(const am_Handle_s handle, const std::vector<am_Volumes_s>& listVolumes) ;
++ am_Error_e asyncSetSinkNotificationConfiguration(const am_Handle_s handle, const am_sinkID_t sinkID, const am_NotificationConfiguration_s& notificationConfiguration) ;
++ am_Error_e asyncSetSourceNotificationConfiguration(const am_Handle_s handle, const am_sourceID_t sourceID, const am_NotificationConfiguration_s& notificationConfiguration) ;
++
++ struct rs_lookupData_s
++ {
++ std::string busname;
++ std::string path;
++ std::string interface;
++ };
++
++ void removeHandle(uint16_t handle);
++ void addDomainLookup(am_domainID_t domainID, rs_lookupData_s lookupData);
++ void addSourceLookup(am_sourceID_t sourceID, am_domainID_t domainID);
++ void addSinkLookup(am_sinkID_t sinkID, am_domainID_t domainID);
++ void removeDomainLookup(am_domainID_t domainID);
++ void removeSourceLookup(am_sourceID_t sourceID);
++ void removeSinkLookup(am_sinkID_t sinkID);
++
++private:
++ CAmDbusWrapper* mpCAmDBusWrapper;
++ IAmRoutingReceive *mpIAmRoutingReceive;
++ DBusConnection* mpDBusConnection;
++ CAmRoutingDbusMessageHandler mCAmRoutingDBusMessageHandler;
++ IAmRoutingReceiverShadowDbus mIAmRoutingReceiverShadowDbus;
++
++ typedef std::map<am_domainID_t,rs_lookupData_s> mapDomain_t;
++ typedef std::map<am_sinkID_t,rs_lookupData_s> mapSinks_t;
++ typedef std::map<am_sourceID_t,rs_lookupData_s> mapSources_t;
++ typedef std::map<am_connectionID_t,rs_lookupData_s> mapConnections_t;
++ typedef std::map<uint16_t,rs_lookupData_s> mapHandles_t;
++
++ template <typename TKey> static void removeEntriesForValue(const rs_lookupData_s & value, std::map<TKey,rs_lookupData_s> & map);
++
++ mapDomain_t mMapDomains;
++ mapSinks_t mMapSinks;
++ mapSources_t mMapSources;
++ mapConnections_t mMapConnections;
++ mapHandles_t mMapHandles;
++
++};
++}
++
++#endif /* ROUTINGSENDER_H_ */
+diff --git a/PluginRoutingInterfaceDbus/include/IAmRoutingReceiverShadow.h b/PluginRoutingInterfaceDbus/include/IAmRoutingReceiverShadow.h
+new file mode 100644
+index 0000000..c460775
+--- /dev/null
++++ b/PluginRoutingInterfaceDbus/include/IAmRoutingReceiverShadow.h
+@@ -0,0 +1,143 @@
++/**
++ * Copyright (c) copyright 2011-2012 Aricent® Group and its licensors
++ * Copyright (c) 2012 BMW
++ *
++ * \author Sampreeth Ramavana
++ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
++ *
++ * \copyright
++ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction,
++ * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
++ * subject to the following conditions:
++ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
++ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
++ * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
++ *
++ * For further information see http://www.genivi.org/.
++ */
++
++#ifndef _IAMROUTINGRECEIVERSHADOW_H_
++#define _IAMROUTINGRECEIVERSHADOW_H_
++
++#include <dbus/dbus.h>
++#include <map>
++
++#include "../../PluginRoutingInterfaceDbus/include/CAmDbusMessageHandler.h"
++
++namespace am {
++
++class CAmRoutingSenderDbus;
++class IAmRoutingReceive;
++class CAmDbusWrapper;
++
++/**
++ * receives the DBus Callbacks, marhsalls and demarshalls the parameters and calls CommandReceive
++ */
++class IAmRoutingReceiverShadowDbus
++{
++public:
++ IAmRoutingReceiverShadowDbus(CAmRoutingSenderDbus* pRoutingSenderDbus);
++ virtual ~IAmRoutingReceiverShadowDbus();
++ void ackConnect(DBusConnection *conn, DBusMessage *msg);
++ void ackDisconnect(DBusConnection *conn, DBusMessage *msg);
++ void ackSetSinkVolume(DBusConnection *conn, DBusMessage *msg);
++ void ackSetSourceVolume(DBusConnection *conn, DBusMessage *msg);
++ void ackSetSourceState(DBusConnection *conn, DBusMessage *msg);
++ void ackSinkVolumeTick(DBusConnection *conn, DBusMessage *msg);
++ void ackSourceVolumeTick(DBusConnection *conn, DBusMessage *msg);
++ void ackSetSinkSoundProperty(DBusConnection *conn, DBusMessage *msg);
++ void ackSetSourceSoundProperty(DBusConnection *conn, DBusMessage *msg);
++ void ackSetSinkSoundProperties(DBusConnection *conn, DBusMessage *msg);
++ void ackSetSourceSoundProperties(DBusConnection *conn, DBusMessage *msg);
++ void ackCrossFading(DBusConnection *conn, DBusMessage *msg);
++ void registerDomain(DBusConnection *conn, DBusMessage *msg);
++ void registerSource(DBusConnection *conn, DBusMessage *msg);
++ void registerSink(DBusConnection *conn, DBusMessage *msg);
++ void registerGateway(DBusConnection *conn, DBusMessage *msg);
++ void registerConverter(DBusConnection *conn, DBusMessage *msg);
++ void peekDomain(DBusConnection *conn, DBusMessage *msg);
++ void deregisterDomain(DBusConnection *conn, DBusMessage *msg);
++ void deregisterGateway(DBusConnection *conn, DBusMessage *msg);
++ void deregisterConverter(DBusConnection *conn, DBusMessage *msg);
++ void peekSink(DBusConnection *conn, DBusMessage *msg);
++ void deregisterSink(DBusConnection *conn, DBusMessage *msg);
++ void peekSource(DBusConnection *conn, DBusMessage *msg);
++ void deregisterSource(DBusConnection *conn, DBusMessage *msg);
++ void registerCrossfader(DBusConnection *conn, DBusMessage *msg);
++ void deregisterCrossfader(DBusConnection *conn, DBusMessage *msg);
++ void peekSourceClassID(DBusConnection *conn, DBusMessage *msg);
++ void peekSinkClassID(DBusConnection *conn, DBusMessage *msg);
++ void hookInterruptStatusChange(DBusConnection *conn, DBusMessage *msg);
++ void hookDomainRegistrationComplete(DBusConnection *conn, DBusMessage *msg);
++ void hookSinkAvailablityStatusChange(DBusConnection *conn, DBusMessage *msg);
++ void hookSourceAvailablityStatusChange(DBusConnection *conn, DBusMessage *msg);
++ void hookDomainStateChange(DBusConnection *conn, DBusMessage *msg);
++ void hookTimingInformationChanged(DBusConnection *conn, DBusMessage *msg);
++ void sendChangedData(DBusConnection *conn, DBusMessage *msg);
++ void confirmRoutingReady(DBusConnection *conn, DBusMessage *msg);
++ void confirmRoutingRundown(DBusConnection *conn, DBusMessage *msg);
++ void updateGateway(DBusConnection *conn, DBusMessage *msg);
++ void updateConverter(DBusConnection *conn, DBusMessage *msg);
++ void updateSink(DBusConnection *conn, DBusMessage *msg);
++ void updateSource(DBusConnection *conn, DBusMessage *msg);
++ void ackSetVolumes(DBusConnection *conn, DBusMessage *msg);
++ void ackSinkNotificationConfiguration(DBusConnection *conn, DBusMessage *msg);
++ void ackSourceNotificationConfiguration(DBusConnection *conn, DBusMessage *msg);
++ void hookSinkNotificationDataChange(DBusConnection *conn, DBusMessage *msg);
++ void hookSourceNotificationDataChange(DBusConnection *conn, DBusMessage *msg);
++ void getRoutingReadyStatus(DBusConnection* conn, DBusMessage* msg);
++
++ /**
++ * sets the pointer to the CommandReceiveInterface and registers Callback
++ * @param receiver
++ */
++ void setRoutingReceiver(IAmRoutingReceive*& receiver);
++
++ void gotReady(int16_t numberDomains, uint16_t handle);
++ void gotRundown(int16_t numberDomains, uint16_t handle);
++
++private:
++ typedef void (IAmRoutingReceiverShadowDbus::*CallBackMethod)(DBusConnection *connection, DBusMessage *message);
++ IAmRoutingReceive* mRoutingReceiveInterface;
++ CAmDbusWrapper* mDBusWrapper;
++ CAmRoutingSenderDbus* mpRoutingSenderDbus;
++
++ typedef std::map<std::string, CallBackMethod> functionMap_t;
++ functionMap_t mFunctionMap;
++ CAmRoutingDbusMessageHandler mDBUSMessageHandler;
++ int16_t mNumberDomains;
++ uint16_t mHandle;
++ bool mRoutingReady;
++
++ /**
++ * receives a callback whenever the path of the plugin is called
++ */
++ static DBusHandlerResult receiveCallback(DBusConnection *conn, DBusMessage *msg, void *user_data);
++
++ /**
++ * dynamic delegate that handles the Callback of the static receiveCallback
++ * @param conn DBus connection
++ * @param msg DBus message
++ * @param user_data pointer to instance of IAmRoutingReceiverShadow
++ * @return
++ */
++ DBusHandlerResult receiveCallbackDelegate(DBusConnection *conn, DBusMessage *msg);
++
++ /**
++ * sends out introspectiondata read from an xml file.
++ * @param conn
++ * @param msg
++ */
++ void sendIntrospection(DBusConnection* conn, DBusMessage* msg);
++
++ /**
++ * creates the function map needed to combine DBus messages and function adresses
++ * @return the map
++ */
++ functionMap_t createMap();
++};
++
++}
++
++#endif /* _IAMROUTINGRECEIVERSHADOW_H_ */
+diff --git a/PluginRoutingInterfaceDbus/include/RoutingReceiver.xml b/PluginRoutingInterfaceDbus/include/RoutingReceiver.xml
+new file mode 100644
+index 0000000..8e15bb1
+--- /dev/null
++++ b/PluginRoutingInterfaceDbus/include/RoutingReceiver.xml
+@@ -0,0 +1,237 @@
++<?xml version="1.0" encoding="UTF-8" ?>
++<!DOCTYPE node PUBLIC
++ "-//freedesktop//DTD D-Bus Object Introspection 1.0//EN"
++ "http://standards.freedesktop.org/dbus/1.0/introspect.dtd">
++
++<node>
++ <interface name="org.genivi.audiomanager.routinginterface">
++ <method name="ackConnect">
++ <arg name="handle" type="q" direction="in" />
++ <arg name="connectionID" type="q" direction="in" />
++ <arg name="error" type="q" direction="in" />
++ </method>
++ <method name="ackDisconnect">
++ <arg name="handle" type="q" direction="in" />
++ <arg name="connectionID" type="q" direction="in" />
++ <arg name="error" type="q" direction="in" />
++ </method>
++ <method name="ackSetSinkVolume">
++ <arg name="handle" type="q" direction="in" />
++ <arg name="volume" type="n" direction="in" />
++ <arg name="error" type="q" direction="in" />
++ </method>
++ <method name="ackSetSourceVolume">
++ <arg name="handle" type="q" direction="in" />
++ <arg name="volume" type="n" direction="in" />
++ <arg name="error" type="q" direction="in" />
++ </method>
++ <method name="ackSetSourceState">
++ <arg name="handle" type="q" direction="in" />
++ <arg name="error" type="q" direction="in" />
++ </method>
++ <method name="ackSetSinkSoundProperties">
++ <arg name="handle" type="q" direction="in" />
++ <arg name="error" type="q" direction="in" />
++ </method>
++ <method name="ackSetSinkSoundProperty">
++ <arg name="handle" type="q" direction="in" />
++ <arg name="error" type="q" direction="in" />
++ </method>
++ <method name="ackSetSourceSoundProperties">
++ <arg name="handle" type="q" direction="in" />
++ <arg name="error" type="q" direction="in" />
++ </method>
++ <method name="ackSetSourceSoundProperty">
++ <arg name="handle" type="q" direction="in" />
++ <arg name="error" type="q" direction="in" />
++ </method>
++ <method name="ackCrossFading">
++ <arg name="handle" type="q" direction="in" />
++ <arg name="hotsink" type="n" direction="in" />
++ <arg name="error" type="q" direction="in" />
++ </method>
++ <method name="ackSourceVolumeTick">
++ <arg name="handle" type="q" direction="in" />
++ <arg name="source" type="q" direction="in" />
++ <arg name="volume" type="n" direction="in" />
++ </method>
++ <method name="ackSinkVolumeTick">
++ <arg name="handle" type="q" direction="in" />
++ <arg name="sink" type="q" direction="in" />
++ <arg name="volume" type="n" direction="in" />
++ </method>
++ <method name="peekDomain">
++ <arg name="name" type="s" direction="in" />
++ <arg name="domainid" type="q" direction="out" />
++ <arg name="error" type="q" direction="out" />
++ </method>
++ <method name="registerDomain">
++ <arg name="domaindata" type="(qsssbbn)" direction="in" /> <!-- am_domainID_t domainID; std::string name; std::string busname; std::string nodename; bool early; bool complete; am_DomainState_e state; -->
++ <arg name="returnBusname" type="s" direction="in" /> <!-- the busname for all communication to this domain -->
++ <arg name="returnPath" type="s" direction="in" /> <!-- the path for all communication to this domain -->
++ <arg name="returnInterface" type="s" direction="in" /> <!-- the interface for all communication to this domain -->
++ <arg name="domainid" type="q" direction="out" />
++ <arg name="error" type="q" direction="out" />
++ </method>
++<!--check the parameters-->
++ <method name="deregisterDomain">
++ <arg name="handle" type="q" direction="in" />
++ <arg name="error" type="q" direction="in" />
++ <arg name="domainid" type="q" direction="in" />
++ <arg name="error" type="q" direction="out" />
++ </method>
++ <method name="registerGateway">
++ <arg name="gatewayData" type="(qsqqqqqaiaiab)" direction="in" /> <!-- am_gatewayID_t gatewayID; std::string name; am_sinkID_t sinkID; am_sourceID_t sourceID; am_domainID_t domainSinkID; am_domainID_t domainSourceID; am_domainID_t controlDomainID; std::vector<am_CustomAvailabilityReason_t> listSourceFormats; std::vector<am_CustomAvailabilityReason_t> listSinkFormats; std::vector<bool> convertionMatrix; -->
++ <arg name="gatewayID" type="q" direction="out" />
++ <arg name="error" type="q" direction="out" />
++ </method>
++ <method name="registerConverter">
++ <arg name="converterData" type="(qsqqqaiaiab)" direction="in" /> <!-- am_converterID_t converterID; std::string name; am_sinkID_t sinkID; am_sourceID_t sourceID; am_domainID_t domainID; std::vector<am_CustomAvailabilityReason_t> listSourceFormats; std::vector<am_CustomAvailabilityReason_t> listSinkFormats; std::vector<bool> convertionMatrix; -->
++ <arg name="converterID" type="q" direction="out" />
++ <arg name="error" type="q" direction="out" />
++ </method>
++ <method name="deregisterGateway">
++ <arg name="gatewayID" type="q" direction="in" />
++ <arg name="error" type="q" direction="out" />
++ </method>
++ <method name="deregisterConverter">
++ <arg name="converterID" type="q" direction="in" />
++ <arg name="error" type="q" direction="out" />
++ </method>
++ <method name="peekSink">
++ <arg name="name" type="s" direction="in" />
++ <arg name="sinkID" type="q" direction="out" />
++ <arg name="error" type="q" direction="out" />
++ </method>
++ <method name="registerSink">
++ <arg name="sinkData" type="(qsqinb(ii)nna(in)aia(in)a(iin)a(iin))" direction="in" /> <!-- am_sinkID_t sinkID; std::string name; am_domainID_t domainID; am_sinkClass_t sinkClassID; am_volume_t volume; bool visible; am_Availability_s available; am_MuteState_e muteState;am_mainVolume_t mainVolume; std::vector<am_SoundProperty_s> listSoundProperties; std::vector<am_CustomAvailabilityReason_t> listConnectionFormats; std::vector<am_MainSoundProperty_s> listMainSoundProperties; -->
++ <arg name="sinkID" type="q" direction="out" />
++ <arg name="error" type="q" direction="out" />
++ </method>
++ <method name="deregisterSink">
++ <arg name="sinkID" type="q" direction="in" />
++ <arg name="error" type="i" direction="out" />
++ </method>
++ <method name="peekSource">
++ <arg name="name" type="s" direction="in" />
++ <arg name="sourceID" type="q" direction="out" />
++ <arg name="error" type="q" direction="out" />
++ </method>
++ <method name="registerSource">
++ <arg name="sourceData" type="(qqsqinb(ii)qa(in)aia(in)a(iin)a(iin))" direction="in" /> <!-- am_sourceID_t sourceID; am_domainID_t domainID; std::string name; am_sourceClass_t sourceClassID; am_SourceState_e sourceState; am_volume_t volume; bool visible; am_Availability_s available; am_InterruptState_e interruptState; std::vector<am_SoundProperty_s> listSoundProperties; std::vector<am_CustomAvailabilityReason_t> listConnectionFormats; std::vector<am_MainSoundProperty_s> listMainSoundProperties; -->
++ <arg name="sourceID" type="q" direction="out" />
++ <arg name="error" type="q" direction="out" />
++ </method>
++ <method name="deregisterSource">
++ <arg name="sourceid" type="q" direction="in" />
++ <arg name="error" type="q" direction="out" />
++ </method>
++ <method name="registerCrossfader">
++ <arg name="crossfaderData" type="(qsqqqq)" direction="in" /> <!-- am_crossfaderID_t crossfaderID; std::string name; am_sinkID_t sinkID_A; am_sinkID_t sinkID_B; am_sourceID_t sourceID; am_HotSink_e hotSink; -->
++ <arg name="crossfaderID" type="q" direction="out" />
++ <arg name="error" type="q" direction="out" />
++ </method>
++ <method name="deregisterCrossfader">
++ <arg name="crossfaderID" type="q" direction="in" />
++ <arg name="error" type="q" direction="out" />
++ </method>
++ <method name="peekSourceClassID">
++ <arg name="name" type="s" direction="in" />
++ <arg name="sourceClassID" type="q" direction="out" />
++ <arg name="error" type="q" direction="out" />
++ </method>
++ <method name="peekSinkClassID">
++ <arg name="name" type="s" direction="in" />
++ <arg name="sinkClassID" type="q" direction="out" />
++ <arg name="error" type="q" direction="out" />
++ </method>
++ <method name="hookInterruptStatusChange">
++ <arg name="sourceID" type="q" direction="in" />
++ <arg name="interruptState" type="q" direction="in" />
++ </method>
++ <method name="hookDomainRegistrationComplete">
++ <arg name="domainID" type="q" direction="in" />
++ </method>
++ <method name="hookSinkAvailablityStatusChange">
++ <arg name="sinkID" type="q" direction="in" />
++ <arg name="availability" type="(nn)" direction="in"/>
++ </method>
++ <method name="hookSourceAvailablityStatusChange">
++ <arg name="sourceID" type="q" direction="in" />
++ <arg name="availability" type="(nn)" direction="in"/>
++ </method>
++ <method name="hookDomainStateChange">
++ <arg name="domainID" type="q" direction="in" />
++ <arg name="domainState" type="q" direction="in"/>
++ </method>
++ <method name="hookTimingInformationChanged">
++ <arg name="connectionID" type="q" direction="in" />
++ <arg name="delay" type="n" direction="in"/>
++ </method>
++ <method name="sendChangedData"> <!--am_EarlyDataType_e type; am_DataType_u sinksource; am_EarlyData_u data; -->
++ <arg name="earlyData_volumes" type="a(qqn)" direction="in" /> <!-- only the volumes as array -->
++ <arg name="earlyData_soundproperties" type="a(qq(nn))" direction="in" /> <!--only the soundproperties as value -->
++ </method>
++ <method name="confirmRoutingReady">
++ <arg name="domainID" type="q" direction="in" />
++ </method>
++ <method name="confirmRoutingRundown">
++ <arg name="domainID" type="q" direction="in" />
++ </method>
++ <method name="updateGateway">
++ <arg name="gatewayID" type="q" direction="in" />
++ <arg name="listSourceFormats" type="a(q)" direction="in" />
++ <arg name="listSinkFormats" type="a(q)" direction="in" />
++ <arg name="conversionMatrix" type="a(b)" direction="in" />
++ </method>
++ <method name="updateConverter">
++ <arg name="converterID" type="q" direction="in" />
++ <arg name="listSourceFormats" type="a(q)" direction="in" />
++ <arg name="listSinkFormats" type="a(q)" direction="in" />
++ <arg name="conversionMatrix" type="a(b)" direction="in" />
++ </method>
++ <method name="updateSink">
++ <arg name="sinkID" type="q" direction="in" />
++ <arg name="sinkClassID" type="q" direction="in" />
++ <arg name="listSoundProperties" type="a(nn)" direction="in" />
++ <arg name="listConnectionFormats" type="a(q)" direction="in" />
++ <arg name="listMainSoundProperties" type="a(nn)" direction="in" />
++ </method>
++ <method name="updateSource">
++ <arg name="sourceID" type="q" direction="in" />
++ <arg name="sourceClassID" type="q" direction="in" />
++ <arg name="listSoundProperties" type="a(nn)" direction="in" />
++ <arg name="listConnectionFormats" type="a(q)" direction="in" />
++ <arg name="listMainSoundProperties" type="a(nn)" direction="in" />
++ </method>
++ <method name="ackSetVolumes">
++ <arg name="handle" type="q" direction="in" />
++ <arg name="listvolumes" type="a(nqqnq)" direction="in" />
++ <arg name="error" type="q" direction="in" />
++ </method>
++ <method name="ackSinkNotificationConfiguration">
++ <arg name="handle" type="q" direction="in" />
++ <arg name="error" type="q" direction="in" />
++ </method>
++ <method name="ackSourceNotificationConfiguration">
++ <arg name="handle" type="q" direction="in" />
++ <arg name="error" type="q" direction="in" />
++ </method>
++ <method name="hookSinkNotificationDataChange">
++ <arg name="sinkID" type="q" direction="in" />
++ <arg name="payload" type="(nn)" direction="in" />
++ </method>
++ <method name="hookSourceNotificationDataChange">
++ <arg name="sourceID" type="q" direction="in" />
++ <arg name="payload" type="(nn)" direction="in" />
++ </method>
++ <method name='getRoutingReadyState'>
++ <arg name='state' type='b' direction='out' />
++ </method>
++
++ <signal name="setRoutingReady">
++ </signal>
++ <signal name="setRoutingRundown">
++ </signal>
++ </interface>
++</node>
+diff --git a/PluginRoutingInterfaceDbus/include/RoutingSender.xml b/PluginRoutingInterfaceDbus/include/RoutingSender.xml
+new file mode 100644
+index 0000000..133a6fe
+--- /dev/null
++++ b/PluginRoutingInterfaceDbus/include/RoutingSender.xml
+@@ -0,0 +1,76 @@
++<?xml version="1.0" encoding="UTF-8" ?>
++<!DOCTYPE node PUBLIC
++ "-//freedesktop//DTD D-Bus Object Introspection 1.0//EN"
++ "http://standards.freedesktop.org/dbus/1.0/introspect.dtd">
++
++<node>
++ <interface name='org.pulseaudio.genivi.routingsend'>
++ <method name='asyncAbort'>
++ <arg name='handle' type='q' direction='in' />
++ <arg name='error' type='n' direction='out' />
++ </method>
++ <method name='asyncConnect'>
++ <arg name='handle' type='q' direction='in' />
++ <arg name='connectionID' type='q' direction='in' />
++ <arg name='sourceID' type='q' direction='in' />
++ <arg name='sinkID' type='q' direction='in' />
++ <arg name='connectionFormat' type='i' direction='in' />
++ </method>
++ <method name='asyncDisconnect'>
++ <arg name='handle' type='q' direction='in' />
++ <arg name='connectionID' type='q' direction='in' />
++ </method>
++ <method name='asyncSetSinkVolume'>
++ <arg name='handle' type='q' direction='in' />
++ <arg name='sinkID' type='q' direction='in' />
++ <arg name='volume' type='n' direction='in' />
++ <arg name='ramp' type='n' direction='in' />
++ <arg name='time' type='q' direction='in' />
++ </method>
++ <method name='asyncSetSourceVolume'>
++ <arg name='handle' type='q' direction='in' />
++ <arg name='sourceID' type='q' direction='in' />
++ <arg name='volume' type='n' direction='in' />
++ <arg name='ramp' type='n' direction='in' />
++ <arg name='time' type='q' direction='in' />
++ </method>
++ <method name='asyncSetSourceState'>
++ <arg name='handle' type='q' direction='in' />
++ <arg name='sourceID' type='q' direction='in' />
++ <arg name='sourceState' type='i' direction='in' />
++ </method>
++ <method name='asyncSetSinkSoundProperties'>
++ <arg name='handle' type='q' direction='in' />
++ <arg name='sinkID' type='q' direction='in' />
++ <arg name='listSoundProperties' type='a(nn)' direction='in' />
++ </method>
++ <method name='asyncSetSinkSoundProperty'>
++ <arg name='handle' type='q' direction='in' />
++ <arg name='sinkID' type='q' direction='in' />
++ <arg name='soundProperty' type='(nn)' direction='in' />
++ </method>
++ <method name='asyncSetSourceSoundProperty'>
++ <arg name='handle' type='q' direction='in' />
++ <arg name='sourceID' type='q' direction='in' />
++ <arg name='soundProperty' type='(nn)' direction='in' />
++ </method>
++ <method name='asyncSetSourceSoundProperties'>
++ <arg name='handle' type='q' direction='in' />
++ <arg name='sourceID' type='q' direction='in' />
++ <arg name='listSoundProperties' type='a(nn)' direction='in' />
++ </method>
++ <method name='asyncCrossFade'>
++ <arg name='handle' type='q' direction='in' />
++ <arg name='crossfaderID' type='q' direction='in' />
++ <arg name='hotSink' type='q' direction='in' />
++ <arg name='rampType' type='q' direction='in' />
++ <arg name='time' type='q' direction='in' />
++ </method>
++ <method name='setDomainState'>
++ <arg name='domainID' type='q' direction='in' />
++ <arg name='domainState' type='q' direction='in' />
++ <arg name='error' type='i' direction='out' />
++ </method>
++
++ </interface>
++</node>
+diff --git a/PluginRoutingInterfaceDbus/include/configRoutingDbus.h b/PluginRoutingInterfaceDbus/include/configRoutingDbus.h
+new file mode 100644
+index 0000000..29e657b
+--- /dev/null
++++ b/PluginRoutingInterfaceDbus/include/configRoutingDbus.h
+@@ -0,0 +1,6 @@
++#ifndef _ROUTINGDBUS_CONFIG_H
++#define _ROUTINGDBUS_CONFIG_H
++
++#define ROUTING_DBUS_INTROSPECTION_FILE "/usr/local/share/audiomanager/audiomanager/RoutingReceiver.xml"
++
++#endif /* _ROUTINGDBUS_CONFIG_H */
+diff --git a/PluginRoutingInterfaceDbus/src/CAmDbusMessageHandler.cpp b/PluginRoutingInterfaceDbus/src/CAmDbusMessageHandler.cpp
+new file mode 100644
+index 0000000..f3a0682
+--- /dev/null
++++ b/PluginRoutingInterfaceDbus/src/CAmDbusMessageHandler.cpp
+@@ -0,0 +1,1194 @@
++/**
++ * Copyright (c) copyright 2011-2012 Aricent® Group and its licensors
++ * Copyright (c) 2012 BMW
++ *
++ * \author Sampreeth Ramavana
++ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
++ *
++ * \copyright
++ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction,
++ * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
++ * subject to the following conditions:
++ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
++ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
++ * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
++ *
++ * For further information see http://www.genivi.org/.
++ */
++
++#include "CAmDbusMessageHandler.h"
++#include "audiomanagerconfig.h"
++#include <cstdlib>
++#include <cassert>
++#include <vector>
++#include "CAmRoutingSenderDbus.h"
++#include "CAmDltWrapper.h"
++
++namespace am
++{
++
++DLT_IMPORT_CONTEXT(routingDbus)
++
++CAmRoutingDbusMessageHandler::CAmRoutingDbusMessageHandler() :
++ mDBusMessageIter(), //
++ mDBusError(), //
++ mSerial(0), //
++ mErrorName(""), //
++ mErrorMsg(""), //
++ mpDBusMessage(NULL), //
++ mpReveiveMessage(NULL), //
++ mpDBusConnection(NULL)
++{
++ //CAmDltWrapper::instance()->registerContext(routingDbus, "DRS", "DBus Plugin");
++ log(&routingDbus, DLT_LOG_INFO, "DBusMessageHandler constructed");
++}
++
++CAmRoutingDbusMessageHandler::~CAmRoutingDbusMessageHandler()
++{
++ log(&routingDbus, DLT_LOG_INFO, "DBUSMessageHandler destructed");
++}
++
++void CAmRoutingDbusMessageHandler::initReceive(DBusMessage* msg)
++{
++ assert(msg!=NULL);
++ mpReveiveMessage = msg;
++ if (!dbus_message_iter_init(msg, &mDBusMessageIter))
++ {
++ log(&routingDbus, DLT_LOG_INFO, "DBusMessageHandler::initReceive DBus Message has no arguments!");
++ mErrorName = std::string(DBUS_ERROR_INVALID_ARGS);
++ mErrorMsg = "DBUS Message has no arguments!";
++ }
++}
++
++void CAmRoutingDbusMessageHandler::initReply(DBusMessage* msg)
++{
++ assert(msg!=NULL);
++ mpDBusMessage = dbus_message_new_method_return(msg);
++ if (mpDBusMessage == NULL)
++ {
++ log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::initReply Cannot allocate DBus message!");
++ mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
++ mErrorMsg = "Cannot create reply!";
++ }
++ dbus_message_iter_init_append(mpDBusMessage, &mDBusMessageIter);
++}
++
++void CAmRoutingDbusMessageHandler::initSignal(std::string path, std::string signalName)
++{
++ assert(!path.empty());
++ assert(!signalName.empty());
++ std::string completePath = std::string(DBUS_SERVICE_OBJECT_PATH) + "/" + path;
++ std::string completeInterface = std::string(DBUS_SERVICE_PREFIX) + "." + ROUTING_NODE;
++ mpDBusMessage = dbus_message_new_signal(completePath.c_str(), completeInterface.c_str(), signalName.c_str());
++
++ if (mpDBusMessage == NULL)
++ {
++ log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::initSignal Cannot allocate DBus message!");
++ }
++ dbus_message_iter_init_append(mpDBusMessage, &mDBusMessageIter);
++}
++
++void CAmRoutingDbusMessageHandler::sendMessage()
++{
++ assert(mpDBusConnection!=NULL);
++ if (mpReveiveMessage != 0)
++ {
++ mSerial = dbus_message_get_serial(mpReveiveMessage);
++ }
++ else
++ {
++ mSerial = 1;
++ }
++ if (!mErrorName.empty())
++ {
++ mpDBusMessage = dbus_message_new_error(mpReveiveMessage, mErrorName.c_str(), mErrorMsg.c_str());
++ }
++ if (!dbus_connection_send(mpDBusConnection, mpDBusMessage, &mSerial))
++ {
++ log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::sendMessage cannot send message!");
++ }
++ dbus_connection_flush(mpDBusConnection);
++ dbus_message_unref(mpDBusMessage);
++ mpDBusMessage = NULL;
++}
++
++char* CAmRoutingDbusMessageHandler::getString(DBusMessageIter& iter, bool next)
++{
++ char* param = NULL;
++
++ if (DBUS_TYPE_STRING != dbus_message_iter_get_arg_type(&iter))
++ {
++ log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::getString DBUS handler argument is no String!");
++ mErrorName = std::string(DBUS_ERROR_INVALID_ARGS);
++ mErrorMsg = "DBus argument is no string";
++ }
++ else
++ {
++ dbus_message_iter_get_basic(&iter, &param);
++ if (next)
++ dbus_message_iter_next(&iter);
++ }
++ return (param);
++}
++
++char* CAmRoutingDbusMessageHandler::getString()
++{
++ return (getString(mDBusMessageIter, true));
++}
++
++dbus_bool_t CAmRoutingDbusMessageHandler::getBool(DBusMessageIter& iter, bool next)
++{
++ dbus_bool_t boolparam = false;
++
++ if (DBUS_TYPE_BOOLEAN != dbus_message_iter_get_arg_type(&iter))
++ {
++ log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::getBool DBUS handler argument is no bool!");
++ mErrorName = std::string(DBUS_ERROR_INVALID_ARGS);
++ mErrorMsg = "DBus argument is no bool";
++ }
++ else
++ {
++ dbus_message_iter_get_basic(&iter, &boolparam);
++ if (next)
++ dbus_message_iter_next(&iter);
++ }
++ return (boolparam);
++}
++
++dbus_bool_t CAmRoutingDbusMessageHandler::getBool()
++{
++ return (getBool(mDBusMessageIter, true));
++}
++
++char CAmRoutingDbusMessageHandler::getByte(DBusMessageIter& iter, bool next)
++{
++ char param(0);
++
++ if (DBUS_TYPE_BYTE != dbus_message_iter_get_arg_type(&iter))
++ {
++ log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::getByte DBUS handler argument is no byte!");
++ mErrorName = std::string(DBUS_ERROR_INVALID_ARGS);
++ mErrorMsg = "DBus argument is no byte";
++ }
++ else
++ {
++ dbus_message_iter_get_basic(&iter, &param);
++ if (next)
++ dbus_message_iter_next(&iter);
++ }
++ return (param);
++}
++
++char CAmRoutingDbusMessageHandler::getByte()
++{
++ return (getByte(mDBusMessageIter, true));
++}
++
++dbus_uint16_t CAmRoutingDbusMessageHandler::getUInt(DBusMessageIter& iter, bool next)
++{
++ dbus_uint16_t param(0);
++#ifdef GLIB_DBUS_TYPES_TOLERANT
++ if (DBUS_TYPE_UINT16 != dbus_message_iter_get_arg_type(&iter) && DBUS_TYPE_UINT32 != dbus_message_iter_get_arg_type(&iter))
++#else
++ if (DBUS_TYPE_UINT16 != dbus_message_iter_get_arg_type(&iter))
++#endif
++ {
++ log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::getUInt DBUS handler argument is no uint16_t!");
++ mErrorName = std::string(DBUS_ERROR_INVALID_ARGS);
++ mErrorMsg = "DBus argument is no uint16_t";
++ }
++ else
++ {
++ dbus_message_iter_get_basic(&iter, &param);
++ if (next)
++ dbus_message_iter_next(&iter);
++ }
++ return (param);
++}
++
++dbus_uint16_t CAmRoutingDbusMessageHandler::getUInt()
++{
++ return (getUInt(mDBusMessageIter, true));
++}
++
++dbus_int16_t CAmRoutingDbusMessageHandler::getInt(DBusMessageIter& iter, bool next)
++{
++ dbus_int16_t param(0);
++#ifdef GLIB_DBUS_TYPES_TOLERANT
++ if (DBUS_TYPE_INT16 != dbus_message_iter_get_arg_type(&iter) && DBUS_TYPE_INT32 != dbus_message_iter_get_arg_type(&iter))
++#else
++ if (DBUS_TYPE_INT16 != dbus_message_iter_get_arg_type(&iter))
++#endif
++ {
++ log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::getInt DBUS handler argument is no int16_t!");
++ mErrorName = std::string(DBUS_ERROR_INVALID_ARGS);
++ mErrorMsg = "DBus argument is no int16_t";
++ }
++ else
++ {
++ dbus_message_iter_get_basic(&iter, &param);
++ if (next)
++ dbus_message_iter_next(&iter);
++ }
++ return (param);
++}
++
++dbus_int16_t CAmRoutingDbusMessageHandler::getInt()
++{
++ return (getInt(mDBusMessageIter, true));
++}
++
++double CAmRoutingDbusMessageHandler::getDouble(DBusMessageIter& iter, bool next)
++{
++ double param(0);
++ if (DBUS_TYPE_DOUBLE != dbus_message_iter_get_arg_type(&iter))
++ {
++ log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::getDouble DBUS handler argument is no double!");
++ mErrorName = std::string(DBUS_ERROR_INVALID_ARGS);
++ mErrorMsg = "DBus argument is no double";
++ }
++ else
++ {
++ dbus_message_iter_get_basic(&iter, &param);
++ if (next)
++ dbus_message_iter_next(&iter);
++ }
++ return (param);
++}
++
++double CAmRoutingDbusMessageHandler::getDouble()
++{
++ return (getDouble(mDBusMessageIter, true));
++}
++
++am_Availability_s CAmRoutingDbusMessageHandler::getAvailability()
++{
++ am::am_Availability_s availability;
++ availability.availability=A_UNKNOWN;
++ availability.availabilityReason=AR_UNKNOWN;
++ if (DBUS_TYPE_STRUCT != dbus_message_iter_get_arg_type(&mDBusMessageIter))
++ {
++ log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::getAvailability DBUS handler argument is no struct!");
++ mErrorName = std::string(DBUS_ERROR_INVALID_ARGS);
++ mErrorMsg = "DBus argument is no struct";
++ }
++ else
++ {
++ DBusMessageIter structIter;
++ dbus_message_iter_recurse(&mDBusMessageIter, &structIter);
++ availability.availability = static_cast<am_Availability_e>(getInt(structIter, true));
++ availability.availabilityReason = static_cast<am_CustomAvailabilityReason_t>(getInt(structIter, false));
++ dbus_message_iter_next(&mDBusMessageIter);
++ }
++ return (availability);
++}
++
++std::vector<am_EarlyData_s> CAmRoutingDbusMessageHandler::getEarlyData()
++{
++ std::vector<am_EarlyData_s> listEarlyData;
++ if (DBUS_TYPE_ARRAY != dbus_message_iter_get_arg_type(&mDBusMessageIter))
++ {
++ log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::getProperty DBUS handler argument is no array!");
++ mErrorName = std::string(DBUS_ERROR_INVALID_ARGS);
++ mErrorMsg = "DBus argument is no array";
++ }
++ else
++ {
++ DBusMessageIter arrayIter, structIter, soundpropIter;
++ am_EarlyData_s earlyData;
++
++ //first the volume array
++ dbus_message_iter_recurse(&mDBusMessageIter, &arrayIter);
++ do
++ {
++ dbus_message_iter_recurse(&arrayIter, &structIter);
++ earlyData.type = static_cast<am_EarlyDataType_e>(getUInt(structIter, true));
++ if (earlyData.type==ED_SINK_VOLUME)
++ earlyData.sinksource.sink = static_cast<am_sinkID_t>(getUInt(structIter, true));
++ else
++ earlyData.sinksource.source = static_cast<am_sourceID_t>(getUInt(structIter, true));
++ earlyData.data.volume = static_cast<am_volume_t>(getInt(structIter, false));
++ listEarlyData.push_back(earlyData);
++ } while (dbus_message_iter_next(&arrayIter));
++ dbus_message_iter_next(&mDBusMessageIter);
++
++ //then the soundproperty array
++ dbus_message_iter_recurse(&mDBusMessageIter, &arrayIter);
++ do
++ {
++ dbus_message_iter_recurse(&arrayIter, &structIter);
++ earlyData.type = static_cast<am_EarlyDataType_e>(getUInt(structIter, true));
++ if (earlyData.type==ED_SINK_PROPERTY)
++ earlyData.sinksource.sink = static_cast<am_sinkID_t>(getUInt(structIter, true));
++ else
++ earlyData.sinksource.source = static_cast<am_sourceID_t>(getUInt(structIter, true));
++ dbus_message_iter_recurse(&structIter, &soundpropIter);
++ earlyData.data.soundProperty.type = static_cast<am_CustomSoundPropertyType_t>(getInt(soundpropIter, true));
++ earlyData.data.soundProperty.value = (getInt(soundpropIter, false));
++ listEarlyData.push_back(earlyData);
++ } while (dbus_message_iter_next(&arrayIter));
++ }
++ return (listEarlyData);
++}
++
++am_Domain_s CAmRoutingDbusMessageHandler::getDomainData()
++{
++ am_Domain_s domainData;
++ DBusMessageIter domainDataIter;
++
++ if (DBUS_TYPE_STRUCT != dbus_message_iter_get_arg_type(&mDBusMessageIter))
++ {
++ log(&routingDbus, DLT_LOG_ERROR, "CAmRoutingDbusMessageHandler::getDomainData DBUS handler argument is no struct!");
++ mErrorName = std::string(DBUS_ERROR_INVALID_ARGS);
++ mErrorMsg = "DBus argument is no struct";
++ }
++ else
++ {
++ dbus_message_iter_recurse(&mDBusMessageIter, &domainDataIter);
++ domainData.domainID = static_cast<am_domainID_t>(getUInt(domainDataIter, true));
++ domainData.name = getString(domainDataIter, true);
++ domainData.busname = getString(domainDataIter, true);
++ domainData.nodename = getString(domainDataIter, true);
++ domainData.early = getBool(domainDataIter, true);
++ domainData.complete = getBool(domainDataIter, true);
++ domainData.state = static_cast<am_DomainState_e>(getInt(domainDataIter, false));
++ dbus_message_iter_next(&mDBusMessageIter);
++ }
++ return (domainData);
++}
++
++am_Source_s CAmRoutingDbusMessageHandler::getSourceData()
++{
++ am_Source_s sourceData;
++ DBusMessageIter sourceDataIter, availIter, arrayIter, structIter;
++ am_SoundProperty_s soundProperty;
++ am_CustomAvailabilityReason_t connectionFormat;
++ am_MainSoundProperty_s mainSoundProperty;
++ am_NotificationConfiguration_s notificationConfiguration;
++ am_NotificationConfiguration_s MainnotificationConfiguration;
++
++ if (DBUS_TYPE_STRUCT != dbus_message_iter_get_arg_type(&mDBusMessageIter))
++ {
++ log(&routingDbus, DLT_LOG_ERROR, "CAmRoutingDbusMessageHandler::getSourceData DBUS handler argument is no struct!");
++ mErrorName = std::string(DBUS_ERROR_INVALID_ARGS);
++ mErrorMsg = "DBus argument is no struct";
++ }
++ else
++ {
++ dbus_message_iter_recurse(&mDBusMessageIter, &sourceDataIter);
++ sourceData.sourceID = static_cast<am_sourceID_t>(getUInt(sourceDataIter, true));
++ sourceData.domainID = static_cast<am_domainID_t>(getUInt(sourceDataIter, true));
++ sourceData.name = getString(sourceDataIter, true);
++ sourceData.sourceClassID = static_cast<am_sourceClass_t>(getUInt(sourceDataIter, true));
++ sourceData.sourceState = static_cast<am_SourceState_e>(getInt32(sourceDataIter, true));
++ sourceData.volume = static_cast<am_volume_t>(getInt(sourceDataIter, true));
++ sourceData.visible = getBool(sourceDataIter, true);
++ dbus_message_iter_recurse(&sourceDataIter, &availIter);
++ sourceData.available.availability = static_cast<am_Availability_e>(getInt32(availIter, true));
++ sourceData.available.availabilityReason = static_cast<am_CustomAvailabilityReason_t>(getInt32(availIter, false));
++ dbus_message_iter_next(&sourceDataIter);
++ sourceData.interruptState = static_cast<am_InterruptState_e>(getUInt(sourceDataIter, true));
++ dbus_message_iter_recurse(&sourceDataIter, &arrayIter);
++ do
++ {
++ dbus_message_iter_recurse(&arrayIter, &structIter);
++ soundProperty.type = static_cast<am_CustomSoundPropertyType_t>(getInt32(structIter, true));
++ soundProperty.value = static_cast<int16_t>(getInt(structIter, false));
++ sourceData.listSoundProperties.push_back(soundProperty);
++ } while (dbus_message_iter_next(&arrayIter));
++ dbus_message_iter_next(&sourceDataIter);
++ dbus_message_iter_recurse(&sourceDataIter, &arrayIter);
++ do
++ {
++ connectionFormat = static_cast<am_CustomAvailabilityReason_t>(getInt32(arrayIter, false));
++ sourceData.listConnectionFormats.push_back(connectionFormat);
++ } while (dbus_message_iter_next(&arrayIter));
++ dbus_message_iter_next(&sourceDataIter);
++
++ dbus_message_iter_recurse(&sourceDataIter, &arrayIter);
++ do
++ {
++ dbus_message_iter_recurse(&arrayIter, &structIter);
++ mainSoundProperty.type = static_cast<am_CustomMainSoundPropertyType_t>(getInt32(structIter, true));
++ mainSoundProperty.value = static_cast<int16_t>(getInt(structIter, false));
++ sourceData.listMainSoundProperties.push_back(mainSoundProperty);
++ } while (dbus_message_iter_next(&arrayIter));
++ dbus_message_iter_next(&sourceDataIter);
++
++ dbus_message_iter_recurse(&sourceDataIter, &arrayIter);
++ do
++ {
++ dbus_message_iter_recurse(&arrayIter, &structIter);
++ MainnotificationConfiguration.type = static_cast<am_CustomNotificationType_t>(getInt32(structIter, true));
++ MainnotificationConfiguration.parameter = static_cast<int16_t>(getInt32(structIter, false));
++ MainnotificationConfiguration.status = static_cast<am_NotificationStatus_e>(getInt(structIter, true));
++ sourceData.listMainNotificationConfigurations.push_back(MainnotificationConfiguration);
++ } while (dbus_message_iter_next(&arrayIter));
++ dbus_message_iter_next(&sourceDataIter);
++
++ dbus_message_iter_recurse(&sourceDataIter, &arrayIter);
++ do
++ {
++ dbus_message_iter_recurse(&arrayIter, &structIter);
++ notificationConfiguration.type = static_cast<am_CustomNotificationType_t>(getInt32(structIter, true));
++ notificationConfiguration.parameter = static_cast<int16_t>(getInt32(structIter, false));
++ notificationConfiguration.status = static_cast<am_NotificationStatus_e>(getInt(structIter, true));
++ sourceData.listNotificationConfigurations.push_back(notificationConfiguration);
++ } while (dbus_message_iter_next(&arrayIter));
++ dbus_message_iter_next(&mDBusMessageIter);
++ }
++ return (sourceData);
++}
++
++am_Sink_s CAmRoutingDbusMessageHandler::getSinkData()
++{
++ am_Sink_s sinkData;
++ DBusMessageIter sinkDataIter, structIter, availIter, arrayIter;
++ am_SoundProperty_s soundProperty;
++ am_CustomAvailabilityReason_t connectionFormat;
++ am_MainSoundProperty_s mainSoundProperty;
++ am_NotificationConfiguration_s notificationConfiguration;
++ am_NotificationConfiguration_s MainnotificationConfiguration;
++
++ if (DBUS_TYPE_STRUCT != dbus_message_iter_get_arg_type(&mDBusMessageIter))
++ {
++ log(&routingDbus, DLT_LOG_ERROR, "CAmRoutingDbusMessageHandler::getSinkData DBUS handler argument is no struct!");
++ mErrorName = std::string(DBUS_ERROR_INVALID_ARGS);
++ mErrorMsg = "DBus argument is no struct";
++ }
++ else
++ {
++ dbus_message_iter_recurse(&mDBusMessageIter, &sinkDataIter);
++ sinkData.sinkID = static_cast<am_sinkID_t>(getUInt(sinkDataIter, true));
++ sinkData.name = getString(sinkDataIter, true);
++ sinkData.domainID = static_cast<am_domainID_t>(getUInt(sinkDataIter, true));
++ sinkData.sinkClassID = static_cast<am_sinkClass_t>(getInt32(sinkDataIter, true));
++ sinkData.volume = static_cast<am_volume_t>(getInt(sinkDataIter, true));
++ sinkData.visible = getBool(sinkDataIter, true);
++ dbus_message_iter_recurse(&sinkDataIter, &availIter);
++ sinkData.available.availability = static_cast<am_Availability_e>(getInt32(availIter, true));
++ sinkData.available.availabilityReason = static_cast<am_CustomAvailabilityReason_t>(getInt32(availIter, false));
++ dbus_message_iter_next(&sinkDataIter);
++ sinkData.muteState = static_cast<am_MuteState_e>(getInt(sinkDataIter, true));
++ sinkData.mainVolume = static_cast<am_mainVolume_t>(getInt(sinkDataIter, true));
++
++ dbus_message_iter_recurse(&sinkDataIter, &arrayIter);
++ do
++ {
++ dbus_message_iter_recurse(&arrayIter, &structIter);
++ soundProperty.type = static_cast<am_CustomSoundPropertyType_t>(getInt32(structIter, true));
++ soundProperty.value = static_cast<int16_t>(getInt(structIter, false));
++ sinkData.listSoundProperties.push_back(soundProperty);
++ } while (dbus_message_iter_next(&arrayIter));
++
++ dbus_message_iter_next(&sinkDataIter);
++
++ dbus_message_iter_recurse(&sinkDataIter, &arrayIter);
++ do
++ {
++ connectionFormat = static_cast<am_CustomAvailabilityReason_t>(getInt32(arrayIter, false));
++ sinkData.listConnectionFormats.push_back(connectionFormat);
++ } while (dbus_message_iter_next(&arrayIter));
++ dbus_message_iter_next(&sinkDataIter);
++
++ dbus_message_iter_recurse(&sinkDataIter, &arrayIter);
++ do
++ {
++ dbus_message_iter_recurse(&arrayIter, &structIter);
++ mainSoundProperty.type = static_cast<am_CustomMainSoundPropertyType_t>(getInt32(structIter, true));
++ mainSoundProperty.value = static_cast<int16_t>(getInt(structIter, false));
++ sinkData.listMainSoundProperties.push_back(mainSoundProperty);
++ } while (dbus_message_iter_next(&arrayIter));
++ dbus_message_iter_next(&sinkDataIter);
++
++ dbus_message_iter_recurse(&sinkDataIter, &arrayIter);
++ do
++ {
++ dbus_message_iter_recurse(&arrayIter, &structIter);
++ MainnotificationConfiguration.type = static_cast<am_CustomNotificationType_t>(getInt32(structIter, true));
++ MainnotificationConfiguration.parameter = static_cast<int16_t>(getInt32(structIter, false));
++ MainnotificationConfiguration.status = static_cast<am_NotificationStatus_e>(getInt(structIter, true));
++ sinkData.listMainNotificationConfigurations.push_back(MainnotificationConfiguration);
++ } while (dbus_message_iter_next(&arrayIter));
++ dbus_message_iter_next(&sinkDataIter);
++
++ dbus_message_iter_recurse(&sinkDataIter, &arrayIter);
++ do
++ {
++ dbus_message_iter_recurse(&arrayIter, &structIter);
++ notificationConfiguration.type = static_cast<am_CustomNotificationType_t>(getInt32(structIter, true));
++ notificationConfiguration.parameter = static_cast<int16_t>(getInt32(structIter, false));
++ notificationConfiguration.status = static_cast<am_NotificationStatus_e>(getInt(structIter, true));
++ sinkData.listNotificationConfigurations.push_back(notificationConfiguration);
++ } while (dbus_message_iter_next(&arrayIter));
++ dbus_message_iter_next(&mDBusMessageIter);
++ }
++ return (sinkData);
++}
++
++am_Gateway_s CAmRoutingDbusMessageHandler::getGatewayData()
++{
++ am_Gateway_s gatewayData;
++ DBusMessageIter gatewayDataIter, arrayIter;
++ am_CustomAvailabilityReason_t connectionFormat;
++ bool convertion;
++ if (DBUS_TYPE_STRUCT != dbus_message_iter_get_arg_type(&mDBusMessageIter))
++ {
++ log(&routingDbus, DLT_LOG_ERROR, "CAmRoutingDbusMessageHandler::getDomainData DBUS handler argument is no struct!");
++ mErrorName = std::string(DBUS_ERROR_INVALID_ARGS);
++ mErrorMsg = "DBus argument is no struct";
++ }
++ else
++ {
++ dbus_message_iter_recurse(&mDBusMessageIter, &gatewayDataIter);
++ gatewayData.gatewayID = static_cast<am_gatewayID_t>(getUInt(gatewayDataIter, true));
++ gatewayData.name = getString(gatewayDataIter, true);
++ gatewayData.sinkID = static_cast<am_sinkID_t>(getUInt(gatewayDataIter, true));
++ gatewayData.sourceID = static_cast<am_sourceID_t>(getUInt(gatewayDataIter, true));
++ gatewayData.domainSinkID = static_cast<am_domainID_t>(getUInt(gatewayDataIter, true));
++ gatewayData.domainSourceID = static_cast<am_domainID_t>(getUInt(gatewayDataIter, true));
++ gatewayData.controlDomainID = static_cast<am_domainID_t>(getUInt(gatewayDataIter, true));
++ dbus_message_iter_recurse(&gatewayDataIter, &arrayIter);
++ do
++ {
++ connectionFormat = static_cast<am_CustomAvailabilityReason_t>(getInt32(arrayIter, false));
++ gatewayData.listSourceFormats.push_back(connectionFormat);
++ } while (dbus_message_iter_next(&arrayIter));
++ dbus_message_iter_next(&gatewayDataIter);
++ dbus_message_iter_recurse(&gatewayDataIter, &arrayIter);
++ do
++ {
++ connectionFormat = static_cast<am_CustomAvailabilityReason_t>(getInt32(arrayIter, false));
++ gatewayData.listSinkFormats.push_back(connectionFormat);
++ } while (dbus_message_iter_next(&arrayIter));
++ dbus_message_iter_next(&gatewayDataIter);
++ dbus_message_iter_recurse(&gatewayDataIter, &arrayIter);
++ do
++ {
++ convertion = getBool(arrayIter, false);
++ gatewayData.convertionMatrix.push_back(convertion);
++ } while (dbus_message_iter_next(&arrayIter));
++ dbus_message_iter_next(&mDBusMessageIter);
++ }
++ return (gatewayData);
++}
++
++am_Converter_s CAmRoutingDbusMessageHandler::getConverterData()
++{
++ am_Converter_s gatewayData;
++ DBusMessageIter gatewayDataIter, arrayIter;
++ am_CustomAvailabilityReason_t connectionFormat;
++ bool convertion;
++ if (DBUS_TYPE_STRUCT != dbus_message_iter_get_arg_type(&mDBusMessageIter))
++ {
++ log(&routingDbus, DLT_LOG_ERROR, "CAmRoutingDbusMessageHandler::getDomainData DBUS handler argument is no struct!");
++ mErrorName = std::string(DBUS_ERROR_INVALID_ARGS);
++ mErrorMsg = "DBus argument is no struct";
++ }
++ else
++ {
++ dbus_message_iter_recurse(&mDBusMessageIter, &gatewayDataIter);
++ gatewayData.converterID = static_cast<am_gatewayID_t>(getUInt(gatewayDataIter, true));
++ gatewayData.name = getString(gatewayDataIter, true);
++ gatewayData.sinkID = static_cast<am_sinkID_t>(getUInt(gatewayDataIter, true));
++ gatewayData.sourceID = static_cast<am_sourceID_t>(getUInt(gatewayDataIter, true));
++ gatewayData.domainID = static_cast<am_domainID_t>(getUInt(gatewayDataIter, true));
++ dbus_message_iter_recurse(&gatewayDataIter, &arrayIter);
++ do
++ {
++ connectionFormat = static_cast<am_CustomAvailabilityReason_t>(getInt32(arrayIter, false));
++ gatewayData.listSourceFormats.push_back(connectionFormat);
++ } while (dbus_message_iter_next(&arrayIter));
++ dbus_message_iter_next(&gatewayDataIter);
++ dbus_message_iter_recurse(&gatewayDataIter, &arrayIter);
++ do
++ {
++ connectionFormat = static_cast<am_CustomAvailabilityReason_t>(getInt32(arrayIter, false));
++ gatewayData.listSinkFormats.push_back(connectionFormat);
++ } while (dbus_message_iter_next(&arrayIter));
++ dbus_message_iter_next(&gatewayDataIter);
++ dbus_message_iter_recurse(&gatewayDataIter, &arrayIter);
++ do
++ {
++ convertion = getBool(arrayIter, false);
++ gatewayData.convertionMatrix.push_back(convertion);
++ } while (dbus_message_iter_next(&arrayIter));
++ dbus_message_iter_next(&mDBusMessageIter);
++ }
++ return (gatewayData);
++}
++
++am_Crossfader_s CAmRoutingDbusMessageHandler::getCrossfaderData()
++{
++ am_Crossfader_s crossfaderData;
++ DBusMessageIter crossfaderDataIter;
++
++ if (DBUS_TYPE_STRUCT != dbus_message_iter_get_arg_type(&mDBusMessageIter))
++ {
++ log(&routingDbus, DLT_LOG_ERROR, "CAmRoutingDbusMessageHandler::getCrossfaderData DBUS handler argument is no struct!");
++ mErrorName = std::string(DBUS_ERROR_INVALID_ARGS);
++ mErrorMsg = "DBus argument is no struct";
++ }
++ else
++ {
++ dbus_message_iter_recurse(&mDBusMessageIter, &crossfaderDataIter);
++ crossfaderData.crossfaderID = static_cast<am_crossfaderID_t> (getUInt(crossfaderDataIter, true));
++ crossfaderData.name = static_cast<std::string> (getString(crossfaderDataIter, true));
++ crossfaderData.sinkID_A = static_cast<am_sinkID_t> (getUInt(crossfaderDataIter, true));
++ crossfaderData.sinkID_B = static_cast<am_sinkID_t> (getUInt(crossfaderDataIter, true));
++ crossfaderData.sourceID = static_cast<am_sourceID_t> (getUInt(crossfaderDataIter, true));
++ crossfaderData.hotSink = static_cast<am_HotSink_e> (getUInt(crossfaderDataIter, false));
++ dbus_message_iter_next(&mDBusMessageIter);
++ }
++ return (crossfaderData);
++}
++
++am_MainSoundProperty_s CAmRoutingDbusMessageHandler::getMainSoundProperty()
++{
++ am_MainSoundProperty_s mainSoundProperty;
++ DBusMessageIter structIter;
++
++ dbus_message_iter_recurse(&mDBusMessageIter, &structIter);
++ mainSoundProperty.type = static_cast<am_CustomMainSoundPropertyType_t>(getInt(structIter, true));
++ mainSoundProperty.value = static_cast<int16_t>(getInt(structIter, false));
++ dbus_message_iter_next(&mDBusMessageIter);
++
++ return (mainSoundProperty);
++}
++
++void CAmRoutingDbusMessageHandler::append(bool toAppend)
++{
++ dbus_bool_t mybool = toAppend;
++ if (!dbus_message_iter_append_basic(&mDBusMessageIter, DBUS_TYPE_BOOLEAN, &mybool))
++ {
++ log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
++ mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
++ mErrorMsg = "Cannot create reply!";
++ }
++}
++
++void CAmRoutingDbusMessageHandler::append(double toAppend)
++{
++ if (!dbus_message_iter_append_basic(&mDBusMessageIter, DBUS_TYPE_DOUBLE, &toAppend))
++ {
++ log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
++ mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
++ mErrorMsg = "Cannot create reply!";
++ }
++}
++
++void CAmRoutingDbusMessageHandler::append(char toAppend)
++{
++ if (!dbus_message_iter_append_basic(&mDBusMessageIter, DBUS_TYPE_BYTE, &toAppend))
++ {
++ log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
++ mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
++ mErrorMsg = "Cannot create reply!";
++ }
++}
++
++void CAmRoutingDbusMessageHandler::append(dbus_int16_t toAppend)
++{
++ if (!dbus_message_iter_append_basic(&mDBusMessageIter, DBUS_TYPE_INT16, &toAppend))
++ {
++ log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
++ mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
++ mErrorMsg = "Cannot create reply!";
++ }
++}
++
++void CAmRoutingDbusMessageHandler::append(dbus_uint16_t toAppend)
++{
++ if (!dbus_message_iter_append_basic(&mDBusMessageIter, DBUS_TYPE_UINT16, &toAppend))
++ {
++ log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
++ mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
++ mErrorMsg = "Cannot create reply!";
++ }
++}
++
++void CAmRoutingDbusMessageHandler::setDBusConnection(DBusConnection*& connection)
++{
++ assert(connection != NULL);
++ mpDBusConnection = connection;
++}
++
++void CAmRoutingDbusMessageHandler::append(const am::am_SinkType_s& sinkType)
++{
++ DBusMessageIter structIter;
++ DBusMessageIter structAvailIter;
++ dbus_bool_t success = true;
++ success = success && dbus_message_iter_open_container(&mDBusMessageIter, DBUS_TYPE_STRUCT, NULL, &structIter);
++ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_UINT16, &sinkType.sinkID);
++ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_STRING, &sinkType.name);
++ success = success && dbus_message_iter_open_container(&structIter, DBUS_TYPE_STRUCT, NULL, &structAvailIter);
++ success = success && dbus_message_iter_append_basic(&structAvailIter, DBUS_TYPE_INT16, &sinkType.availability.availability);
++ success = success && dbus_message_iter_append_basic(&structAvailIter, DBUS_TYPE_INT16, &sinkType.availability.availabilityReason);
++ success = success && dbus_message_iter_close_container(&structIter, &structAvailIter);
++ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &sinkType.volume);
++ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &sinkType.muteState);
++ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_UINT16, &sinkType.sinkClassID);
++ success = success && dbus_message_iter_close_container(&mDBusMessageIter, &structIter);
++ if (!success)
++ {
++ log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
++ mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
++ mErrorMsg = "Cannot create reply!";
++ }
++}
++
++void CAmRoutingDbusMessageHandler::append(const am::am_SourceType_s& sourceType)
++{
++ DBusMessageIter structIter;
++ DBusMessageIter structAvailIter;
++ dbus_bool_t success = true;
++ success = success && dbus_message_iter_open_container(&mDBusMessageIter, DBUS_TYPE_STRUCT, NULL, &structIter);
++ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_UINT16, &sourceType.sourceID);
++ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_STRING, &sourceType.name);
++ success = success && dbus_message_iter_open_container(&structIter, DBUS_TYPE_STRUCT, NULL, &structAvailIter);
++ success = success && dbus_message_iter_append_basic(&structAvailIter, DBUS_TYPE_INT16, &sourceType.availability.availability);
++ success = success && dbus_message_iter_append_basic(&structAvailIter, DBUS_TYPE_INT16, &sourceType.availability.availabilityReason);
++ success = success && dbus_message_iter_close_container(&structIter, &structAvailIter);
++ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_UINT16, &sourceType.sourceClassID);
++ success = success && dbus_message_iter_close_container(&mDBusMessageIter, &structIter);
++ if (!success)
++ {
++ log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
++ mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
++ mErrorMsg = "Cannot create reply!";
++ }
++}
++
++void CAmRoutingDbusMessageHandler::append(const am::am_MainSoundProperty_s mainSoundProperty)
++{
++ DBusMessageIter structIter;
++ dbus_bool_t success = true;
++ success = success && dbus_message_iter_open_container(&mDBusMessageIter, DBUS_TYPE_STRUCT, NULL, &structIter);
++ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &mainSoundProperty.type);
++ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &mainSoundProperty.value);
++ success = success && dbus_message_iter_close_container(&mDBusMessageIter, &structIter);
++ if (!success)
++ {
++ log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
++ mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
++ mErrorMsg = "Cannot create reply!";
++ }
++}
++
++void CAmRoutingDbusMessageHandler::append(const am::am_Availability_s& availability)
++{
++ DBusMessageIter structAvailIter;
++ dbus_bool_t success = true;
++ success = success && dbus_message_iter_open_container(&mDBusMessageIter, DBUS_TYPE_STRUCT, NULL, &structAvailIter);
++ success = success && dbus_message_iter_append_basic(&structAvailIter, DBUS_TYPE_INT16, &availability.availability);
++ success = success && dbus_message_iter_append_basic(&structAvailIter, DBUS_TYPE_INT16, &availability.availabilityReason);
++ success = success && dbus_message_iter_close_container(&mDBusMessageIter, &structAvailIter);
++ if (!success)
++ {
++ log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
++ mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
++ mErrorMsg = "Cannot create reply!";
++ }
++}
++
++void CAmRoutingDbusMessageHandler::append(const am::am_SystemProperty_s& SystemProperty)
++{
++ DBusMessageIter structIter;
++ dbus_bool_t success = true;
++ success = success && dbus_message_iter_open_container(&mDBusMessageIter, DBUS_TYPE_STRUCT, NULL, &structIter);
++ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &SystemProperty.type);
++ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &SystemProperty.value);
++ success = success && dbus_message_iter_close_container(&mDBusMessageIter, &structIter);
++ if (!success)
++ {
++ log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
++ mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
++ mErrorMsg = "Cannot create reply!";
++ }
++}
++
++void CAmRoutingDbusMessageHandler::append(const std::vector<am::am_MainConnectionType_s>& listMainConnections)
++{
++ DBusMessageIter arrayIter;
++ DBusMessageIter structIter;
++ std::vector<am::am_MainConnectionType_s>::const_iterator listIterator = listMainConnections.begin();
++ dbus_bool_t success = true;
++ success = success && dbus_message_iter_open_container(&mDBusMessageIter, DBUS_TYPE_ARRAY, "(qqqnn)", &arrayIter);
++ for (; listIterator < listMainConnections.end(); ++listIterator)
++ {
++ success = success && dbus_message_iter_open_container(&arrayIter, DBUS_TYPE_STRUCT, NULL, &structIter);
++ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_UINT16, &listIterator->mainConnectionID);
++ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_UINT16, &listIterator->sourceID);
++ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_UINT16, &listIterator->sinkID);
++ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &listIterator->delay);
++ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &listIterator->connectionState);
++ success = success && dbus_message_iter_close_container(&arrayIter, &structIter);
++ }
++ success = success && dbus_message_iter_close_container(&mDBusMessageIter, &arrayIter);
++ if (!success)
++ {
++ log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
++ mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
++ mErrorMsg = "Cannot create reply!";
++ }
++}
++
++void CAmRoutingDbusMessageHandler::append(const std::vector<am::am_SinkType_s>& listMainSinks)
++{
++ DBusMessageIter arrayIter;
++ DBusMessageIter structIter;
++ DBusMessageIter availIter;
++ std::vector<am::am_SinkType_s>::const_iterator listIterator = listMainSinks.begin();
++ dbus_bool_t success = true;
++ success = success && dbus_message_iter_open_container(&mDBusMessageIter, DBUS_TYPE_ARRAY, "(qs(nn)nnq)", &arrayIter);
++ for (; listIterator < listMainSinks.end(); ++listIterator)
++ {
++ success = success && dbus_message_iter_open_container(&arrayIter, DBUS_TYPE_STRUCT, NULL, &structIter);
++ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_UINT16, &listIterator->sinkID);
++ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_STRING, &listIterator->name);
++ success = success && dbus_message_iter_open_container(&structIter, DBUS_TYPE_STRUCT, NULL, &availIter);
++ success = success && dbus_message_iter_append_basic(&availIter, DBUS_TYPE_INT16, &listIterator->availability.availability);
++ success = success && dbus_message_iter_append_basic(&availIter, DBUS_TYPE_INT16, &listIterator->availability.availabilityReason);
++ success = success && dbus_message_iter_close_container(&structIter, &availIter);
++ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &listIterator->volume);
++ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &listIterator->muteState);
++ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_UINT16, &listIterator->sinkClassID);
++ success = success && dbus_message_iter_close_container(&arrayIter, &structIter);
++ }
++ success = success && dbus_message_iter_close_container(&mDBusMessageIter, &arrayIter);
++ if (!success)
++ {
++ log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
++ mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
++ mErrorMsg = "Cannot create reply!";
++ }
++}
++
++void CAmRoutingDbusMessageHandler::append(const std::vector<am::am_SourceType_s>& listMainSources)
++{
++ DBusMessageIter arrayIter;
++ DBusMessageIter structIter;
++ DBusMessageIter availIter;
++ std::vector<am::am_SourceType_s>::const_iterator listIterator = listMainSources.begin();
++ dbus_bool_t success = true;
++ success = success && dbus_message_iter_open_container(&mDBusMessageIter, DBUS_TYPE_ARRAY, "(qs(nn)q)", &arrayIter);
++ for (; listIterator < listMainSources.end(); ++listIterator)
++ {
++ success = success && dbus_message_iter_open_container(&arrayIter, DBUS_TYPE_STRUCT, NULL, &structIter);
++ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_UINT16, &listIterator->sourceID);
++ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_STRING, &listIterator->name);
++ success = success && dbus_message_iter_open_container(&structIter, DBUS_TYPE_STRUCT, NULL, &availIter);
++ success = success && dbus_message_iter_append_basic(&availIter, DBUS_TYPE_INT16, &listIterator->availability.availability);
++ success = success && dbus_message_iter_append_basic(&availIter, DBUS_TYPE_INT16, &listIterator->availability.availabilityReason);
++ success = success && dbus_message_iter_close_container(&structIter, &availIter);
++ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_UINT16, &listIterator->sourceClassID);
++ success = success && dbus_message_iter_close_container(&arrayIter, &structIter);
++ }
++ success = success && dbus_message_iter_close_container(&mDBusMessageIter, &arrayIter);
++ if (!success)
++ {
++ log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
++ mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
++ mErrorMsg = "Cannot create reply!";
++ }
++}
++
++void CAmRoutingDbusMessageHandler::append(const std::vector<am::am_MainSoundProperty_s>& listMainSoundProperties)
++{
++ DBusMessageIter arrayIter;
++ DBusMessageIter structIter;
++ std::vector<am::am_MainSoundProperty_s>::const_iterator listIterator = listMainSoundProperties.begin();
++ dbus_bool_t success = true;
++ success = success && dbus_message_iter_open_container(&mDBusMessageIter, DBUS_TYPE_ARRAY, "(nn)", &arrayIter);
++ for (; listIterator < listMainSoundProperties.end(); ++listIterator)
++ {
++ success = success && dbus_message_iter_open_container(&arrayIter, DBUS_TYPE_STRUCT, NULL, &structIter);
++ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &listIterator->type);
++ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &listIterator->value);
++ success = success && dbus_message_iter_close_container(&arrayIter, &structIter);
++ }
++ success = success && dbus_message_iter_close_container(&mDBusMessageIter, &arrayIter);
++ if (!success)
++ {
++ log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
++ mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
++ mErrorMsg = "Cannot create reply!";
++ }
++}
++
++void CAmRoutingDbusMessageHandler::append(const std::vector<am::am_SourceClass_s>& listSourceClasses)
++{
++ DBusMessageIter arrayIter;
++ DBusMessageIter structIter;
++ DBusMessageIter propIter;
++ DBusMessageIter innerIter;
++ std::vector<am::am_SourceClass_s>::const_iterator listIterator = listSourceClasses.begin();
++ dbus_bool_t success = true;
++ success = success && dbus_message_iter_open_container(&mDBusMessageIter, DBUS_TYPE_ARRAY, "(qsa(nn))", &arrayIter);
++ for (; listIterator < listSourceClasses.end(); ++listIterator)
++ {
++ success = success && dbus_message_iter_open_container(&arrayIter, DBUS_TYPE_STRUCT, NULL, &structIter);
++ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_UINT16, &listIterator->sourceClassID);
++ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_STRING, &listIterator->name);
++ success = success && dbus_message_iter_open_container(&structIter, DBUS_TYPE_ARRAY, "(nn)", &innerIter);
++
++ std::vector<am::am_ClassProperty_s>::const_iterator listInnerIterator = listIterator->listClassProperties.begin();
++ for (; listInnerIterator < listIterator->listClassProperties.end(); ++listInnerIterator)
++ {
++ success = success && dbus_message_iter_open_container(&innerIter, DBUS_TYPE_STRUCT, NULL, &propIter);
++ success = success && dbus_message_iter_append_basic(&propIter, DBUS_TYPE_INT16, &listInnerIterator->classProperty);
++ success = success && dbus_message_iter_append_basic(&propIter, DBUS_TYPE_INT16, &listInnerIterator->value);
++ success = success && dbus_message_iter_close_container(&innerIter, &propIter);
++ }
++ success = success && dbus_message_iter_close_container(&structIter, &innerIter);
++ success = success && dbus_message_iter_close_container(&arrayIter, &structIter);
++ }
++ success = success && dbus_message_iter_close_container(&mDBusMessageIter, &arrayIter);
++ if (!success)
++ {
++ log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
++ mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
++ mErrorMsg = "Cannot create reply!";
++ }
++}
++
++void CAmRoutingDbusMessageHandler::append(const std::vector<am::am_SinkClass_s>& listSinkClasses)
++{
++ DBusMessageIter arrayIter;
++ DBusMessageIter structIter;
++ DBusMessageIter propIter;
++ DBusMessageIter innerIter;
++ std::vector<am::am_SinkClass_s>::const_iterator listIterator = listSinkClasses.begin();
++ dbus_bool_t success = true;
++ success = success && dbus_message_iter_open_container(&mDBusMessageIter, DBUS_TYPE_ARRAY, "(qsa(nn))", &arrayIter);
++ for (; listIterator < listSinkClasses.end(); ++listIterator)
++ {
++ success = success && dbus_message_iter_open_container(&arrayIter, DBUS_TYPE_STRUCT, NULL, &structIter);
++ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_UINT16, &listIterator->sinkClassID);
++ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_STRING, &listIterator->name);
++ success = success && dbus_message_iter_open_container(&structIter, DBUS_TYPE_ARRAY, "(nn)", &innerIter);
++
++ std::vector<am::am_ClassProperty_s>::const_iterator listInnerIterator = listIterator->listClassProperties.begin();
++ for (; listInnerIterator < listIterator->listClassProperties.end(); ++listInnerIterator)
++ {
++ success = success && dbus_message_iter_open_container(&innerIter, DBUS_TYPE_STRUCT, NULL, &propIter);
++ success = success && dbus_message_iter_append_basic(&propIter, DBUS_TYPE_INT16, &listInnerIterator->classProperty);
++ success = success && dbus_message_iter_append_basic(&propIter, DBUS_TYPE_INT16, &listInnerIterator->value);
++ success = success && dbus_message_iter_close_container(&innerIter, &propIter);
++ }
++ success = success && dbus_message_iter_close_container(&structIter, &innerIter);
++ success = success && dbus_message_iter_close_container(&arrayIter, &structIter);
++ }
++ success = success && dbus_message_iter_close_container(&mDBusMessageIter, &arrayIter);
++ if (!success)
++ {
++ {
++ log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
++ mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
++ mErrorMsg = "Cannot create reply!";
++ }
++ }
++}
++
++std::vector<am_CustomAvailabilityReason_t> CAmRoutingDbusMessageHandler::getListconnectionFormats()
++{
++ DBusMessageIter arrayIter;
++ std::vector<am_CustomAvailabilityReason_t> listConnectionFormats;
++ if (DBUS_TYPE_ARRAY != dbus_message_iter_get_arg_type(&mDBusMessageIter))
++ {
++ log(&routingDbus, DLT_LOG_ERROR, "CAmRoutingDbusMessageHandler::getListconnectionFormats DBUS handler argument is no array!");
++ mErrorName = std::string(DBUS_ERROR_INVALID_ARGS);
++ mErrorMsg = "DBus argument is no array";
++ }
++ else
++ {
++ dbus_message_iter_recurse(&mDBusMessageIter, &arrayIter);
++ do
++ {
++ am_CustomAvailabilityReason_t connectionformat(static_cast<am_CustomAvailabilityReason_t>(getUInt(arrayIter, false)));
++ listConnectionFormats.push_back(connectionformat);
++ } while (dbus_message_iter_next(&arrayIter));
++ dbus_message_iter_next(&mDBusMessageIter);
++ }
++ return (listConnectionFormats);
++
++}
++
++std::vector<bool> CAmRoutingDbusMessageHandler::getListBool()
++{
++ DBusMessageIter arrayIter;
++ std::vector<bool> listBools;
++ if (DBUS_TYPE_ARRAY != dbus_message_iter_get_arg_type(&mDBusMessageIter))
++ {
++ log(&routingDbus, DLT_LOG_ERROR, "CAmRoutingDbusMessageHandler::getListBool DBUS handler argument is no array!");
++ mErrorName = std::string(DBUS_ERROR_INVALID_ARGS);
++ mErrorMsg = "DBus argument is no array";
++ }
++ else
++ {
++ dbus_message_iter_recurse(&mDBusMessageIter, &arrayIter);
++ do
++ {
++ bool myBool(static_cast<bool>(getBool(arrayIter, false)));
++ listBools.push_back(myBool);
++ } while (dbus_message_iter_next(&arrayIter));
++ dbus_message_iter_next(&mDBusMessageIter);
++ }
++ return (listBools);
++}
++
++am_SoundProperty_s CAmRoutingDbusMessageHandler::getSoundProperty()
++{
++ am_SoundProperty_s soundProperty;
++ DBusMessageIter structIter;
++
++ dbus_message_iter_recurse(&mDBusMessageIter, &structIter);
++ soundProperty.type = static_cast<am_CustomSoundPropertyType_t>(getInt(structIter, true));
++ soundProperty.value = static_cast<int16_t>(getInt(structIter, false));
++ dbus_message_iter_next(&mDBusMessageIter);
++
++ return(soundProperty);
++}
++
++std::vector<am_SoundProperty_s> CAmRoutingDbusMessageHandler::getListSoundProperties()
++{
++ DBusMessageIter arrayIter;
++ DBusMessageIter structIter;
++ am_SoundProperty_s soundProperty;
++ std::vector<am_SoundProperty_s> listSoundProperties;
++ if (DBUS_TYPE_ARRAY != dbus_message_iter_get_arg_type(&mDBusMessageIter))
++ {
++ log(&routingDbus, DLT_LOG_ERROR, "CAmRoutingDbusMessageHandler::getListSoundProperties DBUS handler argument is no array!");
++ mErrorName = std::string(DBUS_ERROR_INVALID_ARGS);
++ mErrorMsg = "DBus argument is no array";
++ }
++ else
++ {
++ dbus_message_iter_recurse(&mDBusMessageIter, &arrayIter);
++ do
++ {
++ dbus_message_iter_recurse(&arrayIter, &structIter);
++ soundProperty.type = static_cast<am_CustomSoundPropertyType_t>(getInt(structIter, true));
++ soundProperty.value = static_cast<int16_t>(getInt(structIter, false));
++ listSoundProperties.push_back(soundProperty);
++ } while (dbus_message_iter_next(&arrayIter));
++ dbus_message_iter_next(&structIter);
++ }
++ return (listSoundProperties);
++}
++
++std::vector<am_MainSoundProperty_s> CAmRoutingDbusMessageHandler::getListMainSoundProperties()
++{
++ DBusMessageIter arrayIter;
++ DBusMessageIter structIter;
++ am_MainSoundProperty_s soundProperty;
++ std::vector<am_MainSoundProperty_s> listSoundProperties;
++ if (DBUS_TYPE_ARRAY != dbus_message_iter_get_arg_type(&mDBusMessageIter))
++ {
++ log(&routingDbus, DLT_LOG_ERROR, "CAmRoutingDbusMessageHandler::getListSoundProperties DBUS handler argument is no array!");
++ mErrorName = std::string(DBUS_ERROR_INVALID_ARGS);
++ mErrorMsg = "DBus argument is no array";
++ }
++ else
++ {
++ dbus_message_iter_recurse(&mDBusMessageIter, &arrayIter);
++ do
++ {
++ dbus_message_iter_recurse(&arrayIter, &structIter);
++ soundProperty.type = static_cast<am_CustomMainSoundPropertyType_t>(getInt(structIter, true));
++ soundProperty.value = static_cast<int16_t>(getInt(structIter, false));
++ listSoundProperties.push_back(soundProperty);
++ } while (dbus_message_iter_next(&arrayIter));
++ dbus_message_iter_next(&structIter);
++ }
++ return (listSoundProperties);
++}
++
++am_NotificationPayload_s CAmRoutingDbusMessageHandler::getNotificationPayload()
++{
++ am_NotificationPayload_s notificationPayload;
++ DBusMessageIter structIter;
++
++ dbus_message_iter_recurse(&mDBusMessageIter, &structIter);
++ notificationPayload.type = static_cast<am_CustomNotificationType_t>(getInt(structIter, true));
++ notificationPayload.value = static_cast<int16_t>(getInt(structIter, false));
++ dbus_message_iter_next(&mDBusMessageIter);
++
++ return (notificationPayload);
++}
++
++dbus_int32_t CAmRoutingDbusMessageHandler::getInt32()
++{
++ return (getInt32(mDBusMessageIter, true));
++}
++
++dbus_int32_t CAmRoutingDbusMessageHandler::getInt32(DBusMessageIter& iter, bool next)
++{
++ dbus_int32_t param(0);
++ #ifdef GLIB_DBUS_TYPES_TOLERANT
++ if (DBUS_TYPE_INT32 != dbus_message_iter_get_arg_type(&iter) && DBUS_TYPE_INT32 != dbus_message_iter_get_arg_type(&iter))
++ #else
++ if (DBUS_TYPE_INT32 != dbus_message_iter_get_arg_type(&iter))
++ #endif
++ {
++ log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::getInt DBUS handler argument is no int32_t!");
++ mErrorName = std::string(DBUS_ERROR_INVALID_ARGS);
++ mErrorMsg = "DBus argument is no int32_t";
++ }
++ else
++ {
++ dbus_message_iter_get_basic(&iter, &param);
++ if (next)
++ dbus_message_iter_next(&iter);
++ }
++ return (param);
++}
++
++void CAmRoutingDbusMessageHandler::append(const std::vector<am::am_SystemProperty_s>& listSystemProperties)
++{
++ DBusMessageIter arrayIter;
++ DBusMessageIter structIter;
++ std::vector<am::am_SystemProperty_s>::const_iterator listIterator = listSystemProperties.begin();
++ dbus_bool_t success = true;
++ success = success && dbus_message_iter_open_container(&mDBusMessageIter, DBUS_TYPE_ARRAY, "(nn)", &arrayIter);
++ for (; listIterator < listSystemProperties.end(); ++listIterator)
++ {
++ success = success && dbus_message_iter_open_container(&arrayIter, DBUS_TYPE_STRUCT, NULL, &structIter);
++ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &listIterator->type);
++ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &listIterator->value);
++ success = success && dbus_message_iter_close_container(&arrayIter, &structIter);
++ }
++ success = success && dbus_message_iter_close_container(&mDBusMessageIter, &arrayIter);
++ if (!success)
++ {
++ log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
++ mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
++ mErrorMsg = "Cannot create reply!";
++ }
++}
++
++void CAmRoutingDbusMessageHandler::append(const am::am_Error_e error)
++{
++ if (!dbus_message_iter_append_basic(&mDBusMessageIter, DBUS_TYPE_UINT16, &error))
++ {
++ log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
++ mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
++ mErrorMsg = "Cannot create reply!";
++ }
++}
++
++}
++
++
++
++
++
++
++
++
++
++
++
++
++
+diff --git a/PluginRoutingInterfaceDbus/src/CAmDbusSend.cpp b/PluginRoutingInterfaceDbus/src/CAmDbusSend.cpp
+new file mode 100644
+index 0000000..1f2de59
+--- /dev/null
++++ b/PluginRoutingInterfaceDbus/src/CAmDbusSend.cpp
+@@ -0,0 +1,155 @@
++/**
++ * Copyright (c) copyright 2011-2012 Aricent® Group and its licensors
++ * Copyright (c) 2012 BMW
++ *
++ * \author Sampreeth Ramavana
++ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
++ *
++ * \copyright
++ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction,
++ * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
++ * subject to the following conditions:
++ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
++ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
++ * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
++ *
++ * For further information see http://www.genivi.org/.
++ */
++
++#include "../../PluginRoutingInterfaceDbus/include/CAmDbusSend.h"
++
++#include "CAmDltWrapper.h"
++
++namespace am
++{
++
++DLT_IMPORT_CONTEXT(routingDbus)
++
++CAmRoutingDbusSend::CAmRoutingDbusSend(DBusConnection* conn, std::string bus_name, std::string path, std::string interface, std::string method) :
++ mpDbusMessage(NULL), //
++ mpDbusConnection(conn), //
++ mDbusMessageIter(), //
++ mDBusError(), //
++ mSerial(1)
++{
++ dbus_error_init(&mDBusError);
++ mpDbusMessage = dbus_message_new_method_call(bus_name.c_str(), path.c_str(), interface.c_str(), method.c_str());
++ if (NULL == mpDbusMessage)
++ {
++ log(&routingDbus, DLT_LOG_ERROR, "CAmRoutingDbusSend::CAmRoutingDbusSend dbus error:", mDBusError.message);
++ this->~CAmRoutingDbusSend();
++ }
++}
++
++CAmRoutingDbusSend::~CAmRoutingDbusSend()
++{
++}
++
++void CAmRoutingDbusSend::append(std::string string)
++{
++ dbus_message_iter_init_append(mpDbusMessage, &mDbusMessageIter);
++ if (!dbus_message_iter_append_basic(&mDbusMessageIter, DBUS_TYPE_STRING, string.c_str()))
++ {
++ log(&routingDbus, DLT_LOG_ERROR, "CAmRoutingDbusSend::append no more memory");
++ this->~CAmRoutingDbusSend();
++ }
++}
++
++void CAmRoutingDbusSend::append(uint16_t integer)
++{
++ dbus_message_iter_init_append(mpDbusMessage, &mDbusMessageIter);
++ if (!dbus_message_iter_append_basic(&mDbusMessageIter, DBUS_TYPE_UINT16, &integer))
++ {
++ log(&routingDbus, DLT_LOG_ERROR, "CAmRoutingDbusSend::append no more memory");
++ this->~CAmRoutingDbusSend();
++ }
++}
++
++void CAmRoutingDbusSend::append(int16_t integer)
++{
++ dbus_message_iter_init_append(mpDbusMessage, &mDbusMessageIter);
++ if (!dbus_message_iter_append_basic(&mDbusMessageIter, DBUS_TYPE_INT16, &integer))
++ {
++ log(&routingDbus, DLT_LOG_ERROR, "CAmRoutingDbusSend::append no more memory");
++ this->~CAmRoutingDbusSend();
++ }
++}
++
++void CAmRoutingDbusSend::append(std::vector<am_SoundProperty_s> listSoundProperties)
++{
++ DBusMessageIter arrayIter;
++ DBusMessageIter structIter;
++ std::vector<am_SoundProperty_s>::const_iterator listIterator = listSoundProperties.begin();
++ dbus_bool_t success = true;
++
++ success = success && dbus_message_iter_open_container(&mDbusMessageIter, DBUS_TYPE_ARRAY, "(nn)", &arrayIter);
++ for (; listIterator < listSoundProperties.end(); ++listIterator)
++ {
++ success = success && dbus_message_iter_open_container(&arrayIter, DBUS_TYPE_STRUCT, NULL, &structIter);
++ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &listIterator->type);
++ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &listIterator->value);
++ success = success && dbus_message_iter_close_container(&arrayIter, &structIter);
++ }
++ success = success && dbus_message_iter_close_container(&mDbusMessageIter, &arrayIter);
++
++ if (!success)
++ {
++ log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::append error", mDBusError.message);
++ }
++}
++
++void CAmRoutingDbusSend::append(am_SoundProperty_s soundProperty)
++{
++ DBusMessageIter structIter;
++ dbus_bool_t success = true;
++
++ success = success && dbus_message_iter_open_container(&mDbusMessageIter, DBUS_TYPE_STRUCT, NULL, &structIter);
++ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &soundProperty.type);
++ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &soundProperty.value);
++ success = success && dbus_message_iter_close_container(&mDbusMessageIter, &structIter);
++
++ if (!success)
++ {
++ log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::append error", mDBusError.message);
++ }
++}
++
++void CAmRoutingDbusSend::append(int integer)
++{
++ dbus_message_iter_init_append(mpDbusMessage, &mDbusMessageIter);
++ if (!dbus_message_iter_append_basic(&mDbusMessageIter, DBUS_TYPE_INT32, &integer))
++ {
++ log(&routingDbus, DLT_LOG_ERROR, "CAmRoutingDbusSend::append no more memory");
++ this->~CAmRoutingDbusSend();
++ }
++}
++
++am_Error_e CAmRoutingDbusSend::send()
++{
++
++ int32_t error;
++ DBusMessage* reply(dbus_connection_send_with_reply_and_block(mpDbusConnection, mpDbusMessage, -1, &mDBusError));
++ if (!reply)
++ {
++ log(&routingDbus, DLT_LOG_ERROR, "CAmRoutingDbusSend::send failed, dbus error", mDBusError.message);
++ return (E_UNKNOWN);
++ }
++ if(!dbus_message_get_args(reply, &mDBusError, //
++ DBUS_TYPE_INT32, &error, //
++ DBUS_TYPE_INVALID))
++ return (E_UNKNOWN);
++ dbus_message_unref(reply);
++ return (static_cast<am_Error_e>(error));
++}
++
++am_Error_e CAmRoutingDbusSend::sendAsync()
++{
++
++ dbus_connection_send(mpDbusConnection, mpDbusMessage, &mSerial);
++ mSerial++;
++ return (E_OK);
++
++}
++
++}
+diff --git a/PluginRoutingInterfaceDbus/src/CAmRoutingSenderDbus.cpp b/PluginRoutingInterfaceDbus/src/CAmRoutingSenderDbus.cpp
+new file mode 100644
+index 0000000..67b8e58
+--- /dev/null
++++ b/PluginRoutingInterfaceDbus/src/CAmRoutingSenderDbus.cpp
+@@ -0,0 +1,410 @@
++/**
++ * Copyright (c) 2012 BMW
++ * Copyright (c) copyright 2011-2012 Aricent® Group and its licensors
++ *
++ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
++ * \author Sampreeth Ramavana
++ * \author Aleksandar Donchev, aleksander.donchev@partner.bmw.de BMW 2013
++ *
++ * \copyright
++ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction,
++ * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
++ * subject to the following conditions:
++ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
++ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
++ * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
++ *
++ * For further information see http://www.genivi.org/.
++ */
++
++#include "../../PluginRoutingInterfaceDbus/include/CAmRoutingSenderDbus.h"
++
++#include <cassert>
++#include <map>
++
++#include "../../PluginRoutingInterfaceDbus/include/CAmDbusSend.h"
++#include "CAmDltWrapper.h"
++#include "CAmDbusWrapper.h"
++
++namespace am
++{
++DLT_DECLARE_CONTEXT(routingDbus)
++
++extern "C" IAmRoutingSend* PluginRoutingInterfaceDbusFactory()
++{
++ CAmDltWrapper::instance()->registerContext(routingDbus, "DRS", "DBus Plugin");
++ return (new CAmRoutingSenderDbus());
++}
++
++extern "C" void destroyRoutingPluginInterfaceDbus(IAmRoutingSend* routingSendInterface)
++{
++ delete routingSendInterface;
++}
++
++CAmRoutingSenderDbus::CAmRoutingSenderDbus() :
++ mpCAmDBusWrapper(), //
++ mpIAmRoutingReceive(), //
++ mpDBusConnection(), //
++ mCAmRoutingDBusMessageHandler(), //
++ mIAmRoutingReceiverShadowDbus(this)
++{
++ log(&routingDbus, DLT_LOG_INFO, "RoutingSender constructed");
++}
++
++CAmRoutingSenderDbus::~CAmRoutingSenderDbus()
++{
++ log(&routingDbus, DLT_LOG_INFO, "RoutingSender destructed");
++ CAmDltWrapper::instance()->unregisterContext(routingDbus);
++}
++
++am_Error_e CAmRoutingSenderDbus::startupInterface(IAmRoutingReceive* pIAmRoutingReceive)
++{
++ log(&routingDbus, DLT_LOG_INFO, "startupInterface called");
++ mpIAmRoutingReceive = pIAmRoutingReceive;
++ mIAmRoutingReceiverShadowDbus.setRoutingReceiver(mpIAmRoutingReceive);
++ mpIAmRoutingReceive->getDBusConnectionWrapper(mpCAmDBusWrapper);
++ assert(mpCAmDBusWrapper!=NULL);
++ mpCAmDBusWrapper->getDBusConnection(mpDBusConnection);
++ assert(mpDBusConnection!=NULL);
++ mCAmRoutingDBusMessageHandler.setDBusConnection(mpDBusConnection);
++ return (E_OK);
++}
++
++void CAmRoutingSenderDbus::getInterfaceVersion(std::string & version) const
++{
++ version = RoutingVersion;
++}
++
++void CAmRoutingSenderDbus::setRoutingReady(const uint16_t handle)
++{
++ log(&routingDbus, DLT_LOG_INFO, "sending routingReady signal");
++ mCAmRoutingDBusMessageHandler.initSignal(std::string(ROUTING_NODE), "setRoutingReady");
++ mCAmRoutingDBusMessageHandler.sendMessage();
++ mIAmRoutingReceiverShadowDbus.gotReady(mMapDomains.size(),handle);
++}
++
++void CAmRoutingSenderDbus::setRoutingRundown(const uint16_t handle)
++{
++ mCAmRoutingDBusMessageHandler.initSignal(std::string(ROUTING_NODE), "setRoutingRundown");
++ mCAmRoutingDBusMessageHandler.sendMessage();
++ mIAmRoutingReceiverShadowDbus.gotRundown(mMapDomains.size(),handle);
++}
++
++am_Error_e CAmRoutingSenderDbus::asyncAbort(const am_Handle_s handle)
++{
++ log(&routingDbus, DLT_LOG_INFO, "CAmRoutingSenderDbus::asyncAbort called");
++ mapHandles_t::iterator iter = mMapHandles.begin();
++ iter = mMapHandles.find(handle.handle);
++ if (iter != mMapHandles.end())
++ {
++ CAmRoutingDbusSend send(mpDBusConnection, iter->second.busname, iter->second.path, iter->second.interface, "asyncAbort");
++ send.append(handle.handle);
++ return (send.send());
++ }
++ log(&routingDbus, DLT_LOG_ERROR, "CAmRoutingSenderDbus::asyncAbort could not find interface");
++ return (E_UNKNOWN);
++
++}
++
++am_Error_e CAmRoutingSenderDbus::asyncConnect(const am_Handle_s handle, const am_connectionID_t connectionID, const am_sourceID_t sourceID, const am_sinkID_t sinkID, const am_CustomAvailabilityReason_t connectionFormat)
++{
++ log(&routingDbus, DLT_LOG_INFO, "CAmRoutingSenderDbus::asyncConnect called");
++ mapSources_t::iterator iter = mMapSources.begin();
++ iter = mMapSources.find(sourceID);
++ if (iter != mMapSources.end())
++ {
++ CAmRoutingDbusSend send(mpDBusConnection, iter->second.busname, iter->second.path, iter->second.interface, "asyncConnect");
++ send.append(handle.handle);
++ send.append(connectionID);
++ send.append(sourceID);
++ send.append(sinkID);
++ send.append(static_cast<int32_t>(connectionFormat));
++ mMapConnections.insert(std::make_pair(connectionID, (iter->second)));
++ mMapHandles.insert(std::make_pair(+handle.handle, iter->second));
++ return (send.sendAsync());
++ }
++ log(&routingDbus, DLT_LOG_ERROR, "CAmRoutingSenderDbus::asyncConnect could not find interface");
++ return (E_UNKNOWN);
++}
++
++am_Error_e CAmRoutingSenderDbus::asyncDisconnect(const am_Handle_s handle, const am_connectionID_t connectionID)
++{
++ log(&routingDbus, DLT_LOG_INFO, "CAmRoutingSenderDbus::asyncDisconnect called");
++ mapConnections_t::iterator iter = mMapConnections.begin();
++ iter = mMapConnections.find(connectionID);
++ if (iter != mMapConnections.end())
++ {
++ CAmRoutingDbusSend send(mpDBusConnection, iter->second.busname, iter->second.path, iter->second.interface, "asyncDisconnect");
++ send.append(handle.handle);
++ send.append(connectionID);
++ mMapHandles.insert(std::make_pair(+handle.handle, iter->second));
++ return (send.sendAsync());
++ }
++ log(&routingDbus, DLT_LOG_ERROR, "CAmRoutingSenderDbus::asyncDisconnect could not find interface");
++ return (E_UNKNOWN);
++}
++
++am_Error_e CAmRoutingSenderDbus::asyncSetSinkVolume(const am_Handle_s handle, const am_sinkID_t sinkID, const am_volume_t volume, const am_CustomRampType_t ramp, const am_time_t time)
++{
++ log(&routingDbus, DLT_LOG_INFO, "CAmRoutingSenderDbus::asyncSetSinkVolume called");
++ mapSinks_t::iterator iter = mMapSinks.begin();
++ iter = mMapSinks.find(sinkID);
++ if (iter != mMapSinks.end())
++ {
++ CAmRoutingDbusSend send(mpDBusConnection, iter->second.busname, iter->second.path, iter->second.interface, "asyncSetSinkVolume");
++ send.append(handle.handle);
++ send.append(sinkID);
++ send.append(volume);
++ send.append(static_cast<int16_t>(ramp));
++ send.append(time);
++ mMapHandles.insert(std::make_pair(+handle.handle, iter->second));
++ return (send.sendAsync());
++ }
++ log(&routingDbus, DLT_LOG_ERROR, "CAmRoutingSenderDbus::asyncSetSinkVolume could not find interface");
++ return (E_UNKNOWN);
++}
++
++am_Error_e CAmRoutingSenderDbus::asyncSetSourceVolume(const am_Handle_s handle, const am_sourceID_t sourceID, const am_volume_t volume, const am_CustomRampType_t ramp, const am_time_t time)
++{
++ log(&routingDbus, DLT_LOG_INFO, "CAmRoutingSenderDbus::asyncSetSourceVolume called");
++ mapSources_t::iterator iter = mMapSources.begin();
++ iter = mMapSources.find(sourceID);
++ if (iter != mMapSources.end())
++ {
++ CAmRoutingDbusSend send(mpDBusConnection, iter->second.busname, iter->second.path, iter->second.interface, "asyncSetSourceVolume");
++ send.append(handle.handle);
++ send.append(sourceID);
++ send.append(volume);
++ send.append(static_cast<int16_t>(ramp));
++ send.append(time);
++ mMapHandles.insert(std::make_pair(+handle.handle, iter->second));
++ return (send.sendAsync());
++ }
++ log(&routingDbus, DLT_LOG_ERROR, "CAmRoutingSenderDbus::asyncSetSourceVolume could not find interface");
++ return (E_UNKNOWN);
++}
++
++am_Error_e CAmRoutingSenderDbus::asyncSetSourceState(const am_Handle_s handle, const am_sourceID_t sourceID, const am_SourceState_e state)
++{
++ log(&routingDbus, DLT_LOG_INFO, "CAmRoutingSenderDbus::asyncSetSourceState called");
++ mapSources_t::iterator iter = mMapSources.begin();
++ iter = mMapSources.find(sourceID);
++ if (iter != mMapSources.end())
++ {
++ CAmRoutingDbusSend send(mpDBusConnection, iter->second.busname, iter->second.path, iter->second.interface, "asyncSetSourceState");
++ send.append(handle.handle);
++ send.append(sourceID);
++ send.append(static_cast<int32_t>(state));
++ mMapHandles.insert(std::make_pair(+handle.handle, iter->second));
++ return (send.sendAsync());
++ }
++ log(&routingDbus, DLT_LOG_ERROR, "CAmRoutingSenderDbus::asyncSetSourceState could not find interface");
++ return (E_UNKNOWN);
++}
++
++am_Error_e CAmRoutingSenderDbus::asyncSetSinkSoundProperties(const am_Handle_s handle, const am_sinkID_t sinkID, const std::vector<am_SoundProperty_s>& listSoundProperties)
++{
++ log(&routingDbus, DLT_LOG_INFO, "CAmRoutingSenderDbus::asyncSetSinkSoundProperties called");
++ mapSinks_t::iterator iter = mMapSinks.begin();
++ iter = mMapSinks.find(sinkID);
++ if (iter != mMapSinks.end())
++ {
++ CAmRoutingDbusSend send(mpDBusConnection, iter->second.busname, iter->second.path, iter->second.interface, "asyncSetSinkSoundProperties");
++ send.append(handle.handle);
++ send.append(sinkID);
++ send.append(listSoundProperties);
++ mMapHandles.insert(std::make_pair(+handle.handle, iter->second));
++ return (send.sendAsync());
++ }
++ log(&routingDbus, DLT_LOG_ERROR, "CAmRoutingSenderDbus::asyncSetSinkSoundProperties could not find interface");
++ return (E_UNKNOWN);
++}
++
++am_Error_e CAmRoutingSenderDbus::asyncSetSinkSoundProperty(const am_Handle_s handle, const am_sinkID_t sinkID, const am_SoundProperty_s& soundProperty)
++{
++ log(&routingDbus, DLT_LOG_INFO, "CAmRoutingSenderDbus::asyncSetSinkSoundProperty called");
++ mapSinks_t::iterator iter = mMapSinks.begin();
++ iter = mMapSinks.find(sinkID);
++ if (iter != mMapSinks.end())
++ {
++ CAmRoutingDbusSend send(mpDBusConnection, iter->second.busname, iter->second.path, iter->second.interface, "asyncSetSinkSoundProperty");
++ send.append(handle.handle);
++ send.append(sinkID);
++ send.append(soundProperty);
++ mMapHandles.insert(std::make_pair(+handle.handle, iter->second));
++ return (send.sendAsync());
++ }
++ log(&routingDbus, DLT_LOG_ERROR, "CAmRoutingSenderDbus::asyncSetSinkSoundProperty could not find interface");
++ return (E_UNKNOWN);
++}
++
++am_Error_e CAmRoutingSenderDbus::asyncSetSourceSoundProperties(const am_Handle_s handle, const am_sourceID_t sourceID, const std::vector<am_SoundProperty_s>& listSoundProperties)
++{
++ log(&routingDbus, DLT_LOG_INFO, "CAmRoutingSenderDbus::asyncSetSourceSoundProperties called");
++ mapSources_t::iterator iter = mMapSources.begin();
++ iter = mMapSources.find(sourceID);
++ if (iter != mMapSources.end())
++ {
++ CAmRoutingDbusSend send(mpDBusConnection, iter->second.busname, iter->second.path, iter->second.interface, "asyncSetSourceSoundProperties");
++ send.append(handle.handle);
++ send.append(sourceID);
++ send.append(listSoundProperties);
++ mMapHandles.insert(std::make_pair(+handle.handle, iter->second));
++ return (send.sendAsync());
++ }
++ log(&routingDbus, DLT_LOG_ERROR, "CAmRoutingSenderDbus::asyncSetSourceSoundProperties could not find interface");
++ return (E_UNKNOWN);
++}
++
++am_Error_e CAmRoutingSenderDbus::asyncSetSourceSoundProperty(const am_Handle_s handle, const am_sourceID_t sourceID, const am_SoundProperty_s& soundProperty)
++{
++ log(&routingDbus, DLT_LOG_INFO, "CAmRoutingSenderDbus::asyncSetSourceSoundProperty called");
++ mapSources_t::iterator iter = mMapSources.begin();
++ iter = mMapSources.find(sourceID);
++ if (iter != mMapSources.end())
++ {
++ CAmRoutingDbusSend send(mpDBusConnection, iter->second.busname, iter->second.path, iter->second.interface, "asyncSetSourceSoundProperty");
++ send.append(handle.handle);
++ send.append(sourceID);
++ send.append(soundProperty);
++ mMapHandles.insert(std::make_pair(+handle.handle, iter->second));
++ return (send.sendAsync());
++ }
++ log(&routingDbus, DLT_LOG_ERROR, "CAmRoutingSenderDbus::asyncSetSourceSoundProperty could not find interface");
++ return (E_UNKNOWN);
++}
++
++am_Error_e CAmRoutingSenderDbus::asyncCrossFade(const am_Handle_s handle, const am_crossfaderID_t crossfaderID, const am_HotSink_e hotSink, const am_CustomRampType_t rampType, const am_time_t time)
++{
++ (void)handle;
++ (void)crossfaderID;
++ (void)hotSink;
++ (void)rampType;
++ (void)time;
++ //todo implement
++ return (E_NON_EXISTENT);
++}
++
++am_Error_e CAmRoutingSenderDbus::setDomainState(const am_domainID_t domainID, const am_DomainState_e domainState)
++{
++ log(&routingDbus, DLT_LOG_INFO, "CAmRoutingSenderDbus::setDomainState called");
++ mapDomain_t::iterator iter = mMapDomains.begin();
++ iter = mMapDomains.find(domainID);
++ if (iter != mMapDomains.end())
++ {
++ CAmRoutingDbusSend send(mpDBusConnection, iter->second.busname, iter->second.path, iter->second.interface, "setDomainState");
++ send.append(domainID);
++ send.append(static_cast<uint16_t>(domainState));
++ return (send.send());
++ }
++ log(&routingDbus, DLT_LOG_ERROR, "CAmRoutingSenderDbus::setDomainState could not find interface");
++ return (E_UNKNOWN);
++}
++
++am_Error_e CAmRoutingSenderDbus::returnBusName(std::string& BusName) const
++{
++ BusName = "DbusRoutingPlugin";
++ return (E_OK);
++}
++
++void CAmRoutingSenderDbus::removeHandle(uint16_t handle)
++{
++ mMapHandles.erase(handle);
++}
++
++void CAmRoutingSenderDbus::addDomainLookup(am_domainID_t domainID, rs_lookupData_s lookupData)
++{
++ mMapDomains.insert(std::make_pair(domainID, lookupData));
++}
++
++void CAmRoutingSenderDbus::addSourceLookup(am_sourceID_t sourceID, am_domainID_t domainID)
++{
++ mapDomain_t::iterator iter(mMapDomains.begin());
++ iter = mMapDomains.find(domainID);
++ if (iter != mMapDomains.end())
++ {
++ mMapSources.insert(std::make_pair(sourceID, iter->second));
++ }
++}
++
++void CAmRoutingSenderDbus::addSinkLookup(am_sinkID_t sinkID, am_domainID_t domainID)
++{
++ mapDomain_t::iterator iter(mMapDomains.begin());
++ iter = mMapDomains.find(domainID);
++ if (iter != mMapDomains.end())
++ {
++ mMapSinks.insert(std::make_pair(sinkID, iter->second));
++ }
++}
++
++template <typename TKey> void CAmRoutingSenderDbus::removeEntriesForValue(const rs_lookupData_s & value, std::map<TKey,rs_lookupData_s> & map)
++{
++ typename std::map<TKey,rs_lookupData_s>::iterator it = map.begin();
++ while ( it != map.end() )
++ {
++ if (it->second.busname == value.busname &&
++ it->second.interface == value.interface &&
++ it->second.path == value.path)
++ {
++ typename std::map<TKey,rs_lookupData_s>::iterator it_tmp = it;
++ it++;
++ map.erase(it_tmp);
++ }
++ else
++ ++it;
++ }
++}
++
++void CAmRoutingSenderDbus::removeDomainLookup(am_domainID_t domainID)
++{
++ mapDomain_t::iterator iter(mMapDomains.begin());
++ iter = mMapDomains.find(domainID);
++ if (iter != mMapDomains.end())
++ {
++ CAmRoutingSenderDbus::removeEntriesForValue(iter->second, mMapSources);
++ CAmRoutingSenderDbus::removeEntriesForValue(iter->second, mMapSinks);
++ CAmRoutingSenderDbus::removeEntriesForValue(iter->second, mMapHandles);
++ CAmRoutingSenderDbus::removeEntriesForValue(iter->second, mMapConnections);
++ mMapDomains.erase(domainID);
++ }
++}
++
++void CAmRoutingSenderDbus::removeSourceLookup(am_sourceID_t sourceID)
++{
++ mMapSources.erase(sourceID);
++}
++
++void CAmRoutingSenderDbus::removeSinkLookup(am_sinkID_t sinkID)
++{
++ mMapSinks.erase(sinkID);
++}
++
++am_Error_e CAmRoutingSenderDbus::asyncSetVolumes(const am_Handle_s handle, const std::vector<am_Volumes_s>& listVolumes)
++{
++ (void) handle;
++ (void) listVolumes;
++ //todo: implement asyncSetVolumes;
++ return (E_NOT_USED);
++}
++
++am_Error_e CAmRoutingSenderDbus::asyncSetSinkNotificationConfiguration(const am_Handle_s handle, const am_sinkID_t sinkID, const am_NotificationConfiguration_s& notificationConfiguration)
++{
++ (void) handle;
++ (void) sinkID;
++ (void) notificationConfiguration;
++ //todo: implement asyncSetSinkNotificationConfiguration;
++ return (E_NOT_USED);
++}
++
++am_Error_e CAmRoutingSenderDbus::asyncSetSourceNotificationConfiguration(const am_Handle_s handle, const am_sourceID_t sourceID, const am_NotificationConfiguration_s& notificationConfiguration)
++{
++ (void) handle;
++ (void) sourceID;
++ (void) notificationConfiguration;
++ //todo: implement asyncSetSourceNotificationConfiguration;
++ return (E_NOT_USED);
++}
++
++}
++
+diff --git a/PluginRoutingInterfaceDbus/src/IAmRoutingReceiverShadow.cpp b/PluginRoutingInterfaceDbus/src/IAmRoutingReceiverShadow.cpp
+new file mode 100644
+index 0000000..57d669e
+--- /dev/null
++++ b/PluginRoutingInterfaceDbus/src/IAmRoutingReceiverShadow.cpp
+@@ -0,0 +1,977 @@
++/**
++ * Copyright (c) copyright 2011-2012 Aricent® Group and its licensors
++ * Copyright (c) 2012 BMW
++ *
++ * \author Sampreeth Ramavana
++ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
++ *
++ * \copyright
++ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction,
++ * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
++ * subject to the following conditions:
++ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
++ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
++ * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
++ *
++ * For further information see http://www.genivi.org/.
++ */
++
++#include "../../PluginRoutingInterfaceDbus/include/IAmRoutingReceiverShadow.h"
++
++#include <string.h>
++#include <fstream>
++#include <stdexcept>
++#include <cassert>
++
++#include "../../PluginRoutingInterfaceDbus/include/configRoutingDbus.h"
++#include "../../PluginRoutingInterfaceDbus/include/CAmRoutingSenderDbus.h"
++#include "CAmDbusWrapper.h"
++#include "CAmDltWrapper.h"
++
++namespace am
++{
++
++DLT_IMPORT_CONTEXT(routingDbus)
++
++
++/**
++ * static ObjectPathTable is needed for DBus Callback handling
++ */
++static DBusObjectPathVTable gObjectPathVTable;
++
++IAmRoutingReceiverShadowDbus::IAmRoutingReceiverShadowDbus(CAmRoutingSenderDbus* pRoutingSenderDbus) :
++ mRoutingReceiveInterface(NULL), //
++ mDBusWrapper(NULL), //
++ mpRoutingSenderDbus(pRoutingSenderDbus), //
++ mFunctionMap(createMap()), //
++ mDBUSMessageHandler(), //
++ mNumberDomains(0), //
++ mHandle(0), //
++ mRoutingReady(false)
++{
++ log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow constructed");
++}
++
++IAmRoutingReceiverShadowDbus::~IAmRoutingReceiverShadowDbus()
++{
++ log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow destructed");
++}
++
++void IAmRoutingReceiverShadowDbus::registerDomain(DBusConnection *conn, DBusMessage *msg)
++{
++ log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::registerDomain called");
++
++ (void) ((conn));
++ assert(mRoutingReceiveInterface != NULL);
++ mDBUSMessageHandler.initReceive(msg);
++ am_Domain_s domain(mDBUSMessageHandler.getDomainData());
++ CAmRoutingSenderDbus::rs_lookupData_s lookupData;
++ lookupData.busname = mDBUSMessageHandler.getString();
++ lookupData.path = mDBUSMessageHandler.getString();
++ lookupData.interface = mDBUSMessageHandler.getString();
++ log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::registerDomain called, name ", domain.name, "nodename ", domain.nodename);
++ domain.busname = "DbusRoutingPlugin";
++ am_Error_e returnCode = mRoutingReceiveInterface->registerDomain(domain, domain.domainID);
++ mDBUSMessageHandler.initReply(msg);
++ mDBUSMessageHandler.append(domain.domainID);
++ mDBUSMessageHandler.append(returnCode);
++ mDBUSMessageHandler.sendMessage();
++ if (returnCode != E_OK)
++ {
++ log(&routingDbus, DLT_LOG_INFO, "error registering domain");
++ return;
++ }
++ mpRoutingSenderDbus->addDomainLookup(domain.domainID, lookupData);
++}
++
++void IAmRoutingReceiverShadowDbus::registerSource(DBusConnection* conn, DBusMessage* msg)
++{
++ log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::RegisterSource called");
++ (void) ((conn));
++ assert(mRoutingReceiveInterface != NULL);
++ mDBUSMessageHandler.initReceive(msg);
++ am_Source_s sourceData(mDBUSMessageHandler.getSourceData());
++ log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::registerSource called, name", sourceData.name, "mSource.sourceClassID", sourceData.sourceClassID, "mSource.domainID", sourceData.domainID);
++ am_Error_e returnCode = mRoutingReceiveInterface->registerSource(sourceData, sourceData.sourceID);
++ mDBUSMessageHandler.initReply(msg);
++ mDBUSMessageHandler.append(sourceData.sourceID);
++ mDBUSMessageHandler.append(returnCode);
++ mDBUSMessageHandler.sendMessage();
++ if (returnCode != E_OK)
++ {
++ log(&routingDbus, DLT_LOG_INFO, "error registering source");
++ return;
++ }
++ mpRoutingSenderDbus->addSourceLookup(sourceData.sourceID, sourceData.domainID);
++}
++
++void IAmRoutingReceiverShadowDbus::registerSink(DBusConnection* conn, DBusMessage* msg)
++{
++ (void) ((conn));
++ assert(mRoutingReceiveInterface != NULL);
++ mDBUSMessageHandler.initReceive(msg);
++ am_Sink_s sinkData(mDBUSMessageHandler.getSinkData());
++ log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::registerSink called, name", sinkData.name, "mSink.sinkClassID", sinkData.sinkClassID, "mSink.domainID", sinkData.domainID);
++ am_Error_e returnCode = mRoutingReceiveInterface->registerSink(sinkData, sinkData.sinkID);
++ mDBUSMessageHandler.initReply(msg);
++ mDBUSMessageHandler.append(sinkData.sinkID);
++ mDBUSMessageHandler.append(returnCode);
++ mDBUSMessageHandler.sendMessage();
++ if (returnCode != E_OK)
++ {
++ log(&routingDbus, DLT_LOG_INFO, "error registering sink");
++ return;
++ }
++ mpRoutingSenderDbus->addSinkLookup(sinkData.sinkID, sinkData.domainID);
++}
++
++void IAmRoutingReceiverShadowDbus::registerGateway(DBusConnection* conn, DBusMessage* msg)
++{
++ (void) ((conn));
++ assert(mRoutingReceiveInterface != NULL);
++ mDBUSMessageHandler.initReceive(msg);
++ am_Gateway_s gatewayData(mDBUSMessageHandler.getGatewayData());
++ am_Error_e returnCode = mRoutingReceiveInterface->registerGateway(gatewayData, gatewayData.gatewayID);
++ mDBUSMessageHandler.initReply(msg);
++ mDBUSMessageHandler.append(gatewayData.gatewayID);
++ mDBUSMessageHandler.append(returnCode);
++ mDBUSMessageHandler.sendMessage();
++ if (returnCode != E_OK)
++ {
++ log(&routingDbus, DLT_LOG_INFO, "error registering gateway");
++ return;
++ }
++}
++
++void IAmRoutingReceiverShadowDbus::registerConverter(DBusConnection* conn, DBusMessage* msg)
++{
++ (void) ((conn));
++ assert(mRoutingReceiveInterface != NULL);
++ mDBUSMessageHandler.initReceive(msg);
++ am_Converter_s gatewayData(mDBUSMessageHandler.getConverterData());
++ am_Error_e returnCode = mRoutingReceiveInterface->registerConverter(gatewayData, gatewayData.converterID);
++ mDBUSMessageHandler.initReply(msg);
++ mDBUSMessageHandler.append(gatewayData.converterID);
++ mDBUSMessageHandler.append(returnCode);
++ mDBUSMessageHandler.sendMessage();
++ if (returnCode != E_OK)
++ {
++ log(&routingDbus, DLT_LOG_INFO, "error registering gateway");
++ return;
++ }
++}
++
++void IAmRoutingReceiverShadowDbus::hookDomainRegistrationComplete(DBusConnection* conn, DBusMessage* msg)
++{
++ (void) ((conn));
++ assert(mRoutingReceiveInterface != NULL);
++ mDBUSMessageHandler.initReceive(msg);
++ am_domainID_t domainID(mDBUSMessageHandler.getUInt());
++ log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::hookDomainRegistrationComplete called, domainID", domainID);
++ mRoutingReceiveInterface->hookDomainRegistrationComplete((am_domainID_t)((domainID)));
++ mDBUSMessageHandler.initReply(msg);
++ mDBUSMessageHandler.sendMessage();
++}
++
++void IAmRoutingReceiverShadowDbus::ackConnect(DBusConnection* conn, DBusMessage* msg)
++{
++ (void) ((conn));
++ assert(mRoutingReceiveInterface != NULL);
++ mDBUSMessageHandler.initReceive(msg);
++ uint16_t handle(mDBUSMessageHandler.getUInt());
++ am_connectionID_t connectionID(mDBUSMessageHandler.getUInt());
++ am_Error_e error((am_Error_e)((mDBUSMessageHandler.getUInt())));
++ log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::ackConnect called, handle", handle, "connectionID", connectionID, "error", error);
++ am_Handle_s myhandle;
++ myhandle.handleType = H_CONNECT;
++ myhandle.handle = handle;
++ mRoutingReceiveInterface->ackConnect(myhandle, connectionID, error);
++ mpRoutingSenderDbus->removeHandle(handle);
++ mDBUSMessageHandler.initReply(msg);
++ mDBUSMessageHandler.sendMessage();
++}
++
++void IAmRoutingReceiverShadowDbus::ackDisconnect(DBusConnection* conn, DBusMessage* msg)
++{
++ (void) ((conn));
++ assert(mRoutingReceiveInterface != NULL);
++ mDBUSMessageHandler.initReceive(msg);
++ uint16_t handle(mDBUSMessageHandler.getUInt());
++ am_connectionID_t connectionID(mDBUSMessageHandler.getUInt());
++ am_Error_e error((am_Error_e)((mDBUSMessageHandler.getUInt())));
++ log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::ackDisconnect called, handle", handle, "connectionID", connectionID, "error", error);
++ am_Handle_s myhandle;
++ myhandle.handleType = H_DISCONNECT;
++ myhandle.handle = handle;
++ mRoutingReceiveInterface->ackDisconnect(myhandle, connectionID, error);
++ mpRoutingSenderDbus->removeHandle(handle);
++ //todo: Connection removal ???
++ mDBUSMessageHandler.initReply(msg);
++ mDBUSMessageHandler.sendMessage();
++}
++
++void IAmRoutingReceiverShadowDbus::ackSetSinkVolume(DBusConnection* conn, DBusMessage* msg)
++{
++ (void) ((conn));
++ assert(mRoutingReceiveInterface != NULL);
++ mDBUSMessageHandler.initReceive(msg);
++ uint16_t handle(mDBUSMessageHandler.getUInt());
++ am_volume_t volume(mDBUSMessageHandler.getInt());
++ am_Error_e error((am_Error_e)((mDBUSMessageHandler.getUInt())));
++ log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::ackSetSinkVolume called, handle", handle, "error", error, "volume", volume);
++ am_Handle_s myhandle;
++ myhandle.handleType = H_SETSINKVOLUME;
++ myhandle.handle = handle;
++ mRoutingReceiveInterface->ackSetSinkVolumeChange(myhandle, volume, error);
++ mpRoutingSenderDbus->removeHandle(handle);
++ mDBUSMessageHandler.initReply(msg);
++ mDBUSMessageHandler.sendMessage();
++}
++
++void IAmRoutingReceiverShadowDbus::ackSetSourceState(DBusConnection* conn, DBusMessage* msg)
++{
++ (void) ((conn));
++ assert(mRoutingReceiveInterface != NULL);
++ mDBUSMessageHandler.initReceive(msg);
++ uint16_t handle(mDBUSMessageHandler.getUInt());
++ am_Error_e error((am_Error_e)((mDBUSMessageHandler.getUInt())));
++ log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::ackSetSourceState called, handle", handle, "error", error);
++ am_Handle_s myhandle;
++ myhandle.handleType = H_SETSOURCESTATE;
++ myhandle.handle = handle;
++ mRoutingReceiveInterface->ackSetSourceState(myhandle, error);
++ mpRoutingSenderDbus->removeHandle(handle);
++ mDBUSMessageHandler.initReply(msg);
++ mDBUSMessageHandler.sendMessage();
++}
++
++void IAmRoutingReceiverShadowDbus::ackSinkVolumeTick(DBusConnection* conn, DBusMessage* msg)
++{
++ (void) ((conn));
++ assert(mRoutingReceiveInterface != NULL);
++ mDBUSMessageHandler.initReceive(msg);
++ uint16_t handle(mDBUSMessageHandler.getUInt());
++ am_sinkID_t sinkID(mDBUSMessageHandler.getUInt());
++ am_volume_t volume(mDBUSMessageHandler.getInt());
++ log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::ackSinkVolumeTick called, handle", handle, "sinkID", sinkID, "volume", volume);
++ am_Handle_s myhandle;
++ myhandle.handleType = H_SETSINKVOLUME;
++ myhandle.handle = handle;
++ mRoutingReceiveInterface->ackSinkVolumeTick(myhandle, sinkID, volume);
++ mDBUSMessageHandler.initReply(msg);
++ mDBUSMessageHandler.sendMessage();
++}
++
++void IAmRoutingReceiverShadowDbus::ackSourceVolumeTick(DBusConnection* conn, DBusMessage* msg)
++{
++ (void) ((conn));
++ assert(mRoutingReceiveInterface != NULL);
++ mDBUSMessageHandler.initReceive(msg);
++ uint16_t handle(mDBUSMessageHandler.getUInt());
++ am_sourceID_t sourceID(mDBUSMessageHandler.getUInt());
++ am_volume_t volume(mDBUSMessageHandler.getInt());
++ log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::ackSourceVolumeTick called, handle", handle, "sourceID", sourceID, "volume", volume);
++ am_Handle_s myhandle;
++ myhandle.handleType = H_SETSOURCEVOLUME;
++ myhandle.handle = handle;
++ mRoutingReceiveInterface->ackSourceVolumeTick(myhandle, sourceID, volume);
++ mDBUSMessageHandler.initReply(msg);
++ mDBUSMessageHandler.sendMessage();
++}
++
++void IAmRoutingReceiverShadowDbus::ackSetSourceVolume(DBusConnection* conn, DBusMessage* msg)
++{
++ (void) ((conn));
++ assert(mRoutingReceiveInterface != NULL);
++ mDBUSMessageHandler.initReceive(msg);
++ uint16_t handle(mDBUSMessageHandler.getUInt());
++ am_volume_t volume(mDBUSMessageHandler.getInt());
++ am_Error_e error((am_Error_e)((mDBUSMessageHandler.getUInt())));
++ log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::ackSetSourceVolume called, handle", handle, "volume", volume, "error", error);
++ am_Handle_s myhandle;
++ myhandle.handleType = H_SETSOURCEVOLUME;
++ myhandle.handle = handle;
++ mRoutingReceiveInterface->ackSetSourceVolumeChange(myhandle, volume, error);
++ mpRoutingSenderDbus->removeHandle(handle);
++ mDBUSMessageHandler.initReply(msg);
++ mDBUSMessageHandler.sendMessage();
++}
++
++void IAmRoutingReceiverShadowDbus::ackSetSinkSoundProperty(DBusConnection* conn, DBusMessage* msg)
++{
++ (void) ((conn));
++ assert(mRoutingReceiveInterface != NULL);
++ mDBUSMessageHandler.initReceive(msg);
++ uint16_t handle(mDBUSMessageHandler.getUInt());
++ am_Error_e error((am_Error_e)((mDBUSMessageHandler.getUInt())));
++ log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::ackSetSinkSoundProperty called, handle", handle, "error", error);
++ am_Handle_s myhandle;
++ myhandle.handleType = H_SETSINKSOUNDPROPERTY;
++ myhandle.handle = handle;
++ mRoutingReceiveInterface->ackSetSinkSoundProperty(myhandle, error);
++ mpRoutingSenderDbus->removeHandle(handle);
++ mDBUSMessageHandler.initReply(msg);
++ mDBUSMessageHandler.sendMessage();
++}
++
++void IAmRoutingReceiverShadowDbus::ackSetSourceSoundProperty(DBusConnection* conn, DBusMessage* msg)
++{
++ (void) ((conn));
++ assert(mRoutingReceiveInterface != NULL);
++ mDBUSMessageHandler.initReceive(msg);
++ uint16_t handle(mDBUSMessageHandler.getUInt());
++ am_Error_e error((am_Error_e)((mDBUSMessageHandler.getUInt())));
++ log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::ackSetSinkSoundProperty called, handle", handle, "error", error);
++ am_Handle_s myhandle;
++ myhandle.handleType = H_SETSOURCESOUNDPROPERTY;
++ myhandle.handle = handle;
++ mRoutingReceiveInterface->ackSetSourceSoundProperty(myhandle, error);
++ mpRoutingSenderDbus->removeHandle(handle);
++ mDBUSMessageHandler.initReply(msg);
++ mDBUSMessageHandler.sendMessage();
++}
++
++void IAmRoutingReceiverShadowDbus::ackSetSinkSoundProperties(DBusConnection* conn, DBusMessage* msg)
++{
++ (void) ((conn));
++ assert(mRoutingReceiveInterface != NULL);
++ mDBUSMessageHandler.initReceive(msg);
++ uint16_t handle = mDBUSMessageHandler.getUInt();
++ am_Error_e error = (am_Error_e)((mDBUSMessageHandler.getUInt()));
++ log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::ackSetSinkSoundProperties called, handle", handle, "error", error);
++ am_Handle_s myhandle;
++ myhandle.handleType = H_SETSINKSOUNDPROPERTIES;
++ myhandle.handle = handle;
++ mRoutingReceiveInterface->ackSetSinkSoundProperties(myhandle, error);
++ mpRoutingSenderDbus->removeHandle(handle);
++ mDBUSMessageHandler.initReply(msg);
++ mDBUSMessageHandler.sendMessage();
++}
++
++void IAmRoutingReceiverShadowDbus::ackSetSourceSoundProperties(DBusConnection* conn, DBusMessage* msg)
++{
++ (void) ((conn));
++ assert(mRoutingReceiveInterface != NULL);
++ mDBUSMessageHandler.initReceive(msg);
++ uint16_t handle = mDBUSMessageHandler.getUInt();
++ am_Error_e error = (am_Error_e)((mDBUSMessageHandler.getUInt()));
++ log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::ackSetSourceSoundProperties called, handle", handle, "error", error);
++ am_Handle_s myhandle;
++ myhandle.handleType = H_SETSOURCESOUNDPROPERTIES;
++ myhandle.handle = handle;
++ mRoutingReceiveInterface->ackSetSourceSoundProperties(myhandle, error);
++ mpRoutingSenderDbus->removeHandle(handle);
++ mDBUSMessageHandler.initReply(msg);
++ mDBUSMessageHandler.sendMessage();
++}
++
++void IAmRoutingReceiverShadowDbus::ackCrossFading(DBusConnection* conn, DBusMessage* msg)
++{
++ (void) ((conn));
++ assert(mRoutingReceiveInterface != NULL);
++ mDBUSMessageHandler.initReceive(msg);
++ uint16_t handle = mDBUSMessageHandler.getUInt();
++ am_HotSink_e hotsink = (am_HotSink_e)((mDBUSMessageHandler.getInt()));
++ am_Error_e error = (am_Error_e)((mDBUSMessageHandler.getUInt()));
++ log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::ackCrossFading called, handle", handle, "error", error);
++ am_Handle_s myhandle;
++ myhandle.handleType = H_CROSSFADE;
++ myhandle.handle = handle;
++ mRoutingReceiveInterface->ackCrossFading(myhandle, hotsink, error);
++ mpRoutingSenderDbus->removeHandle(handle);
++ mDBUSMessageHandler.initReply(msg);
++ mDBUSMessageHandler.sendMessage();
++}
++
++void IAmRoutingReceiverShadowDbus::peekDomain(DBusConnection* conn, DBusMessage* msg)
++{
++ (void) ((conn));
++ assert(mRoutingReceiveInterface != NULL);
++ mDBUSMessageHandler.initReceive(msg);
++ std::string name = std::string(mDBUSMessageHandler.getString());
++ log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::peekDomain called, name", name);
++ am_domainID_t domainID;
++ am_Error_e returnCode = mRoutingReceiveInterface->peekDomain(name, domainID);
++ mDBUSMessageHandler.initReply(msg);
++ mDBUSMessageHandler.append(domainID);
++ mDBUSMessageHandler.append(returnCode);
++ mDBUSMessageHandler.sendMessage();
++}
++
++void IAmRoutingReceiverShadowDbus::deregisterDomain(DBusConnection* conn, DBusMessage* msg)
++{
++ (void) ((conn));
++ assert(mRoutingReceiveInterface != NULL);
++ mDBUSMessageHandler.initReceive(msg);
++ am_domainID_t domainID = mDBUSMessageHandler.getUInt();
++ log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::deregisterDomain called, id", domainID);
++ am_Error_e returnCode = mRoutingReceiveInterface->deregisterDomain(domainID);
++ mDBUSMessageHandler.initReply(msg);
++ mDBUSMessageHandler.append(returnCode);
++ mDBUSMessageHandler.sendMessage();
++ mpRoutingSenderDbus->removeDomainLookup(domainID);
++}
++
++void IAmRoutingReceiverShadowDbus::deregisterGateway(DBusConnection* conn, DBusMessage* msg)
++{
++ (void) ((conn));
++ assert(mRoutingReceiveInterface != NULL);
++ mDBUSMessageHandler.initReceive(msg);
++ am_gatewayID_t gatewayID = mDBUSMessageHandler.getUInt();
++ log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::deregisterGateway called, id", gatewayID);
++ am_Error_e returnCode = mRoutingReceiveInterface->deregisterGateway(gatewayID);
++ mDBUSMessageHandler.initReply(msg);
++ mDBUSMessageHandler.append(returnCode);
++ mDBUSMessageHandler.sendMessage();
++}
++
++void IAmRoutingReceiverShadowDbus::deregisterConverter(DBusConnection* conn, DBusMessage* msg)
++{
++ (void) ((conn));
++ assert(mRoutingReceiveInterface != NULL);
++ mDBUSMessageHandler.initReceive(msg);
++ am_converterID_t converterID = mDBUSMessageHandler.getUInt();
++ log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::deregisterGateway called, id", converterID);
++ am_Error_e returnCode = mRoutingReceiveInterface->deregisterConverter(converterID);
++ mDBUSMessageHandler.initReply(msg);
++ mDBUSMessageHandler.append(returnCode);
++ mDBUSMessageHandler.sendMessage();
++}
++
++void IAmRoutingReceiverShadowDbus::peekSink(DBusConnection* conn, DBusMessage* msg)
++{
++ (void) ((conn));
++ assert(mRoutingReceiveInterface != NULL);
++ mDBUSMessageHandler.initReceive(msg);
++ std::string name = std::string(mDBUSMessageHandler.getString());
++ log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::peekSink called, name", name);
++ am_sinkID_t sinkID;
++ am_Error_e returnCode = mRoutingReceiveInterface->peekSink(name, sinkID);
++ mDBUSMessageHandler.initReply(msg);
++ mDBUSMessageHandler.append(sinkID);
++ mDBUSMessageHandler.append(returnCode);
++ mDBUSMessageHandler.sendMessage();
++}
++
++void IAmRoutingReceiverShadowDbus::deregisterSink(DBusConnection* conn, DBusMessage* msg)
++{
++ (void) ((conn));
++ assert(mRoutingReceiveInterface != NULL);
++ mDBUSMessageHandler.initReceive(msg);
++ am_sinkID_t sinkID = mDBUSMessageHandler.getInt();
++ log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::deregisterSink called, id", sinkID);
++ am_Error_e returnCode = mRoutingReceiveInterface->deregisterSink(sinkID);
++ mDBUSMessageHandler.initReply(msg);
++ mDBUSMessageHandler.append(returnCode);
++ mDBUSMessageHandler.sendMessage();
++ mpRoutingSenderDbus->removeSinkLookup(sinkID);
++}
++
++void IAmRoutingReceiverShadowDbus::peekSource(DBusConnection* conn, DBusMessage* msg)
++{
++ (void) ((conn));
++ assert(mRoutingReceiveInterface != NULL);
++ mDBUSMessageHandler.initReceive(msg);
++ std::string name = std::string(mDBUSMessageHandler.getString());
++ log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::peekSource called, name", name);
++ am_sourceID_t sourceID;
++ am_Error_e returnCode = mRoutingReceiveInterface->peekSource(name, sourceID);
++ mDBUSMessageHandler.initReply(msg);
++ mDBUSMessageHandler.append(sourceID);
++ mDBUSMessageHandler.append(returnCode);
++ mDBUSMessageHandler.sendMessage();
++}
++
++void IAmRoutingReceiverShadowDbus::deregisterSource(DBusConnection* conn, DBusMessage* msg)
++{
++ (void) ((conn));
++ assert(mRoutingReceiveInterface != NULL);
++ mDBUSMessageHandler.initReceive(msg);
++ am_sourceID_t sourceID = mDBUSMessageHandler.getInt();
++ log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::deregisterSource called, id", sourceID);
++ am_Error_e returnCode = mRoutingReceiveInterface->deregisterSource(sourceID);
++ mDBUSMessageHandler.initReply(msg);
++ mDBUSMessageHandler.append(returnCode);
++ mDBUSMessageHandler.sendMessage();
++ mpRoutingSenderDbus->removeSourceLookup(sourceID);
++}
++
++void IAmRoutingReceiverShadowDbus::registerCrossfader(DBusConnection* conn, DBusMessage* msg)
++{
++ (void) ((conn));
++ assert(mRoutingReceiveInterface != NULL);
++ mDBUSMessageHandler.initReceive(msg);
++ am_Crossfader_s crossfader (mDBUSMessageHandler.getCrossfaderData());
++ log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::registerCrossfader called, name", crossfader.name);
++ am_Error_e returnCode = mRoutingReceiveInterface->registerCrossfader(crossfader, crossfader.crossfaderID);
++ mDBUSMessageHandler.initReply(msg);
++ mDBUSMessageHandler.append(crossfader.crossfaderID);
++ mDBUSMessageHandler.append(returnCode);
++ mDBUSMessageHandler.sendMessage();
++ if (returnCode != E_OK)
++ {
++ log(&routingDbus, DLT_LOG_INFO, "error registering crossfader");
++ return;
++ }
++ //todo: add Crossfader lookup
++}
++
++void IAmRoutingReceiverShadowDbus::deregisterCrossfader(DBusConnection* conn, DBusMessage* msg)
++{
++ (void) ((conn));
++ assert(mRoutingReceiveInterface != NULL);
++ mDBUSMessageHandler.initReceive(msg);
++ am_crossfaderID_t crossfaderID = mDBUSMessageHandler.getInt();
++ log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::deregisterCrossfader called, id", crossfaderID);
++ am_Error_e returnCode = mRoutingReceiveInterface->deregisterCrossfader(crossfaderID);
++ mDBUSMessageHandler.initReply(msg);
++ mDBUSMessageHandler.append(returnCode);
++ mDBUSMessageHandler.sendMessage();
++ //todo: remove Crossfader lookup
++}
++
++void IAmRoutingReceiverShadowDbus::peekSourceClassID(DBusConnection* conn, DBusMessage* msg)
++{
++ (void) ((conn));
++ assert(mRoutingReceiveInterface != NULL);
++ mDBUSMessageHandler.initReceive(msg);
++ std::string name = std::string(mDBUSMessageHandler.getString());
++ log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::peekSourceClassID called, name", name);
++ am_sourceClass_t sourceClassID;
++ am_Error_e returnCode = mRoutingReceiveInterface->peekSourceClassID(name, sourceClassID);
++ mDBUSMessageHandler.initReply(msg);
++ mDBUSMessageHandler.append(sourceClassID);
++ mDBUSMessageHandler.append(returnCode);
++ mDBUSMessageHandler.sendMessage();
++}
++
++void IAmRoutingReceiverShadowDbus::peekSinkClassID(DBusConnection* conn, DBusMessage* msg)
++{
++ (void) ((conn));
++ assert(mRoutingReceiveInterface != NULL);
++ mDBUSMessageHandler.initReceive(msg);
++ std::string name = std::string(mDBUSMessageHandler.getString());
++ log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::peekSinkClassID called, name", name);
++ am_sinkClass_t sinkClassID;
++ am_Error_e returnCode = mRoutingReceiveInterface->peekSinkClassID(name, sinkClassID);
++ mDBUSMessageHandler.initReply(msg);
++ mDBUSMessageHandler.append(sinkClassID);
++ mDBUSMessageHandler.append(returnCode);
++ mDBUSMessageHandler.sendMessage();
++}
++
++void IAmRoutingReceiverShadowDbus::hookInterruptStatusChange(DBusConnection* conn, DBusMessage* msg)
++{
++ (void) ((conn));
++ assert(mRoutingReceiveInterface != NULL);
++ mDBUSMessageHandler.initReceive(msg);
++ am_sourceID_t sourceID = mDBUSMessageHandler.getUInt();
++ am_InterruptState_e interruptState = (am_InterruptState_e)((mDBUSMessageHandler.getUInt()));
++ log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::hookInterruptStatusChange called, sourceID", sourceID);
++ mRoutingReceiveInterface->hookInterruptStatusChange(sourceID, interruptState);
++ mDBUSMessageHandler.initReply(msg);
++ mDBUSMessageHandler.sendMessage();
++}
++
++void IAmRoutingReceiverShadowDbus::hookSinkAvailablityStatusChange(DBusConnection* conn, DBusMessage* msg)
++{
++ (void) ((conn));
++ assert(mRoutingReceiveInterface != NULL);
++ mDBUSMessageHandler.initReceive(msg);
++ am_sinkID_t sinkID = mDBUSMessageHandler.getInt();
++ am_Availability_s avialabilty = mDBUSMessageHandler.getAvailability();
++ log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::hookSinkAvailablityStatusChange called, sinkID", sinkID);
++ mRoutingReceiveInterface->hookSinkAvailablityStatusChange(sinkID, avialabilty);
++}
++
++void IAmRoutingReceiverShadowDbus::hookSourceAvailablityStatusChange(DBusConnection* conn, DBusMessage* msg)
++{
++ (void) ((conn));
++ assert(mRoutingReceiveInterface != NULL);
++ mDBUSMessageHandler.initReceive(msg);
++ am_sourceID_t sourceID = mDBUSMessageHandler.getInt();
++ am_Availability_s avialabilty = mDBUSMessageHandler.getAvailability();
++ log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::hookSourceAvailablityStatusChange called, sourceID", sourceID);
++ mRoutingReceiveInterface->hookSourceAvailablityStatusChange(sourceID, avialabilty);
++}
++
++void IAmRoutingReceiverShadowDbus::hookDomainStateChange(DBusConnection* conn, DBusMessage* msg)
++{
++ (void) ((conn));
++ assert(mRoutingReceiveInterface != NULL);
++ mDBUSMessageHandler.initReceive(msg);
++ am_domainID_t domainID = mDBUSMessageHandler.getUInt();
++ am_DomainState_e domainState = (am_DomainState_e)((mDBUSMessageHandler.getInt()));
++ log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::hookDomainStateChange called, hookDomainStateChange", domainID);
++ mRoutingReceiveInterface->hookDomainStateChange(domainID, domainState);
++}
++
++void IAmRoutingReceiverShadowDbus::hookTimingInformationChanged(DBusConnection* conn, DBusMessage* msg)
++{
++ (void) ((conn));
++ assert(mRoutingReceiveInterface != NULL);
++ mDBUSMessageHandler.initReceive(msg);
++ am_connectionID_t connectionID(mDBUSMessageHandler.getInt());
++ am_timeSync_t time(mDBUSMessageHandler.getInt());
++ log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::hookTimingInformationChanged called, connectionID", connectionID);
++ mRoutingReceiveInterface->hookTimingInformationChanged(connectionID, time);
++}
++
++void IAmRoutingReceiverShadowDbus::sendChangedData(DBusConnection* conn, DBusMessage* msg)
++{
++ (void) ((conn));
++ assert(mRoutingReceiveInterface != NULL);
++ mDBUSMessageHandler.initReceive(msg);
++ std::vector < am_EarlyData_s > listEarlyData(mDBUSMessageHandler.getEarlyData());
++ log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::hookTimingInformationChanged called, sendChangedData");
++ mRoutingReceiveInterface->sendChangedData(listEarlyData);
++}
++
++DBusHandlerResult IAmRoutingReceiverShadowDbus::receiveCallback(DBusConnection* conn, DBusMessage* msg, void* user_data)
++{
++ assert(conn != NULL);
++ assert(msg != NULL);
++ assert(user_data != NULL);
++ IAmRoutingReceiverShadowDbus* reference = (IAmRoutingReceiverShadowDbus*) ((user_data));
++ return (reference->receiveCallbackDelegate(conn, msg));
++}
++
++void IAmRoutingReceiverShadowDbus::getRoutingReadyStatus(DBusConnection* conn, DBusMessage* msg)
++{
++ (void) ((conn));
++ assert(mRoutingReceiveInterface != NULL);
++ mDBUSMessageHandler.initReply(msg);
++ mDBUSMessageHandler.append(mRoutingReady);
++ mDBUSMessageHandler.sendMessage();
++}
++
++
++void IAmRoutingReceiverShadowDbus::sendIntrospection(DBusConnection* conn, DBusMessage* msg)
++{
++ assert(conn != NULL);
++ assert(msg != NULL);
++ DBusMessage* reply;
++ DBusMessageIter args;
++ dbus_uint32_t serial = 0;
++
++ // create a reply from the message
++ reply = dbus_message_new_method_return(msg);
++ std::string fullpath(ROUTING_DBUS_INTROSPECTION_FILE);
++ std::ifstream in(fullpath.c_str(), std::ifstream::in);
++ if (!in)
++ {
++ logError("IAmCommandReceiverShadow::sendIntrospection could not load xml file ",fullpath);
++ throw std::runtime_error("IAmCommandReceiverShadow::sendIntrospection Could not load introspecton XML");
++ }
++ std::string introspect((std::istreambuf_iterator<char>(in)), std::istreambuf_iterator<char>());
++ const char* string = introspect.c_str();
++
++ // add the arguments to the reply
++ dbus_message_iter_init_append(reply, &args);
++ if (!dbus_message_iter_append_basic(&args, DBUS_TYPE_STRING, &string))
++ {
++ log(&routingDbus, DLT_LOG_INFO, "DBUS handler Out Of Memory!");
++ }
++
++ // send the reply && flush the connection
++ if (!dbus_connection_send(conn, reply, &serial))
++ {
++ log(&routingDbus, DLT_LOG_INFO, "DBUS handler Out Of Memory!");
++ }
++ dbus_connection_flush(conn);
++
++ // free the reply
++ dbus_message_unref(reply);
++}
++
++DBusHandlerResult IAmRoutingReceiverShadowDbus::receiveCallbackDelegate(DBusConnection* conn, DBusMessage* msg)
++{
++ if (dbus_message_is_method_call(msg, DBUS_INTERFACE_INTROSPECTABLE, "Introspect"))
++ {
++ sendIntrospection(conn, msg);
++ return (DBUS_HANDLER_RESULT_HANDLED);
++ }
++ functionMap_t::iterator iter = mFunctionMap.begin();
++ std::string k(dbus_message_get_member(msg));
++ log(&routingDbus, DLT_LOG_INFO, k.c_str());
++ iter = mFunctionMap.find(k);
++ if (iter != mFunctionMap.end())
++ {
++ std::string p(iter->first);
++ CallBackMethod cb = iter->second;
++ (this->*cb)(conn, msg);
++ return (DBUS_HANDLER_RESULT_HANDLED);
++ }
++ return (DBUS_HANDLER_RESULT_NOT_YET_HANDLED);
++}
++
++void IAmRoutingReceiverShadowDbus::setRoutingReceiver(IAmRoutingReceive*& receiver)
++{
++ assert(receiver != NULL);
++ mRoutingReceiveInterface = receiver;
++ gObjectPathVTable.message_function = IAmRoutingReceiverShadowDbus::receiveCallback;
++ DBusConnection* connection;
++ mRoutingReceiveInterface->getDBusConnectionWrapper(mDBusWrapper);
++ assert(mDBusWrapper != NULL);
++ mDBusWrapper->getDBusConnection(connection);
++ assert(connection != NULL);
++ mDBUSMessageHandler.setDBusConnection(connection);
++ std::string path(ROUTING_NODE);
++ {
++ assert(receiver != NULL);
++ }
++ mDBusWrapper->registerCallback(&gObjectPathVTable, path, this);
++}
++
++void IAmRoutingReceiverShadowDbus::confirmRoutingReady(DBusConnection* conn, DBusMessage* msg)
++{
++ (void) ((conn));
++ assert(mRoutingReceiveInterface != NULL);
++ mDBUSMessageHandler.initReceive(msg);
++ am_domainID_t domainID(mDBUSMessageHandler.getUInt());
++ log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadowDbus::confirmRoutingReady called, domainID", domainID);
++
++ mRoutingReceiveInterface->confirmRoutingReady(mHandle, E_OK);
++ mNumberDomains++;
++
++ mDBUSMessageHandler.initReply(msg);
++ mDBUSMessageHandler.sendMessage();
++}
++
++void IAmRoutingReceiverShadowDbus::confirmRoutingRundown(DBusConnection* conn, DBusMessage* msg)
++{
++ (void) ((conn));
++ assert(mRoutingReceiveInterface != NULL);
++ mDBUSMessageHandler.initReceive(msg);
++ am_domainID_t domainID(mDBUSMessageHandler.getUInt());
++ log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadowDbus::confirmRoutingRundown called, domainID", domainID);
++
++ mNumberDomains--;
++ if(mNumberDomains==0)
++ {
++ logInfo("sending out");
++ mRoutingReceiveInterface->confirmRoutingRundown(mHandle,E_OK);
++ }
++ mDBUSMessageHandler.initReply(msg);
++ mDBUSMessageHandler.sendMessage();
++}
++
++void IAmRoutingReceiverShadowDbus::gotReady(int16_t numberDomains, uint16_t handle)
++{
++ mRoutingReady=true;
++ mNumberDomains=numberDomains;
++ mHandle=handle;
++}
++void IAmRoutingReceiverShadowDbus::gotRundown(int16_t numberDomains, uint16_t handle)
++{
++ mRoutingReady=false;
++ mNumberDomains=numberDomains;
++ mHandle=handle;
++}
++
++void IAmRoutingReceiverShadowDbus::updateGateway(DBusConnection* conn, DBusMessage* msg)
++{
++ (void) ((conn));
++ assert(mRoutingReceiveInterface != NULL);
++ mDBUSMessageHandler.initReceive(msg);
++ am_gatewayID_t gatewayID(mDBUSMessageHandler.getInt());
++ std::vector<am_CustomAvailabilityReason_t> listSourceConnectionFormats(mDBUSMessageHandler.getListconnectionFormats());
++ std::vector<am_CustomAvailabilityReason_t> listSinkConnectionFormats(mDBUSMessageHandler.getListconnectionFormats());
++ std::vector<bool> convertionMatrix(mDBUSMessageHandler.getListBool());
++
++ am_Error_e returnCode = mRoutingReceiveInterface->updateGateway(gatewayID,listSourceConnectionFormats,listSinkConnectionFormats,convertionMatrix);
++ mDBUSMessageHandler.initReply(msg);
++ mDBUSMessageHandler.append(returnCode);
++ mDBUSMessageHandler.sendMessage();
++ if (returnCode != E_OK)
++ {
++ log(&routingDbus, DLT_LOG_INFO, "error updateGateway");
++ return;
++ }
++}
++
++void IAmRoutingReceiverShadowDbus::updateConverter(DBusConnection* conn, DBusMessage* msg)
++{
++ (void) ((conn));
++ assert(mRoutingReceiveInterface != NULL);
++ mDBUSMessageHandler.initReceive(msg);
++ am_converterID_t converterID(mDBUSMessageHandler.getInt());
++ std::vector<am_CustomAvailabilityReason_t> listSourceConnectionFormats(mDBUSMessageHandler.getListconnectionFormats());
++ std::vector<am_CustomAvailabilityReason_t> listSinkConnectionFormats(mDBUSMessageHandler.getListconnectionFormats());
++ std::vector<bool> convertionMatrix(mDBUSMessageHandler.getListBool());
++
++ am_Error_e returnCode = mRoutingReceiveInterface->updateConverter(converterID,listSourceConnectionFormats,listSinkConnectionFormats,convertionMatrix);
++ mDBUSMessageHandler.initReply(msg);
++ mDBUSMessageHandler.append(returnCode);
++ mDBUSMessageHandler.sendMessage();
++ if (returnCode != E_OK)
++ {
++ log(&routingDbus, DLT_LOG_INFO, "error updateGateway");
++ return;
++ }
++}
++
++void IAmRoutingReceiverShadowDbus::updateSink(DBusConnection* conn, DBusMessage* msg)
++{
++ (void) ((conn));
++ assert(mRoutingReceiveInterface != NULL);
++ mDBUSMessageHandler.initReceive(msg);
++ am_sinkID_t sinkID(mDBUSMessageHandler.getInt());
++ am_sinkClass_t sinkClassID(mDBUSMessageHandler.getInt());
++ std::vector<am_SoundProperty_s> listSoundProperties(mDBUSMessageHandler.getListSoundProperties());
++ std::vector<am_CustomAvailabilityReason_t> listSinkConnectionFormats(mDBUSMessageHandler.getListconnectionFormats());
++ std::vector<am_MainSoundProperty_s> listMainSoundProperties(mDBUSMessageHandler.getListMainSoundProperties());
++
++ am_Error_e returnCode = mRoutingReceiveInterface->updateSink(sinkID,sinkClassID,listSoundProperties,listSinkConnectionFormats,listMainSoundProperties);
++ mDBUSMessageHandler.initReply(msg);
++ mDBUSMessageHandler.append(returnCode);
++ mDBUSMessageHandler.sendMessage();
++ if (returnCode != E_OK)
++ {
++ log(&routingDbus, DLT_LOG_INFO, "error updateSink");
++ return;
++ }
++}
++
++void IAmRoutingReceiverShadowDbus::updateSource(DBusConnection* conn, DBusMessage* msg)
++{
++ (void) ((conn));
++ assert(mRoutingReceiveInterface != NULL);
++ mDBUSMessageHandler.initReceive(msg);
++ am_sourceID_t sourceID(mDBUSMessageHandler.getInt());
++ am_sourceClass_t sourceClassID(mDBUSMessageHandler.getInt());
++ std::vector<am_SoundProperty_s> listSoundProperties(mDBUSMessageHandler.getListSoundProperties());
++ std::vector<am_CustomAvailabilityReason_t> listSinkConnectionFormats(mDBUSMessageHandler.getListconnectionFormats());
++ std::vector<am_MainSoundProperty_s> listMainSoundProperties(mDBUSMessageHandler.getListMainSoundProperties());
++
++ am_Error_e returnCode = mRoutingReceiveInterface->updateSource(sourceID,sourceClassID,listSoundProperties,listSinkConnectionFormats,listMainSoundProperties);
++ mDBUSMessageHandler.initReply(msg);
++ mDBUSMessageHandler.append(returnCode);
++ mDBUSMessageHandler.sendMessage();
++ if (returnCode != E_OK)
++ {
++ log(&routingDbus, DLT_LOG_INFO, "error updateSink");
++ return;
++ }
++}
++
++void IAmRoutingReceiverShadowDbus::ackSetVolumes(DBusConnection* conn, DBusMessage* msg)
++{
++ (void) ((conn));
++ am_Error_e returnCode(am_Error_e::E_NOT_USED);
++ mDBUSMessageHandler.initReply(msg);
++ mDBUSMessageHandler.append(returnCode);
++ mDBUSMessageHandler.sendMessage();
++ log(&routingDbus, DLT_LOG_INFO, "error ackSetVolumes was called - not implemented yet");
++ return;
++}
++
++void IAmRoutingReceiverShadowDbus::ackSinkNotificationConfiguration(DBusConnection* conn, DBusMessage* msg)
++{
++ (void) ((conn));
++ assert(mRoutingReceiveInterface != NULL);
++ mDBUSMessageHandler.initReceive(msg);
++ uint16_t handle(mDBUSMessageHandler.getUInt());
++ am_Error_e error((am_Error_e)((mDBUSMessageHandler.getUInt())));
++ log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::ackSinkNotificationConfiguration called, handle", handle, "error", error);
++ am_Handle_s myhandle;
++ myhandle.handleType = H_CONNECT;
++ myhandle.handle = handle;
++ mRoutingReceiveInterface->ackSinkNotificationConfiguration(myhandle, error);
++ mpRoutingSenderDbus->removeHandle(handle);
++ mDBUSMessageHandler.initReply(msg);
++ mDBUSMessageHandler.sendMessage();
++}
++
++void IAmRoutingReceiverShadowDbus::ackSourceNotificationConfiguration(DBusConnection* conn, DBusMessage* msg)
++{
++ (void) ((conn));
++ assert(mRoutingReceiveInterface != NULL);
++ mDBUSMessageHandler.initReceive(msg);
++ uint16_t handle(mDBUSMessageHandler.getUInt());
++ am_Error_e error((am_Error_e)((mDBUSMessageHandler.getUInt())));
++ log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::ackSourceNotificationConfiguration called, handle", handle, "error", error);
++ am_Handle_s myhandle;
++ myhandle.handleType = H_CONNECT;
++ myhandle.handle = handle;
++ mRoutingReceiveInterface->ackSourceNotificationConfiguration(myhandle, error);
++ mpRoutingSenderDbus->removeHandle(handle);
++ mDBUSMessageHandler.initReply(msg);
++ mDBUSMessageHandler.sendMessage();
++}
++
++void IAmRoutingReceiverShadowDbus::hookSinkNotificationDataChange(DBusConnection* conn, DBusMessage* msg)
++{
++ (void) ((conn));
++ assert(mRoutingReceiveInterface != NULL);
++ mDBUSMessageHandler.initReceive(msg);
++ am_sinkID_t sinkID(mDBUSMessageHandler.getUInt());
++ am_NotificationPayload_s payload(mDBUSMessageHandler.getNotificationPayload());
++ log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::hookSinkNotificationDataChange called, sinkID", sinkID);
++ mRoutingReceiveInterface->hookSinkNotificationDataChange(sinkID, payload);
++ mDBUSMessageHandler.initReply(msg);
++ mDBUSMessageHandler.sendMessage();
++}
++
++void IAmRoutingReceiverShadowDbus::hookSourceNotificationDataChange(DBusConnection* conn, DBusMessage* msg)
++{
++ (void) ((conn));
++ assert(mRoutingReceiveInterface != NULL);
++ mDBUSMessageHandler.initReceive(msg);
++ am_sourceID_t sourceID(mDBUSMessageHandler.getUInt());
++ am_NotificationPayload_s payload(mDBUSMessageHandler.getNotificationPayload());
++ log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow::hookSourceNotificationDataChange called, sourceID", sourceID);
++ mRoutingReceiveInterface->hookSourceNotificationDataChange(sourceID, payload);
++ mDBUSMessageHandler.initReply(msg);
++ mDBUSMessageHandler.sendMessage();
++}
++
++IAmRoutingReceiverShadowDbus::functionMap_t IAmRoutingReceiverShadowDbus::createMap()
++{
++ functionMap_t m;
++ m["ackConnect"] = &IAmRoutingReceiverShadowDbus::ackConnect;
++ m["ackDisconnect"] = &IAmRoutingReceiverShadowDbus::ackDisconnect;
++ m["ackSetSinkVolume"] = &IAmRoutingReceiverShadowDbus::ackSetSinkVolume;
++ m["ackSetSourceVolume"] = &IAmRoutingReceiverShadowDbus::ackSetSourceVolume;
++ m["ackSetSourceState"] = &IAmRoutingReceiverShadowDbus::ackSetSourceState;
++ m["ackSinkVolumeTick"] = &IAmRoutingReceiverShadowDbus::ackSinkVolumeTick;
++ m["ackSourceVolumeTick"] = &IAmRoutingReceiverShadowDbus::ackSourceVolumeTick;
++ m["ackSetSinkSoundProperty"] = &IAmRoutingReceiverShadowDbus::ackSetSinkSoundProperty;
++ m["ackSetSourceSoundProperty"] = &IAmRoutingReceiverShadowDbus::ackSetSourceSoundProperty;
++ m["ackSetSinkSoundProperties"] = &IAmRoutingReceiverShadowDbus::ackSetSinkSoundProperties;
++ m["ackSetSourceSoundProperties"] = &IAmRoutingReceiverShadowDbus::ackSetSourceSoundProperties;
++ m["ackCrossFading"] = &IAmRoutingReceiverShadowDbus::ackCrossFading;
++ m["registerDomain"] = &IAmRoutingReceiverShadowDbus::registerDomain;
++ m["registerSource"] = &IAmRoutingReceiverShadowDbus::registerSource;
++ m["registerSink"] = &IAmRoutingReceiverShadowDbus::registerSink;
++ m["registerGateway"] = &IAmRoutingReceiverShadowDbus::registerGateway;
++ m["peekDomain"] = &IAmRoutingReceiverShadowDbus::peekDomain;
++ m["deregisterDomain"] = &IAmRoutingReceiverShadowDbus::deregisterDomain;
++ m["deregisterGateway"] = &IAmRoutingReceiverShadowDbus::deregisterGateway;
++ m["peekSink"] = &IAmRoutingReceiverShadowDbus::peekSink;
++ m["deregisterSink"] = &IAmRoutingReceiverShadowDbus::deregisterSink;
++ m["peekSource"] = &IAmRoutingReceiverShadowDbus::peekSource;
++ m["deregisterSource"] = &IAmRoutingReceiverShadowDbus::deregisterSource;
++ m["registerCrossfader"] = &IAmRoutingReceiverShadowDbus::registerCrossfader;
++ m["deregisterCrossfader"] = &IAmRoutingReceiverShadowDbus::deregisterCrossfader;
++ m["peekSourceClassID"] = &IAmRoutingReceiverShadowDbus::peekSourceClassID;
++ m["peekSinkClassID"] = &IAmRoutingReceiverShadowDbus::peekSinkClassID;
++ m["hookInterruptStatusChange"] = &IAmRoutingReceiverShadowDbus::hookInterruptStatusChange;
++ m["hookDomainRegistrationComplete"] = &IAmRoutingReceiverShadowDbus::hookDomainRegistrationComplete;
++ m["hookSinkAvailablityStatusChange"] = &IAmRoutingReceiverShadowDbus::hookSinkAvailablityStatusChange;
++ m["hookSourceAvailablityStatusChange"] = &IAmRoutingReceiverShadowDbus::hookSourceAvailablityStatusChange;
++ m["hookDomainStateChange"] = &IAmRoutingReceiverShadowDbus::hookDomainStateChange;
++ m["hookTimingInformationChanged"] = &IAmRoutingReceiverShadowDbus::hookTimingInformationChanged;
++ m["sendChangedData"] = &IAmRoutingReceiverShadowDbus::sendChangedData;
++ m["confirmRoutingReady"] = &IAmRoutingReceiverShadowDbus::confirmRoutingReady;
++ m["confirmRoutingRundown"] = &IAmRoutingReceiverShadowDbus::confirmRoutingRundown;
++ m["ackSetVolumes"] = &IAmRoutingReceiverShadowDbus::ackSetVolumes;
++ m["ackSinkNotificationConfiguration"] = &IAmRoutingReceiverShadowDbus::ackSinkNotificationConfiguration;
++ m["ackSourceNotificationConfiguration"] = &IAmRoutingReceiverShadowDbus::ackSourceNotificationConfiguration;
++ m["hookSinkNotificationDataChange"] = &IAmRoutingReceiverShadowDbus::hookSinkNotificationDataChange;
++ m["hookSourceNotificationDataChange"] = &IAmRoutingReceiverShadowDbus::hookSourceNotificationDataChange;
++ m["getRoutingReadyState"] = &IAmRoutingReceiverShadowDbus::getRoutingReadyStatus;
++ return (m);
++}
++}
+--
+2.5.0
+
diff --git a/meta-ivi-common/recipes-multimedia/audiomanager/audiomanager-plugins_7.3.bb b/meta-ivi-common/recipes-multimedia/audiomanager/audiomanager-plugins_7.3.bb
new file mode 100644
index 0000000..fabae5d
--- /dev/null
+++ b/meta-ivi-common/recipes-multimedia/audiomanager/audiomanager-plugins_7.3.bb
@@ -0,0 +1,42 @@
+SUMMARY = "Genivi AudioManagerPlugins"
+HOMEPAGE = "https://www.genivi.org/"
+SECTION = "multimedia"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://README;md5=94ae2e3adf4978f783d0ca366681e87e"
+PR = "r1"
+
+DEPENDS = "dlt-daemon dbus audiomanager"
+
+BRANCH = "master"
+
+SRC_URI = " \
+ git://git.projects.genivi.org/AudioManagerPlugins.git;branch=${BRANCH};tag=${PV} \
+ file://0001-some-adoptions.patch \
+ "
+
+S = "${WORKDIR}/git"
+inherit autotools gettext cmake pkgconfig
+
+EXTRA_OECMAKE += "-DWITH_TEST_CONTROLLER=OFF -DWITH_DBUS_WRAPPER=ON \
+ -DWITH_COMMAND_INTERFACE_DBUS=ON -DWITH_ROUTING_INTERFACE_DBUS=ON \
+ -DWITH_TEST_CONTROLLER=ON"
+OECMAKE_CXX_FLAGS +="-ldl"
+
+PACKAGECONFIG ??= ""
+
+# With CommonAPI support
+PACKAGECONFIG[capi] = "-DWITH_CAPI_WRAPPER=ON -DWITH_COMMAND_INTERFACE_COMMON_CAPI=ON -DWITH_ROUTING_INTERFACE_CAPI=ON,-DWITH_COMMAND_INTERFACE_COMMON_CAPI=OFF -DWITH_ROUTING_INTERFACE_CAPI=OFF,common-api-c++-dbus"
+
+FILES_${PN} += " \
+ ${prefix}/share/audiomanager \
+ ${libdir}/audiomanager/command/*.so* \
+ ${libdir}/audiomanager/control/*.so* \
+ ${libdir}/audiomanager/routing/*.so* \
+ "
+
+FILES_${PN}-dbg += " \
+ ${libdir}/audiomanager/command/.debug/* \
+ ${libdir}/audiomanager/control/.debug/* \
+ ${libdir}/audiomanager/routing/.debug/* \
+ "