summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Linke <christian.linke@bmw.de>2015-03-12 13:43:48 +0100
committerChristian Linke <christian.linke@bmw.de>2015-03-12 13:43:48 +0100
commit6ffbf25bacf589879198e49ac227cb56e261b7c9 (patch)
treee6b3ca48d22d06d43da638b1998ab1220ec7ab08
parentc628fa5304171cd827f56aa475668d99d26ad28a (diff)
downloadaudiomanager-6ffbf25bacf589879198e49ac227cb56e261b7c9.tar.gz
* fully rework. Plugins have now a new own git repository
* building out of source of plugins without AM workss * build system cmake contructions is different now Signed-off-by: Christian Linke <christian.linke@bmw.de>
-rw-r--r--.gitignore10
-rw-r--r--AudioManagerDaemon/CMakeLists.txt351
-rw-r--r--AudioManagerDaemon/docx/Doxyfile.in4
-rw-r--r--AudioManagerDaemon/fidls/AudioManagerTypes.fidl1287
-rwxr-xr-xAudioManagerDaemon/fidls/NodeStateManager_dbus.conf32
-rw-r--r--AudioManagerDaemon/include/CAmCommandReceiver.h2
-rw-r--r--AudioManagerDaemon/include/CAmCommandSender.h2
-rw-r--r--AudioManagerDaemon/include/CAmControlReceiver.h2
-rw-r--r--AudioManagerDaemon/include/CAmControlSender.h4
-rw-r--r--AudioManagerDaemon/include/CAmDatabaseHandlerSQLite.h2
-rw-r--r--AudioManagerDaemon/include/CAmDatabaseObserver.h4
-rw-r--r--AudioManagerDaemon/include/CAmNodeStateCommunicatorDBus.h2
-rw-r--r--AudioManagerDaemon/include/CAmRouter.h2
-rw-r--r--AudioManagerDaemon/include/CAmRoutingReceiver.h2
-rw-r--r--AudioManagerDaemon/include/CAmRoutingSender.h2
-rw-r--r--AudioManagerDaemon/include/CAmTelnetMenuHelper.h2
-rw-r--r--AudioManagerDaemon/include/CAmTelnetServer.h4
-rwxr-xr-xAudioManagerDaemon/include/CAmWatchdog.h4
-rw-r--r--AudioManagerDaemon/include/TAmPluginTemplate.h4
-rw-r--r--AudioManagerDaemon/src/CAmCommandReceiver.cpp6
-rw-r--r--AudioManagerDaemon/src/CAmCommandSender.cpp4
-rw-r--r--AudioManagerDaemon/src/CAmControlReceiver.cpp6
-rw-r--r--AudioManagerDaemon/src/CAmControlSender.cpp4
-rw-r--r--AudioManagerDaemon/src/CAmDatabaseHandlerMap.cpp2
-rw-r--r--AudioManagerDaemon/src/CAmDatabaseHandlerSQLite.cpp4
-rw-r--r--AudioManagerDaemon/src/CAmDatabaseObserver.cpp6
-rw-r--r--AudioManagerDaemon/src/CAmNodeStateCommunicatorCAPI.cpp6
-rw-r--r--AudioManagerDaemon/src/CAmNodeStateCommunicatorDBus.cpp2
-rw-r--r--AudioManagerDaemon/src/CAmRouter.cpp4
-rw-r--r--AudioManagerDaemon/src/CAmRoutingReceiver.cpp6
-rw-r--r--AudioManagerDaemon/src/CAmRoutingSender.cpp4
-rw-r--r--AudioManagerDaemon/src/CAmTelnetMenuHelper.cpp4
-rwxr-xr-xAudioManagerDaemon/src/CAmTelnetServer.cpp4
-rwxr-xr-xAudioManagerDaemon/src/CAmWatchdog.cpp4
-rwxr-xr-xAudioManagerDaemon/src/main.cpp10
-rw-r--r--AudioManagerDaemon/test/AmControlInterfaceTest/CAmControlInterfaceTest.cpp7
-rw-r--r--AudioManagerDaemon/test/AmControlInterfaceTest/CAmControlInterfaceTest.h6
-rw-r--r--AudioManagerDaemon/test/AmControlInterfaceTest/CMakeLists.txt92
-rw-r--r--AudioManagerDaemon/test/AmDatabaseHandlerTest/CAmDatabaseHandlerTest.cpp4
-rw-r--r--AudioManagerDaemon/test/AmDatabaseHandlerTest/CAmDatabaseHandlerTest.h4
-rw-r--r--AudioManagerDaemon/test/AmDatabaseHandlerTest/CMakeLists.txt136
-rw-r--r--AudioManagerDaemon/test/AmMapHandlerTest/CAmMapHandlerTest.cpp4
-rw-r--r--AudioManagerDaemon/test/AmMapHandlerTest/CAmMapHandlerTest.h4
-rw-r--r--AudioManagerDaemon/test/AmMapHandlerTest/CMakeLists.txt71
-rw-r--r--AudioManagerDaemon/test/AmNodeStateCommunicatorCAPITest/CAmNodeStateCommunicatorTest.cpp4
-rw-r--r--AudioManagerDaemon/test/AmNodeStateCommunicatorCAPITest/CAmNodeStateCommunicatorTest.h2
-rw-r--r--AudioManagerDaemon/test/AmNodeStateCommunicatorCAPITest/CMakeLists.txt94
-rw-r--r--AudioManagerDaemon/test/AmNodeStateCommunicatorDBusTest/CAmNodeStateCommunicatorTest.cpp6
-rw-r--r--AudioManagerDaemon/test/AmNodeStateCommunicatorDBusTest/CMakeLists.txt82
-rw-r--r--AudioManagerDaemon/test/AmRouterMapTest/CAmRouterMapTest.cpp2
-rw-r--r--AudioManagerDaemon/test/AmRouterMapTest/CAmRouterMapTest.h2
-rw-r--r--AudioManagerDaemon/test/AmRouterMapTest/CMakeLists.txt69
-rw-r--r--AudioManagerDaemon/test/AmRouterTest/CAmRouterTest.cpp2
-rw-r--r--AudioManagerDaemon/test/AmRouterTest/CAmRouterTest.h2
-rw-r--r--AudioManagerDaemon/test/AmRouterTest/CMakeLists.txt70
-rw-r--r--AudioManagerDaemon/test/AmRoutingInterfaceTest/CAmRoutingInterfaceTest.cpp4
-rw-r--r--AudioManagerDaemon/test/AmRoutingInterfaceTest/CAmRoutingInterfaceTest.h4
-rw-r--r--AudioManagerDaemon/test/AmRoutingInterfaceTest/CMakeLists.txt78
-rw-r--r--AudioManagerDaemon/test/AmSocketHandlerTest/CAmSocketHandlerTest.cpp4
-rw-r--r--AudioManagerDaemon/test/AmSocketHandlerTest/CAmSocketHandlerTest.h6
-rw-r--r--AudioManagerDaemon/test/AmSocketHandlerTest/CMakeLists.txt55
-rw-r--r--AudioManagerDaemon/test/AmTelnetServerTest/CAmTelnetServerTest.cpp11
-rw-r--r--AudioManagerDaemon/test/AmTelnetServerTest/CAmTelnetServerTest.h12
-rw-r--r--AudioManagerDaemon/test/AmTelnetServerTest/CMakeLists.txt87
-rw-r--r--AudioManagerDaemon/test/CAmCommonFunctions.cpp2
-rw-r--r--AudioManagerDaemon/test/CAmCommonFunctions.h2
-rw-r--r--AudioManagerDaemon/test/CMakeLists.txt4
-rw-r--r--AudioManagerDaemon/test/IAmCommandBackdoor.h2
-rw-r--r--AudioManagerDaemon/test/IAmControlBackdoor.h2
-rw-r--r--AudioManagerDaemon/test/IAmRoutingBackdoor.h2
-rw-r--r--AudioManagerDaemon/test/MockIAmCommandSend.h2
-rw-r--r--AudioManagerDaemon/test/MockIAmControlSend.h2
-rw-r--r--AudioManagerDaemon/test/MockIAmRoutingSend.h2
-rw-r--r--AudioManagerUtilities/include/CAmCommonAPIWrapper.h (renamed from include/shared/CAmCommonAPIWrapper.h)2
-rw-r--r--AudioManagerUtilities/include/CAmDbusWrapper.h (renamed from include/shared/CAmDbusWrapper.h)2
-rw-r--r--AudioManagerUtilities/include/CAmDltWrapper.h (renamed from include/shared/CAmDltWrapper.h)5
-rw-r--r--AudioManagerUtilities/include/CAmSerializer.h (renamed from include/shared/CAmSerializer.h)2
-rw-r--r--AudioManagerUtilities/include/CAmSocketHandler.h (renamed from include/shared/CAmSocketHandler.h)2
-rw-r--r--AudioManagerUtilities/src/CAmCommonAPIWrapper.cpp (renamed from AudioManagerDaemon/src/CAmCommonAPIWrapper.cpp)8
-rw-r--r--AudioManagerUtilities/src/CAmDbusWrapper.cpp (renamed from AudioManagerDaemon/src/CAmDbusWrapper.cpp)8
-rw-r--r--AudioManagerUtilities/src/CAmDltWrapper.cpp (renamed from AudioManagerDaemon/src/CAmDltWrapper.cpp)4
-rw-r--r--AudioManagerUtilities/src/CAmSocketHandler.cpp (renamed from AudioManagerDaemon/src/CAmSocketHandler.cpp)8
-rwxr-xr-xCMakeLists.txt511
-rw-r--r--Foo/AudioManagerCodestyle.xml (renamed from cmake/AudioManagerCodestyle.xml)0
-rwxr-xr-xFoo/EA_Code_GEN_templates_AM_v6.xml (renamed from cmake/EA_Code_GEN_templates_AM_v6.xml)0
-rw-r--r--Foo/LifecycleConsumer.xml (renamed from cmake/LifecycleConsumer.xml)0
-rw-r--r--Foo/genivi.audiomanager.service (renamed from cmake/genivi.audiomanager.service)2
-rw-r--r--PluginCommandInterfaceCAPI/CMakeLists.txt104
-rw-r--r--PluginCommandInterfaceCAPI/cmake/config.cmake4
-rwxr-xr-xPluginCommandInterfaceCAPI/fidl/CommandInterface.fidl607
-rw-r--r--PluginCommandInterfaceCAPI/fidl/PluginCommandInterfaceCAPI_dbus.conf8
-rw-r--r--PluginCommandInterfaceCAPI/include/CAmCommandSenderCAPI.h119
-rw-r--r--PluginCommandInterfaceCAPI/include/CAmCommandSenderCommon.h49
-rw-r--r--PluginCommandInterfaceCAPI/include/CAmCommandSenderService.h72
-rw-r--r--PluginCommandInterfaceCAPI/include/configCommandCAPI.h4
-rw-r--r--PluginCommandInterfaceCAPI/src/CAmCommandSenderCAPI.cpp364
-rw-r--r--PluginCommandInterfaceCAPI/src/CAmCommandSenderCommon.cpp101
-rw-r--r--PluginCommandInterfaceCAPI/src/CAmCommandSenderService.cpp236
-rw-r--r--PluginCommandInterfaceCAPI/test/CAmCommandSenderCAPITest.cpp1138
-rw-r--r--PluginCommandInterfaceCAPI/test/CAmCommandSenderCAPITest.h77
-rw-r--r--PluginCommandInterfaceCAPI/test/CAmTestCAPIWrapper.cpp31
-rw-r--r--PluginCommandInterfaceCAPI/test/CAmTestCAPIWrapper.h32
-rw-r--r--PluginCommandInterfaceCAPI/test/CMakeLists.txt101
-rw-r--r--PluginCommandInterfaceCAPI/test/MockIAmCommandReceive.h86
-rw-r--r--PluginCommandInterfaceCAPI/test/MockNotificationsClient.h114
-rw-r--r--PluginCommandInterfaceDbus/CMakeLists.txt103
-rw-r--r--PluginCommandInterfaceDbus/cmake/config.cmake7
-rw-r--r--PluginCommandInterfaceDbus/include/CAmCommandSenderDbus.h121
-rw-r--r--PluginCommandInterfaceDbus/include/CAmDbusMessageHandler.h123
-rw-r--r--PluginCommandInterfaceDbus/include/CommandInterface.xml226
-rw-r--r--PluginCommandInterfaceDbus/include/IAmCommandReceiverShadow.h109
-rw-r--r--PluginCommandInterfaceDbus/include/configCommandDbus.h7
-rw-r--r--PluginCommandInterfaceDbus/src/CAmCommandSenderDbus.cpp401
-rw-r--r--PluginCommandInterfaceDbus/src/CAmDbusMessageHandler.cpp709
-rw-r--r--PluginCommandInterfaceDbus/src/IAmCommandReceiverShadow.cpp526
-rw-r--r--PluginCommandInterfaceDbus/test/CAmCommandSenderDbusBackdoor.cpp63
-rw-r--r--PluginCommandInterfaceDbus/test/CAmCommandSenderDbusBackdoor.h44
-rw-r--r--PluginCommandInterfaceDbus/test/CAmCommandSenderDbusSignalTest.cpp803
-rw-r--r--PluginCommandInterfaceDbus/test/CAmCommandSenderDbusSignalTest.h43
-rw-r--r--PluginCommandInterfaceDbus/test/CAmCommandSenderDbusTest.cpp622
-rw-r--r--PluginCommandInterfaceDbus/test/CAmCommandSenderDbusTest.h53
-rw-r--r--PluginCommandInterfaceDbus/test/CMakeLists.txt115
-rw-r--r--PluginCommandInterfaceDbus/test/MockIAmCommandReceive.h86
-rw-r--r--PluginControlInterface/CMakeLists.txt78
-rw-r--r--PluginControlInterface/include/CAmControlSenderBase.h246
-rw-r--r--PluginControlInterface/include/IAmControlReceiverShadow.h115
-rw-r--r--PluginControlInterface/src/CAmControlSenderBase.cpp958
-rw-r--r--PluginControlInterface/src/IAmControlReceiverShadow.cpp523
-rw-r--r--PluginControlInterface/test/CAmControlReceiverShadowTest.cpp135
-rw-r--r--PluginControlInterface/test/CAmControlReceiverShadowTest.h46
-rw-r--r--PluginControlInterface/test/CMakeLists.txt98
-rw-r--r--PluginRoutingInterfaceAsync/CMakeLists.txt82
-rw-r--r--PluginRoutingInterfaceAsync/include/CAmRoutingSenderAsync.h392
-rw-r--r--PluginRoutingInterfaceAsync/include/IAmRoutingReceiverShadow.h70
-rw-r--r--PluginRoutingInterfaceAsync/src/CAmRoutingSenderAsync.cpp1328
-rw-r--r--PluginRoutingInterfaceAsync/src/IAmRoutingReceiverShadow.cpp189
-rw-r--r--PluginRoutingInterfaceAsync/test/CAmRoutingReceiverAsync.cpp529
-rw-r--r--PluginRoutingInterfaceAsync/test/CAmRoutingReceiverAsync.h69
-rw-r--r--PluginRoutingInterfaceAsync/test/CMakeLists.txt95
-rw-r--r--PluginRoutingInterfaceAsync/test/MockIAmRoutingReceive.h134
-rw-r--r--PluginRoutingInterfaceCAPI/CMakeLists.txt101
-rw-r--r--PluginRoutingInterfaceCAPI/cmake/config.cmake6
-rwxr-xr-xPluginRoutingInterfaceCAPI/fidl/PluginRoutingInterfaceCAPI_dbus.conf8
-rwxr-xr-xPluginRoutingInterfaceCAPI/fidl/RoutingInterface.fidl899
-rw-r--r--PluginRoutingInterfaceCAPI/include/CAmLookupData.h203
-rw-r--r--PluginRoutingInterfaceCAPI/include/CAmRoutingSenderCAPI.h103
-rw-r--r--PluginRoutingInterfaceCAPI/include/CAmRoutingSenderCommon.h62
-rw-r--r--PluginRoutingInterfaceCAPI/include/CAmRoutingService.h151
-rw-r--r--PluginRoutingInterfaceCAPI/include/configRoutingCAPI.h6
-rw-r--r--PluginRoutingInterfaceCAPI/src/CAmLookupData.cpp700
-rw-r--r--PluginRoutingInterfaceCAPI/src/CAmRoutingSenderCAPI.cpp378
-rw-r--r--PluginRoutingInterfaceCAPI/src/CAmRoutingSenderCommon.cpp318
-rw-r--r--PluginRoutingInterfaceCAPI/src/CAmRoutingService.cpp422
-rw-r--r--PluginRoutingInterfaceCAPI/test/CAmRoutingInterfaceCAPITests.cpp2326
-rw-r--r--PluginRoutingInterfaceCAPI/test/CAmRoutingInterfaceCAPITests.h102
-rw-r--r--PluginRoutingInterfaceCAPI/test/CAmRoutingSenderService.cpp226
-rw-r--r--PluginRoutingInterfaceCAPI/test/CAmRoutingSenderService.h111
-rw-r--r--PluginRoutingInterfaceCAPI/test/CAmTestCAPIWrapper.cpp31
-rw-r--r--PluginRoutingInterfaceCAPI/test/CAmTestCAPIWrapper.h32
-rw-r--r--PluginRoutingInterfaceCAPI/test/CMakeLists.txt133
-rw-r--r--PluginRoutingInterfaceCAPI/test/IAmRoutingSenderBackdoor.cpp87
-rw-r--r--PluginRoutingInterfaceCAPI/test/IAmRoutingSenderBackdoor.h53
-rw-r--r--PluginRoutingInterfaceCAPI/test/MockIAmRoutingReceive.h136
-rwxr-xr-xPluginRoutingInterfaceCAPI/test/RoutingSender_dbus.conf8
-rwxr-xr-xPluginRoutingInterfaceCAPI/test/cmake/AmRoutingInterfaceCAPITests_dbus.conf.in3
-rw-r--r--PluginRoutingInterfaceCAPI/test/cmake/CAmRoutingSenderService.h.in111
-rwxr-xr-xPluginRoutingInterfaceCAPI/test/cmake/RoutingSender_dbus.conf.in8
-rw-r--r--PluginRoutingInterfaceCAPI/test/cmake/config.cmake8
-rw-r--r--PluginRoutingInterfaceDbus/CMakeLists.txt107
-rw-r--r--PluginRoutingInterfaceDbus/cmake/config.cmake6
-rw-r--r--PluginRoutingInterfaceDbus/include/CAmDbusMessageHandler.h147
-rw-r--r--PluginRoutingInterfaceDbus/include/CAmDbusSend.h55
-rw-r--r--PluginRoutingInterfaceDbus/include/CAmRoutingSenderDbus.h96
-rw-r--r--PluginRoutingInterfaceDbus/include/IAmRoutingReceiverShadow.h142
-rw-r--r--PluginRoutingInterfaceDbus/include/RoutingReceiver.xml237
-rw-r--r--PluginRoutingInterfaceDbus/include/RoutingSender.xml76
-rw-r--r--PluginRoutingInterfaceDbus/include/configRoutingDbus.h6
-rw-r--r--PluginRoutingInterfaceDbus/src/CAmDbusMessageHandler.cpp1194
-rw-r--r--PluginRoutingInterfaceDbus/src/CAmDbusSend.cpp154
-rw-r--r--PluginRoutingInterfaceDbus/src/CAmRoutingSenderDbus.cpp408
-rw-r--r--PluginRoutingInterfaceDbus/src/IAmRoutingReceiverShadow.cpp975
-rw-r--r--Plugins/README1
-rwxr-xr-xREADME181
-rw-r--r--README.html291
-rwxr-xr-xcmake/CommonAPIGenerator.cmake2
-rw-r--r--cmake/FindNSM.cmake22
-rw-r--r--cmake/MacroInterfaceVersions.cmake24
-rw-r--r--cmake/MacroVersionFromGit.cmake23
-rwxr-xr-xcmake/add_package_dependencies.sh27
-rw-r--r--cmake/audiomanagerConfig.cmake.in44
-rwxr-xr-xcmake/cmake_uninstall.cmake.in43
-rw-r--r--cmake/config.cmake.in (renamed from cmake/config.cmake)0
192 files changed, 1209 insertions, 25575 deletions
diff --git a/.gitignore b/.gitignore
index e08a5bd..3dda8d6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,13 +1,5 @@
CHANGELOG
-config.h
-bin/
build/
-doc/
-packages/
.*
-/packages
/patch
-ProjectSpecific/
-
-/AudioManagerDaemon/fidls/AudioManager_dbus.conf
-/AudioManagerDaemon/fidls/AudioManager_dbus.conf.in
+Plugins/
diff --git a/AudioManagerDaemon/CMakeLists.txt b/AudioManagerDaemon/CMakeLists.txt
index e9c5696..d9718e5 100644
--- a/AudioManagerDaemon/CMakeLists.txt
+++ b/AudioManagerDaemon/CMakeLists.txt
@@ -7,48 +7,57 @@
#
# copyright
# This Source Code Form is subject to the terms of the
-# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+# Mozilla Public License, v. 2.0. if a copy of the MPL was not distributed with
# this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
-# author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+# author Christian Linke, christian.linke@bmw.de BMW 2011,2012
#
# For further information see http://www.genivi.org/.
#
-cmake_minimum_required(VERSION 2.6)
+cmake_minimum_required(VERSION 2.8.8)
-PROJECT(AudioManagerDeamon)
-
-set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -rdynamic")
-set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
+project (AudioManagerDeamon)
set(DOC_OUTPUT_PATH ${DOC_OUTPUT_PATH}/AudioManager)
+
+set(AM_MAP_CAPACITY 10
+ CACHE INTEGER "Number of preallocations for datastorage")
+
+set(AM_MAX_CONNECTIONS 0x1000
+ CACHE INTEGER "Number of max connections before rollover")
+
+set(AM_MAX_CONNECTIONS SHRT_MAX
+ CACHE INTEGER "Number of max Mainconnections before rollover")
+
set(INCLUDE_FOLDER "include")
-IF (WITH_DATABASE_STORAGE)
+if (WITH_DATABASE_STORAGE)
pkg_check_modules(SQLITE REQUIRED sqlite3)
-ENDIF (WITH_DATABASE_STORAGE)
+endif (WITH_DATABASE_STORAGE)
-IF (WITH_SYSTEMD_WATCHDOG)
+if (WITH_SYSTEMD_WATCHDOG)
pkg_check_modules(SYSTEMD libsystemd-daemon>=44)
- IF (SYSTEMD_FOUND)
+ if (SYSTEMD_FOUND)
message(STATUS "Found libsystemd-daemon, version: ${SYSTEMD_VERSION}")
- ELSE (SYSTEMD_FOUND)
+ else (SYSTEMD_FOUND)
message(STATUS "Did not find libsystemd-daemon, using own lib")
- ENDIF(SYSTEMD_FOUND)
-ENDIF (WITH_SYSTEMD_WATCHDOG)
+ endif(SYSTEMD_FOUND)
+endif (WITH_SYSTEMD_WATCHDOG)
-IF(WITH_DBUS_WRAPPER)
- FIND_PACKAGE(DBUS REQUIRED)
-ENDIF(WITH_DBUS_WRAPPER)
+if(WITH_DBUS_WRAPPER)
+ find_package(DBUS REQUIRED)
+endif(WITH_DBUS_WRAPPER)
-FIND_PACKAGE(NSM REQUIRED)
+if(WITH_CAPI_WRAPPER)
+ find_package(CommonAPI REQUIRED)
+endif(WITH_CAPI_WRAPPER)
-IF(WITH_CAPI_WRAPPER)
- FIND_PACKAGE(CommonAPI REQUIRED)
-ENDIF(WITH_CAPI_WRAPPER)
+set (AM_LINK_LIBS
+ ${CMAKE_DL_LIBS}
+ rt)
-SET(AUDIOMAN_SRCS_CXX
+set(AUDIOMAN_SRCS_CXX
src/main.cpp
src/CAmCommandReceiver.cpp
src/CAmCommandSender.cpp
@@ -58,242 +67,142 @@ SET(AUDIOMAN_SRCS_CXX
src/CAmRoutingReceiver.cpp
src/CAmRoutingSender.cpp
src/CAmRouter.cpp
- src/CAmSocketHandler.cpp
- src/CAmDltWrapper.cpp
src/CAmLog.cpp
-)
-
-
-# Preallocation variable for the map.
-IF(NOT WITH_DATABASE_STORAGE )
-
- IF(NOT DEFINED AM_MAP_CAPACITY)
- set (AM_MAP_CAPACITY 10)
- ENDIF(NOT DEFINED AM_MAP_CAPACITY)
- add_definitions( -DAM_MAP_CAPACITY=${AM_MAP_CAPACITY} )
+ "${AUDIOMANAGER_UTILITIES_SRC}/CAmSocketHandler.cpp"
+ "${AUDIOMANAGER_UTILITIES_SRC}/CAmDltWrapper.cpp")
- IF(NOT DEFINED AM_MAX_CONNECTIONS)
- set (AM_MAX_CONNECTIONS 0x1000)
- ENDIF(NOT DEFINED AM_MAX_CONNECTIONS)
- add_definitions( -DAM_MAX_CONNECTIONS=${AM_MAX_CONNECTIONS} )
-
- IF(NOT DEFINED AM_MAX_MAIN_CONNECTIONS)
- set (AM_MAX_MAIN_CONNECTIONS SHRT_MAX)
- ENDIF(NOT DEFINED AM_MAX_MAIN_CONNECTIONS)
- add_definitions( -DAM_MAX_MAIN_CONNECTIONS=${AM_MAX_MAIN_CONNECTIONS} )
-
-ENDIF(NOT WITH_DATABASE_STORAGE)
-
-IF(WITH_TELNET)
- SET (AUDIOMAN_SRCS_CXX
+if(WITH_TELNET)
+ set (AUDIOMAN_SRCS_CXX
${AUDIOMAN_SRCS_CXX}
src/CAmTelnetServer.cpp
- src/CAmTelnetMenuHelper.cpp
- )
-ENDIF(WITH_TELNET)
+ src/CAmTelnetMenuHelper.cpp)
+endif(WITH_TELNET)
-IF(WITH_SYSTEMD_WATCHDOG)
- SET (AUDIOMAN_SRCS_CXX
+if(WITH_SYSTEMD_WATCHDOG)
+ set (AUDIOMAN_SRCS_CXX
${AUDIOMAN_SRCS_CXX}
- src/CAmWatchdog.cpp
- )
-ENDIF(WITH_SYSTEMD_WATCHDOG)
-
-IF (NOT SYSTEMD_FOUND)
- SET (AUDIOMAN_SRCS_CXX
+ src/CAmWatchdog.cpp)
+ set (AM_LINK_LIBS
+ ${AM_LINK_LIBS}
+ ${SYSTEMD_LIBRARIES)
+endif(WITH_SYSTEMD_WATCHDOG)
+
+if (NOT SYSTEMD_FOUND)
+ set (AUDIOMAN_SRCS_CXX
${AUDIOMAN_SRCS_CXX}
- src/sd-daemon.c
- )
-ENDIF (NOT SYSTEMD_FOUND)
+ src/sd-daemon.c)
+endif (NOT SYSTEMD_FOUND)
-IF(WITH_DBUS_WRAPPER)
- SET (AUDIOMAN_SRCS_CXX
+if(WITH_DBUS_WRAPPER)
+ set (AUDIOMAN_SRCS_CXX
${AUDIOMAN_SRCS_CXX}
- src/CAmDbusWrapper.cpp
- )
-ENDIF(WITH_DBUS_WRAPPER)
-
-IF(WITH_CAPI_WRAPPER)
- SET (AUDIOMAN_SRCS_CXX
+ "${AUDIOMANAGER_UTILITIES_SRC}/CAmDbusWrapper.cpp")
+ set (AM_LINK_LIBS
+ ${AM_LINK_LIBS}
+ ${DBUS_LIBRARY})
+endif(WITH_DBUS_WRAPPER)
+
+if(WITH_CAPI_WRAPPER)
+ set (AUDIOMAN_SRCS_CXX
${AUDIOMAN_SRCS_CXX}
- src/CAmCommonAPIWrapper.cpp
- )
-ENDIF(WITH_CAPI_WRAPPER)
+ "${AUDIOMANAGER_UTILITIES_SRC}/CAmCommonAPIWrapper.cpp")
+ set (AM_LINK_LIBS
+ ${AM_LINK_LIBS}
+ ${DBUS_LIBRARY}
+ ${COMMON_API_LIBRARIES}
+ ${COMMON_API_DBUS_LIBRARIES})
+endif(WITH_CAPI_WRAPPER)
-IF(WITH_NSM)
- IF(WITH_DBUS_WRAPPER)
- SET (AUDIOMAN_SRCS_CXX
+if(WITH_NSM)
+ if(WITH_DBUS_WRAPPER)
+ set (AUDIOMAN_SRCS_CXX
${AUDIOMAN_SRCS_CXX}
- src/CAmNodeStateCommunicatorDBus.cpp
- )
- ELSE(WITH_DBUS_WRAPPER)
- SET (AUDIOMAN_SRCS_CXX
+ src/CAmNodeStateCommunicatorDBus.cpp)
+ else(WITH_DBUS_WRAPPER)
+ set (AUDIOMAN_SRCS_CXX
${AUDIOMAN_SRCS_CXX}
- src/CAmNodeStateCommunicatorCAPI.cpp
- )
- ENDIF(WITH_DBUS_WRAPPER)
-ENDIF(WITH_NSM)
+ src/CAmNodeStateCommunicatorCAPI.cpp)
+ endif(WITH_DBUS_WRAPPER)
+endif(WITH_NSM)
-IF(WITH_DATABASE_STORAGE)
- SET (AUDIOMAN_SRCS_CXX
+if(WITH_DATABASE_STORAGE)
+ set (AUDIOMAN_SRCS_CXX
${AUDIOMAN_SRCS_CXX}
- src/CAmDatabaseHandlerSQLite.cpp
- )
-ELSE(WITH_DATABASE_STORAGE)
- SET (AUDIOMAN_SRCS_CXX
+ src/CAmDatabaseHandlerSQLite.cpp)
+ set (AM_LINK_LIBS
+ ${AM_LINK_LIBS}
+ ${SQLITE_LIBRARIES})
+else(WITH_DATABASE_STORAGE)
+ set (AUDIOMAN_SRCS_CXX
${AUDIOMAN_SRCS_CXX}
- src/CAmDatabaseHandlerMap.cpp
- )
-ENDIF(WITH_DATABASE_STORAGE)
+ src/CAmDatabaseHandlerMap.cpp)
+endif(WITH_DATABASE_STORAGE)
INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${AUDIO_INCLUDE_FOLDER}
- ${PROJECT_INCLUDE_FOLDER}
+ ${AUDIOMANAGER_INCLUDE_FOLDER}
+ ${AUDIOMANAGER_UTILITIES_INCLUDE}
${INCLUDE_FOLDER}
${NSM_INCLUDE_DIR}
)
-IF(WITH_CAPI_WRAPPER)
-
-IF(WITH_NSM)
-# Find the common-api sources.
-# The sources can be placed in the build directory (DESTINATION) or in the source tree (ALT_DESTINATION).
-# The ALT_DESTINATION is used as fall back if the DESTINATION directory dosen't contain the sources or you just don't want to use the generator.
-INCLUDE(CommonAPIGenerator)
-COMMON_API_GENERATE_SOUCRES(TARGET COMMON_API
- FIDLS fidls/NodeStateManager.fdepl # a list with fidls
+if(WITH_CAPI_WRAPPER)
+
+ if(WITH_NSM)
+ include (CommonAPIGenerator)
+ COMMON_API_GENERATE_SOUCRES(TARGET COMMON_API
+ FIDLS fidls/NodeStateManager.fidl # a list with fidls
DESTINATION src-gen # a relative path to the build directory or an absolute path
ALT_DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/src-gen # an alternative relative/absolute path with common-api sources, usually in the source tree
DBUS)
-ENDIF(WITH_NSM)
-
-INCLUDE_DIRECTORIES(${INCLUDE_DIRECTORIES}
- ${COMMON_API_INCLUDE_DIRS}
- ${COMMON_API_DBUS_INCLUDE_DIRS}
- ${COMMON_API_GEN_INCLUDE_DIR}
-)
-ENDIF(WITH_CAPI_WRAPPER)
-
-IF(WITH_DLT)
-INCLUDE_DIRECTORIES(${INCLUDE_DIRECTORIES}
- ${DLT_INCLUDE_DIRS}
-)
-ENDIF(WITH_DLT)
-
-IF(WITH_DBUS_WRAPPER)
-INCLUDE_DIRECTORIES(${INCLUDE_DIRECTORIES}
+ set(AUDIOMAN_SRCS_CXX
+ ${AUDIOMAN_SRCS_CXX}
+ ${COMMON_API_GEN_SOURCES})
+ endif(WITH_NSM)
+
+ INCLUDE_DIRECTORIES(${INCLUDE_DIRECTORIES}
+ ${COMMON_API_INCLUDE_DIRS}
+ ${COMMON_API_DBUS_INCLUDE_DIRS}
+ ${COMMON_API_GEN_INCLUDE_DIR})
+
+endif(WITH_CAPI_WRAPPER)
+
+if(WITH_DLT)
+ INCLUDE_DIRECTORIES(${INCLUDE_DIRECTORIES}
+ ${DLT_INCLUDE_DIRS})
+ set (AM_LINK_LIBS
+ ${AM_LINK_LIBS}
+ ${DLT_LIBRARIES})
+endif(WITH_DLT)
+
+if(WITH_DBUS_WRAPPER)
+ INCLUDE_DIRECTORIES(${INCLUDE_DIRECTORIES}
${DBUS_ARCH_INCLUDE_DIR}
- ${DBUS_INCLUDE_DIR}
-)
-ENDIF(WITH_DBUS_WRAPPER)
-
-file(GLOB ${AUDIOMAN_SRCS_CXX} ${COMMON_API_GEN_SOURCES})
-
-ADD_EXECUTABLE(AudioManager ${AUDIOMAN_SRCS_CXX} ${COMMON_API_GEN_SOURCES})
-
-TARGET_LINK_LIBRARIES(AudioManager
- ${SQLITE_LIBRARIES}
- ${CMAKE_DL_LIBS}
- )
-
- IF(WITH_DBUS_WRAPPER)
- TARGET_LINK_LIBRARIES(AudioManager
- ${DBUS_LIBRARY}
- rt
- )
-ELSEIF(WITH_CAPI_WRAPPER)
- TARGET_LINK_LIBRARIES(AudioManager
- ${COMMON_API_LIBRARIES}
- ${COMMON_API_DBUS_LIBRARIES}
- rt
- )
-ENDIF()
-
-IF(WITH_DLT)
- TARGET_LINK_LIBRARIES(AudioManager
- ${DLT_LIBRARIES}
- )
-ENDIF(WITH_DLT)
-
-IF (SYSTEMD_FOUND)
- TARGET_LINK_LIBRARIES(AudioManager
- ${SYSTEMD_LIBRARIES}
- )
-ENDIF (SYSTEMD_FOUND)
-
-IF(WITH_CAPI_WRAPPER)
- IF(WITH_NSM)
- INSERT_DBUS_CONF_IF_NEEDED("@NSM_DBUS_CONF@"
- "${CMAKE_SOURCE_DIR}/AudioManagerDaemon/fidls/NodeStateManager_dbus.conf"
- NSM_DBUS_CONF)
- ENDIF(WITH_NSM)
-# Generates the dbus configuration file. Every component is responsible to append it dbus configuration part.
-CONFIGURE_FILE( ${CMAKE_SOURCE_DIR}/AudioManagerDaemon/fidls/AudioManager_dbus.conf.in ${CMAKE_SOURCE_DIR}/AudioManagerDaemon/fidls/AudioManager_dbus.conf)
-CONFIGURE_FILE( ${CMAKE_SOURCE_DIR}/AudioManagerDaemon/fidls/AudioManager_dbus.conf.in ${CMAKE_BINARY_DIR}/AudioManager_dbus.conf)
-
-ENDIF(WITH_CAPI_WRAPPER)
+ ${DBUS_INCLUDE_DIR})
+endif(WITH_DBUS_WRAPPER)
+
+ADD_EXECUTABLE(AudioManager ${AUDIOMAN_SRCS_CXX})
+TARGET_LINK_LIBRARIES(AudioManager ${AM_LINK_LIBS})
INSTALL(TARGETS AudioManager
- RUNTIME
- DESTINATION bin
+ RUNTIME DESTINATION bin
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
- COMPONENT bin
-)
+ COMPONENT bin)
INSTALL(DIRECTORY "${AUDIO_INCLUDE_FOLDER}/"
- DESTINATION include
- COMPONENT dev
-)
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/${LIB_INSTALL_SUFFIX}
+ COMPONENT dev)
-IF(WITH_NSM)
- IF(USE_BUILD_LIBS)
- SET(NSM_INTROSPECTION_FILE ${EXECUTABLE_OUTPUT_PATH}/LifeCycleConsumer.xml)
- execute_process(
- COMMAND mkdir -p "${CMAKE_SOURCE_DIR}/bin"
- COMMAND cp "${CMAKE_SOURCE_DIR}/cmake/LifecycleConsumer.xml" ${NSM_INTROSPECTION_FILE}
- COMMAND cp "${CMAKE_BINARY_DIR}/AudioManager_dbus.conf" ${EXECUTABLE_OUTPUT_PATH})
- ELSE(USE_BUILD_LIBS)
- SET(NSM_INTROSPECTION_FILE ${AM_SHARE_FOLDER}/LifecycleConsumer.xml)
- INSTALL(
- FILES ${CMAKE_SOURCE_DIR}/cmake/LifecycleConsumer.xml #${CMAKE_BINARY_DIR}/AudioManager_dbus.conf
- DESTINATION "${NSM_INTROSPECTION_FILE}"
- COMPONENT bin)
- ENDIF(USE_BUILD_LIBS)
-ENDIF(WITH_NSM)
-
-CONFIGURE_FILE( ${CMAKE_SOURCE_DIR}/cmake/config.cmake ${CMAKE_SOURCE_DIR}/include/config.h )
-
-IF(WITH_TESTS)
- add_subdirectory (test)
-ENDIF(WITH_TESTS)
-
-# General packet dependency
-IF(WITH_DATABASE_STORAGE)
- SET(ADD_DEPEND_BIN_PROP "sqlite3(>=3.6.22)")
-ENDIF(WITH_DATABASE_STORAGE)
-
-# Optional packet dependency
-IF(WITH_DLT)
- SET(ADD_DEPEND_BIN_PROP ${ADD_DEPEND_BIN_PROP} "dlt")
-ENDIF(WITH_DLT)
-
-IF(WITH_DBUS_WRAPPER)
- SET(ADD_DEPEND_BIN_PROP ${ADD_DEPEND_BIN_PROP} "libdbus-1-3(>=1.2.16)")
-ENDIF(WITH_DBUS_WRAPPER)
+INSTALL(DIRECTORY "${AUDIOMANAGER_UTILITIES_INCLUDE}/"
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/${LIB_INSTALL_SUFFIX}
+ COMPONENT dev)
-# Additional Dev packet dependency
-SET(ADD_DEPEND_DEV_PROP "audiomanager-bin" ${ADD_DEPEND_BIN_PROP})
-
-set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2 -fno-common -fno-strict-aliasing -DNDEBUG")
-
-MESSAGE(STATUS "bin packet dependency: ${ADD_DEPEND_BIN_PROP}")
-MESSAGE(STATUS "dev dependency: ${ADD_DEPEND_DEV_PROP}")
-
-set_property(GLOBAL APPEND PROPERTY bin_prop "${ADD_DEPEND_BIN_PROP}")
-set_property(GLOBAL APPEND PROPERTY dev_prop "${ADD_DEPEND_DEV_PROP}")
+if(WITH_TESTS)
+ add_subdirectory (test)
+endif(WITH_TESTS)
diff --git a/AudioManagerDaemon/docx/Doxyfile.in b/AudioManagerDaemon/docx/Doxyfile.in
index a17e7c6..5f04e05 100644
--- a/AudioManagerDaemon/docx/Doxyfile.in
+++ b/AudioManagerDaemon/docx/Doxyfile.in
@@ -6,7 +6,7 @@
DOXYFILE_ENCODING = UTF-8
PROJECT_NAME = AudioManager
PROJECT_NUMBER = @DAEMONVERSION@
-OUTPUT_DIRECTORY = @CMAKE_SOURCE_DIR@/doc
+OUTPUT_DIRECTORY = @DOC_OUTPUT_PATH@
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
BRIEF_MEMBER_DESC = YES
@@ -93,7 +93,7 @@ FILE_PATTERNS = *.h *.cpp *.dox
RECURSIVE = YES
EXCLUDE =
EXCLUDE_SYMLINKS = NO
-EXCLUDE_PATTERNS = */test/* */Plugin*DBus*/* */PluginControl*/* */build*/* */cmake/* */exampleCode/* */googleMock/* */ProjectSpecific/*
+EXCLUDE_PATTERNS = */test/* */build*/* */cmake/* */googleMock/*
EXCLUDE_SYMBOLS =
EXAMPLE_PATH = @CMAKE_SOURCE_DIR@
EXAMPLE_PATTERNS =
diff --git a/AudioManagerDaemon/fidls/AudioManagerTypes.fidl b/AudioManagerDaemon/fidls/AudioManagerTypes.fidl
deleted file mode 100644
index 956b400..0000000
--- a/AudioManagerDaemon/fidls/AudioManagerTypes.fidl
+++ /dev/null
@@ -1,1287 +0,0 @@
-package org.genivi
-
-<**
- @author : Christian Linke
-**>
-typeCollection am {
- version {
- major 2
- minor 0
- }
- array am_MainConnection_L of am_MainConnectionType_s
-
- array am_SinkClass_L of am_SinkClass_s
-
- array am_SinkType_L of am_SinkType_s
-
- array am_SourceClass_L of am_SourceClass_s
-
- array am_SourceType_L of am_SourceType_s
-
- array am_SystemProperty_L of am_SystemProperty_s
-
- array am_ClassProperty_L of am_ClassProperty_s
-
- array am_ConnectionID_L of am_connectionID_t
-
- array am_EarlyData_L of am_EarlyData_s
-
- array am_MainSoundProperty_L of am_MainSoundProperty_s
-
- array am_NotificationConfiguration_L of am_NotificationConfiguration_s
-
- array am_RoutingElement_L of am_RoutingElement_s
-
- array am_SoundProperty_L of am_SoundProperty_s
-
- array am_Volumes_L of am_Volumes_s
-
- array am_ConnectionFormat_L of am_CustomConnectionFormat_t
-
- array am_Convertion_L of am_bool_t
-
- <**
- @description : a source ID
- **>
- typedef am_sourceID_t is UInt16
- typedef am_bool_t is Boolean
-
- <**
- @description : a domain ID
- **>
- typedef am_domainID_t is UInt16
-
- <**
- @description : a gateway ID
- **>
- typedef am_gatewayID_t is UInt16
-
- <**
- @description : a converter ID
- **>
- typedef am_converterID_t is UInt16
-
- <**
- @description : a connection ID
- **>
- typedef am_connectionID_t is UInt16
-
- <**
- @description : a crossfader ID
- **>
- typedef am_crossfaderID_t is UInt16
-
- <**
- @description : a mainConnection ID
- **>
- typedef am_mainConnectionID_t is UInt16
-
- <**
- @description : This is the volume presented on the command interface. It is in the duty of the Controller to change the volumes given here into meaningful values on the routing interface.
-The range of this type is customer specific.
- **>
- typedef am_mainVolume_t is Int16
-
- <**
- @description : The unit is 0.1 db steps,The smallest value -3000 (=AM_MUTE). The minimum and maximum can be limited by actual project.
- **>
- typedef am_volume_t is Int16
-
- <**
- @description : time in ms!
- **>
- typedef am_time_t is Int16
-
- <**
- @description : offset time that is introduced in milli seconds.
- **>
- typedef am_timeSync_t is Int16
- typedef am_sourceClass_t is UInt16
-
- <**
- @description : speed
- **>
- typedef am_speed_t is UInt16
- typedef am_sinkClass_t is UInt16
-
- <**
- @description : a sink ID
- **>
- typedef am_sinkID_t is UInt16
-
- <**
- @description : This project specific value classifies the format in which data is exchanged within a connection.
- **>
- typedef am_CustomConnectionFormat_t is UInt16
-
- <**
- @description : This project specific value gives the information about reason for reason for Source/Sink change
- **>
- typedef am_CustomAvailabilityReason_t is UInt16
-
- <**
- @description : product specific identifier of property
- **>
- typedef am_CustomClassProperty_t is UInt16
-
- <**
- @description : For products, different ramp types can be defined here.
-It is in the responsibility of the product to make sure that the routing plugins are aware of the ramp types used.
- **>
- typedef am_CustomRampType_t is UInt16
-
- <**
- @description : Project specific sound properties.
- **>
- typedef am_CustomSoundPropertyType_t is UInt16
-
- <**
- @description : Here are all SoundProperties that can be set via the CommandInterface. Product specific
- **>
- typedef am_CustomMainSoundPropertyType_t is UInt16
-
- <**
- @description : describes the different system properties. Project specific
- **>
- typedef am_CustomSystemPropertyType_t is UInt16
-
- <**
- @description : gives the type of the Notification.
- **>
- typedef am_CustomNotificationType_t is UInt16
-
- <**
- @description : with the help of this enum, sinks and sources can report their availability state
- **>
- enumeration am_Availability_e {
-
- <**
- @description : default
- **>
- A_UNKNOWN = "0"
-
- <**
- @description : The source / sink is available
- **>
- A_AVAILABLE = "1"
-
- <**
- @description : the source / sink is not available
- **>
- A_UNAVAILABLE = "2"
- A_MAX
- }
-
- <**
- @description : describes the active sink of a crossfader.
- **>
- enumeration am_HotSink_e {
-
- <**
- @description : default
- **>
- HS_UNKNOWN = "0"
-
- <**
- @description : sinkA is active
- **>
- HS_SINKA = "1"
-
- <**
- @description : sinkB is active
- **>
- HS_SINKB = "2"
-
- <**
- @description : the crossfader is in the transition state
- **>
- HS_INTERMEDIATE = "3"
- HS_MAX
- }
-
- <**
- @description : represents the connection state
- **>
- enumeration am_ConnectionState_e {
- CS_UNKNOWN = "0"
-
- <**
- @description : This means the connection is just building up
- **>
- CS_CONNECTING = "1"
-
- <**
- @description : the connection is ready to be used
- **>
- CS_CONNECTED = "2"
-
- <**
- @description : the connection is in the course to be knocked down
- **>
- CS_DISCONNECTING = "3"
-
- <**
- @description : only relevant for connectionStatechanged. Is send after the connection was removed
- **>
- CS_DISCONNECTED = "4"
-
- <**
- @description : this means the connection is still build up but unused at the moment
- **>
- CS_SUSPENDED = "5"
- CS_MAX
- }
-
- enumeration am_DomainState_e {
-
- <**
- @description : default
- **>
- DS_UNKNOWN = "0"
-
- <**
- @description : the domain is controlled by the daemon
- **>
- DS_CONTROLLED = "1"
-
- <**
- @description : the domain is independent starting up
- **>
- DS_INDEPENDENT_STARTUP = "1"
-
- <**
- @description : the domain is independent running down
- **>
- DS_INDEPENDENT_RUNDOWN = "2"
- DS_MAX
- }
-
- <**
- @description : This enum characterizes the data of the EarlyData_t
- **>
- enumeration am_EarlyDataType_e {
-
- <**
- @description : default
- **>
- ES_UNKNOWN = "0"
-
- <**
- @description : the source volume
- **>
- ED_SOURCE_VOLUME = "1"
-
- <**
- @description : the sink volume
- **>
- ED_SINK_VOLUME = "2"
-
- <**
- @description : a source property
- **>
- ED_SOURCE_PROPERTY = "3"
-
- <**
- @description : a sink property
- **>
- ED_SINK_PROPERTY = "4"
- ED_MAX
- }
-
- <**
- @description : the errors of the audiomanager. All possible errors are in here. This enum is used widely as return parameter.
- **>
- enumeration am_Error_e {
-
- <**
- @description : no error - positive reply
- **>
- E_OK = "0"
-
- <**
- @description : default
- **>
- E_UNKNOWN = "1"
-
- <**
- @description : value out of range
- **>
- E_OUT_OF_RANGE = "2"
-
- <**
- @description : not used
- **>
- E_NOT_USED = "3"
-
- <**
- @description : a database error occurred
- **>
- E_DATABASE_ERROR = "4"
-
- <**
- @description : the desired object already exists
- **>
- E_ALREADY_EXISTS = "5"
-
- <**
- @description : there is no change
- **>
- E_NO_CHANGE = "6"
-
- <**
- @description : the desired action is not possible
- **>
- E_NOT_POSSIBLE = "7"
-
- <**
- @description : the desired object is non existent
- **>
- E_NON_EXISTENT = "8"
-
- <**
- @description : the asynchronous action was aborted
- **>
- E_ABORTED = "9"
-
- <**
- @description : This error is returned in case a connect is issued with a connectionFormat that cannot be selected for the connection. This could be either due to the capabilities of a source or a sink or gateway compatibilities for example
- **>
- E_WRONG_FORMAT = "10"
- E_MAX
- }
-
- enumeration am_MuteState_e {
-
- <**
- @description : default
- **>
- MS_UNKNOWN = "0"
-
- <**
- @description : the source / sink is muted
- **>
- MS_MUTED = "1"
-
- <**
- @description : the source / sink is unmuted
- **>
- MS_UNMUTED = "2"
- MS_MAX
- }
-
- enumeration am_InterruptState_e {
-
- <**
- @description : default
- **>
- IS_UNKNOWN = "0"
-
- <**
- @description : the interrupt state is off - no interrupt
- **>
- IS_OFF = "1"
-
- <**
- @description : the interrupt state is interrupted - the interrupt is active
- **>
- IS_INTERRUPTED = "2"
- IS_MAX
- }
-
- <**
- @description : This datatype determines if a sourceID or a sinkID is used in the union following
- **>
- enumeration am_VolumeType_e {
- VT_UNKNOWN = "0"
-
- <**
- @description : the following type is a sink
- **>
- VT_SINK = "1"
-
- <**
- @description : the following type is a source
- **>
- VT_SOURCE = "2"
- VT_MAX
- }
-
- enumeration am_NotificationStatus_e {
- NS_UNKNOWN = "0"
-
- <**
- @description : No notification, the function is turned off
- **>
- NS_OFF = "1"
-
- <**
- @description : Periodic notifications are sent out. The period in ms is given by am_NotificationParameter
- **>
- NS_PERIODIC = "2"
-
- <**
- @description : The notification is sent out when the minimum given by am_NotificationParameter is reached.
- **>
- NS_MINIMUM = "3"
-
- <**
- @description : The notification is sent out when the maximum given by am_NotificationParameter is reached.
- **>
- NS_MAXIMUM = "4"
-
- <**
- @description : The notification is sent out when a change happened. The Resolution of the change is defined by am_NotificationParameter.
- **>
- NS_CHANGE_ = "5"
- NS_MAX
- }
-
- <**
- @description : This enumeration is used to define the type of the action that is correlated to a handle.
- **>
- enumeration am_Handle_e {
- H_UNKNOWN = "0"
- H_CONNECT = "1"
- H_DISCONNECT = "2"
- H_SETSOURCESTATE = "3"
- H_SETSINKVOLUME = "4"
- H_SETSOURCEVOLUME = "5"
- H_SETSINKSOUNDPROPERTY = "6"
- H_SETSOURCESOUNDPROPERTY = "7"
- H_SETSINKSOUNDPROPERTIES = "8"
- H_SETSOURCESOUNDPROPERTIES = "9"
- H_CROSSFADE = "10"
- H_SETVOLUMES = "11"
- H_SETSINKNOTIFICATION = "12"
- H_SETSOURCENOTIFICATION = "13"
- H_MAX
- }
-
- <**
- @description : The source state reflects the state of the source
- **>
- enumeration am_SourceState_e {
- SS_UNKNNOWN = "0"
-
- <**
- @description : The source can be activly heared
- **>
- SS_ON = "1"
-
- <**
- @description : The source cannot be heared
- **>
- SS_OFF = "2"
-
- <**
- @description : The source is paused. Meaning it cannot be heared but should be prepared to play again soon.
- **>
- SS_PAUSED = "3"
- SS_MAX
- }
-
- <**
- @description : This enum describes the ready state of the routing part
- **>
- enumeration am_RoutingReady_e {
- RR_UNKNOWN = "0"
- RR_READY = "1"
- RR_RUNDOWN = "2"
- }
-
- <**
- @description : a list of routing elements that lead from source to sink
- **>
- struct am_Route_s {
-
- <**
- @description : the sourceID where the route starts
- **>
- am_sourceID_t sourceID
-
- <**
- @description : the sinkID where the route ends
- **>
- am_sinkID_t sinkID
-
- <**
- @description : the actual route as list of routing elements
- **>
- am_RoutingElement_L route
- }
-
- <**
- @description : this describes the availability of a sink or a source together with the latest change
- **>
- struct am_Availability_s {
-
- <**
- @description : the current availability state
- **>
- am_Availability_e availability
-
- <**
- @description : the reason for the last change. This can be used to trigger events that deal with state changes.
- **>
- am_CustomAvailabilityReason_t availabilityReason
- }
-
- <**
- @description : describes class properties
- **>
- struct am_ClassProperty_s {
-
- <**
- @description : the property as enum
- **>
- am_CustomClassProperty_t classProperty
-
- <**
- @description : the value of the property
- **>
- Int16 value
- }
-
- <**
- @description : This struct describes the attribiutes of a crossfader.
- **>
- struct am_Crossfader_s {
-
- <**
- @description : This is the ID of the crossfader, it is unique in the system. There are 2 ways, ID can be created: either it is assigned during the registration process (in a dynamic context, uniqueness will be ensured by the AudioManager daemon), or it is a fixed (the project has to ensure the uniqueness of the ID).
- **>
- am_crossfaderID_t crossfaderID
-
- <**
- @description : The name of the crossfader. Must be unique in the whole system.
- **>
- String name
-
- <**
- @description : The sinkID of the SinkA. Sinks shall be registered before registering the crossfader.
- **>
- am_sinkID_t sinkID_A
-
- <**
- @description : The sinkID of the SinkB. Sinks shall be registered before registering the crossfader.
- **>
- am_sinkID_t sinkID_B
-
- <**
- @description : The sourceID of the crossfader source. The source shall be registered before the crossfader.
- **>
- am_sourceID_t sourceID
-
- <**
- @description : This enum can have 3 states:
-
- HS_SINKA sinkA is the current hot one, sinkB is not audible
- HS_SINKB sinkB is the current hot one, sinkB is not audible
- HS_INTERMEDIATE the fader is stuck in between a cross-fading action. This could be due to an abort or an error. Before using the crossfader, it must be set to either HS_SINKA or HS_SINKB.
- **>
- am_HotSink_e hotSink
- }
-
- <**
- @description : This struct describes the attributes of a gateway.
- **>
- struct am_Gateway_s {
-
- <**
- @description : This is the ID of the gateway, it is unique in the system. There are 2 ways, ID can be created: either it is assigned during the registration process (in a dynamic context, uniqueness will be ensured by the AudioManagerDaemon), or it is a fixed (the project has to ensure the uniqueness of the ID).
- **>
- am_gatewayID_t gatewayID
-
- <**
- @description : The name of the gateway. Must be unique in the whole system.
- **>
- String name
-
- <**
- @description : The sinkID of the gateway sink-end. The sink is a full blown sink with connectionFormats, sinkClassIDs etc... It makes sense to register the sinks of a gateway as non-visible. Care needs to be taken that the connectionsFormats match with the ones in the conversionMatrix. If the sink is located in the controllingDomain, the ID needs to be retrieved by registering the sink before registering the gateway. In case the sink is in a different domain, the ID needs to be retrieved via peeking.
- **>
- am_sinkID_t sinkID
-
- <**
- @description : The sourceID of the gateway sink-end. The sink is a full blown source with connectionFormats, sinkClassIDs etc... It makes sense to register the sources of a gateway as non-visible. Care needs to be taken that the connectionsFormats match with the ones in the conversionMatrix. If the source is located in the controllingDomain, the ID needs to be retrieved by registering the source before registering the gateway. In case the source is in a different domain, the ID needs to be retrieved via peeking.
- **>
- am_sourceID_t sourceID
-
- <**
- @description : The ID of the sink. If the domain is the same like the controlling domain, the ID is known due to registration. If the domain is different, the ID needs to be retrieved via peeking.
- **>
- am_domainID_t domainSinkID
-
- <**
- @description : The ID of the source. If the domain is the same like the controlling domain, the ID is known due to registration. If the domain is different, the ID needs to be retrieved via peeking.
- **>
- am_domainID_t domainSourceID
-
- <**
- @description : This is the ID of the domain that registers the gateway.
- **>
- am_domainID_t controlDomainID
-
- <**
- @description : This is the list of available formats on the source side of the gateway. It is not defined during the gateway registration but copied from the source registration.
- **>
- am_ConnectionFormat_L listSourceFormats
-
- <**
- @description : This is the list of available formats on the sink side of the gateway. It is not defined during the gateway registration but copied from the sink registration.
- **>
- am_ConnectionFormat_L listSinkFormats
-
- <**
- @description : This is matrix holding information about the conversion capability of the gateway, it's length is defined by the length(listSinkFormats) x length(listSourceFormats).
-If a SinkFormat can be converted into a SourceFormat, the vector will hold a 1, if no conversion is possible, a 0.
-The data is stored row orientated, where the rows are related to the sinksFormats and the columns to the sourceFormats. The first value will hold the conversion information from the first sourceFormat to the first sinkFormat for example and the seventh value the information about the 3rd sinkFormat to the 1st sourceFormat in case we would have 3 sourceFormats.
- **>
- am_Convertion_L convertionMatrix
- }
-
-<**
- @description : This struct describes the attributes of a gateway.
- **>
- struct am_Converter_s {
-
- <**
- @description : This is the ID of the gateway, it is unique in the system. There are 2 ways, ID can be created: either it is assigned during the registration process (in a dynamic context, uniqueness will be ensured by the AudioManagerDaemon), or it is a fixed (the project has to ensure the uniqueness of the ID).
- **>
- am_converterID_t converterID
-
- <**
- @description : The name of the gateway. Must be unique in the whole system.
- **>
- String name
-
- <**
- @description : The sinkID of the gateway sink-end. The sink is a full blown sink with connectionFormats, sinkClassIDs etc... It makes sense to register the sinks of a gateway as non-visible. Care needs to be taken that the connectionsFormats match with the ones in the conversionMatrix. If the sink is located in the controllingDomain, the ID needs to be retrieved by registering the sink before registering the gateway. In case the sink is in a different domain, the ID needs to be retrieved via peeking.
- **>
- am_sinkID_t sinkID
-
- <**
- @description : The sourceID of the gateway sink-end. The sink is a full blown source with connectionFormats, sinkClassIDs etc... It makes sense to register the sources of a gateway as non-visible. Care needs to be taken that the connectionsFormats match with the ones in the conversionMatrix. If the source is located in the controllingDomain, the ID needs to be retrieved by registering the source before registering the gateway. In case the source is in a different domain, the ID needs to be retrieved via peeking.
- **>
- am_sourceID_t sourceID
-
- <**
- @description : The ID of the sink. If the domain is the same like the controlling domain, the ID is known due to registration. If the domain is different, the ID needs to be retrieved via peeking.
- **>
- am_domainID_t domainID
-
- <**
- @description : This is the list of available formats on the source side of the gateway. It is not defined during the gateway registration but copied from the source registration.
- **>
- am_ConnectionFormat_L listSourceFormats
-
- <**
- @description : This is the list of available formats on the sink side of the gateway. It is not defined during the gateway registration but copied from the sink registration.
- **>
- am_ConnectionFormat_L listSinkFormats
-
- <**
- @description : This is matrix holding information about the conversion capability of the gateway, it's length is defined by the length(listSinkFormats) x length(listSourceFormats).
-If a SinkFormat can be converted into a SourceFormat, the vector will hold a 1, if no conversion is possible, a 0.
-The data is stored row orientated, where the rows are related to the sinksFormats and the columns to the sourceFormats. The first value will hold the conversion information from the first sourceFormat to the first sinkFormat for example and the seventh value the information about the 3rd sinkFormat to the 1st sourceFormat in case we would have 3 sourceFormats.
- **>
- am_Convertion_L convertionMatrix
- }
-
- <**
- @description : This represents one "hopp" in a route
- **>
- struct am_RoutingElement_s {
-
- <**
- @description : the source ID
- **>
- am_sourceID_t sourceID
-
- <**
- @description : the sinkID
- **>
- am_sinkID_t sinkID
-
- <**
- @description : the domainID the routeElement is in
- **>
- am_domainID_t domainID
-
- <**
- @description : the connectionformat that is used for the route
- **>
- am_CustomConnectionFormat_t connectionFormat
- }
-
- <**
- @description : struct describing the sound property
- **>
- struct am_SoundProperty_s {
-
- <**
- @description : the type of the property - a project specific enum
- **>
- am_CustomSoundPropertyType_t type
-
- <**
- @description : the actual value of the property
- **>
- Int16 value
- }
-
- <**
- @description : struct describing system properties
- **>
- struct am_SystemProperty_s {
-
- <**
- @description : the type that is set
- **>
- am_CustomSystemPropertyType_t type
-
- <**
- @description : the value
- **>
- Int16 value
- }
-
- <**
- @description : struct describing sinkclasses
- **>
- struct am_SinkClass_s {
-
- <**
- @description : the ID of the sinkClass
- **>
- am_sinkClass_t sinkClassID
-
- <**
- @description : the name of the sinkClass - must be unique in the system
- **>
- String name
-
- <**
- @description : the list of the class properties. These are pairs of a project specific enum describing the type of the value and an integer holding the real value.
- **>
- am_ClassProperty_L listClassProperties
- }
-
- <**
- @description : struct describing source classes
- **>
- struct am_SourceClass_s {
-
- <**
- @description : the source ID
- **>
- am_sourceClass_t sourceClassID
-
- <**
- @description : the name of the sourceClass - must be unique in the system
- **>
- String name
-
- <**
- @description : the list of the class properties. These are pairs of a project specific enum describing the type of the value and an integer holding the real value.
- **>
- am_ClassProperty_L listClassProperties
- }
-
- <**
- @description : this type holds all information of sources relevant to the HMI
- **>
- struct am_SourceType_s {
-
- <**
- @description : This is the ID of the source, it is unique in the system. There are 2 ways, ID can be created: either it is assigned during the registration process (in a dynamic context, uniqueness will be ensured by the AudioManagerDaemon), or it is a fixed (the project has to ensure the uniqueness of the ID).
- **>
- am_sourceID_t sourceID
-
- <**
- @description : The name of the source. Must be unique in the whole system.
- **>
- String name
-
- <**
- @description : the availability of the source
- **>
- am_Availability_s availability
-
- <**
- @description : the sourceClassID, indicates the class the source is in. This information can be used by the Controller to implement different behaviour for different classes.
- **>
- am_sourceClass_t sourceClassID
- }
-
- <**
- @description : this type holds all information of sinks relevant to the HMI
- **>
- struct am_SinkType_s {
-
- <**
- @description : This is the ID of the sink, it is unique in the system. There are 2 ways, ID can be created: either it is assigned during the registration process (in a dynamic context, uniqueness will be ensured by the AudioManagerDaemon), or it is a fixed (the project has to ensure the uniqueness of the ID).
- **>
- am_sinkID_t sinkID
-
- <**
- @description : The name of the sink. Must be unique in the whole system.
- **>
- String name
-
- <**
- @description : This attribute reflects the availability of the sink. There are several reasons why a sink could be not available for the moment: for example the shutdown of a sink because of overtemperature or over- &amp; undervoltage. The availability consists of two pieces of information:
-
- Availablility: the status itself, can be A_AVAILABLE, A_UNAVAILABLE or A_UNKNOWN
- AvailabilityReason: this informs about the last reason for a change in availability. The reasons itself are product specific.
- **>
- am_Availability_s availability
-
- <**
- @description : This is the representation of the Volume for the commandInterface. It is used by the HMI to set the volume of a sink, the AudioManagerController has to transform this into real source and sink volumes.
- **>
- am_mainVolume_t volume
- am_MuteState_e muteState
-
- <**
- @description : The sinkClassID references to a sinkClass. With the help of classification, rules can be setup to define the system behaviour.
- **>
- am_sinkClass_t sinkClassID
- }
-
- <**
- @description : a handle is used for asynchronous operations and is uniquely assigned for each of this operations
- **>
- struct am_Handle_s {
-
- <**
- @description : the handletype
- **>
- am_Handle_e handleType
-
- <**
- @description : the handle as value
- **>
- UInt16 handle
- }
-
- <**
- @description : struct describung mainsound property
- **>
- struct am_MainSoundProperty_s {
-
- <**
- @description : the type of the property
- **>
- am_CustomMainSoundPropertyType_t type
-
- <**
- @description : the actual value
- **>
- Int16 value
- }
-
- <**
- @description : this type holds all information of connections relevant to the HMI
- **>
- struct am_MainConnectionType_s {
-
- <**
- @description : the ID of the mainconnection
- **>
- am_mainConnectionID_t mainConnectionID
-
- <**
- @description : the sourceID where the connection starts
- **>
- am_sourceID_t sourceID
-
- <**
- @description : the sinkID where the connection ends
- **>
- am_sinkID_t sinkID
-
- <**
- @description : the delay of the mainconnection
- **>
- am_timeSync_t delay
-
- <**
- @description : the current connection state
- **>
- am_ConnectionState_e connectionState
- }
-
- <**
- @description : struct that holds attribiutes of a mainconnection
- **>
- struct am_MainConnection_s {
-
- <**
- @description : the assigned ID
- **>
- am_mainConnectionID_t mainConnectionID
-
- <**
- @description : the current connection state
- **>
- am_ConnectionState_e connectionState
-
- <**
- @description : the sinkID
- **>
- am_sinkID_t sinkID
-
- <**
- @description : the sourceID
- **>
- am_sourceID_t sourceID
-
- <**
- @description : the delay of the connection
- **>
- am_timeSync_t delay
-
- <**
- @description : the list of sub connection IDs the mainconnection consists of
- **>
- am_ConnectionID_L listConnectionID
- }
-
- <**
- @description : This struct holds the payload of a notification.
- **>
- struct am_NotificationPayload_s {
-
- <**
- @description : This defines the notification type
- **>
- am_CustomNotificationType_t type
-
- <**
- @description : This is finally the value of the notification. It's meaning depends on the notificationType
- **>
- Int16 value
- }
-
- <**
- @description : This struct holds information about the configuration for notifications
- **>
- struct am_NotificationConfiguration_s {
-
- <**
- @description : The notification type of the notification
- **>
- am_CustomNotificationType_t type
-
- <**
- @description : The Notification status. This can be periodic, min/max value based or even off for example
- **>
- am_NotificationStatus_e status
-
- <**
- @description : This gives additional information to the notification status.
-Relation between notification status and the value:
-NS_PERIODIC - the period in ms
-NS_MINIMUM - the minimum value that triggers the notification
-NS_MAXIMUM - the maximum value that triggers the notifcation
-NS_CHANGE - the resolution of the change value
- **>
- Int16 parameter
- }
-
- <**
- @description : This struct describes the attribiutes of a sink
- **>
- struct am_Sink_s {
-
- <**
- @description : This is the ID of the sink, it is unique in the system. There are 2 ways, ID can be created: either it is assigned during the registration process (in a dynamic context, uniqueness will be ensured by the AudioManagerDaemon), or it is a fixed (the project has to ensure the uniqueness of the ID).
- **>
- am_sinkID_t sinkID
-
- <**
- @description : The name of the sink. Must be unique in the whole system.
- **>
- String name
-
- <**
- @description : The domainID is the domain the sink belongs to. A sink can only be in one domain.
- **>
- am_domainID_t domainID
-
- <**
- @description : The sinkClassID references to a sinkClass. With the help of classification, rules can be setup to define the system behaviour.
- **>
- am_sinkClass_t sinkClassID
-
- <**
- @description : This is the volume of the sink. It is set by the AudioManagerController.
- **>
- am_volume_t volume
-
- <**
- @description : This Boolean flag indicates whether a sink is visible to the commandInterface or not. If the User must have the possibility to choose the source in the HMI, it must be visible. But there are also good reasons for invisible sinks, for example if the sink is part of a crossfader or gateway. HMI relevant changes in visible sinks will be automatically reported by the daemon to the commandInterface.
- **>
- Boolean visible
-
- <**
- @description : This attribute reflects the availability of the sink. There are several reasons why a sink could be not available for the moment: for example the shutdown of a sink because of overtemperature or over- &amp; undervoltage. The availability consists of two pieces of information:
-
- Availablility: the status itself, can be A_AVAILABLE, A_UNAVAILABLE or A_UNKNOWN
- AvailabilityReason: this informs about the last reason for a change in availability. The reasons itself are product specific.
- **>
- am_Availability_s available
-
- <**
- @description : This attribute reflects the muteState of the sink. The information is not the "real" state of the sink, but the HMI representation for he commandInterface controlled by the AudioManagerController.
- **>
- am_MuteState_e muteState
-
- <**
- @description : This is the representation of the Volume for the commandInterface. It is used by the HMI to set the volume of a sink, the AudioManagerController has to transform this into real source and sink volumes.
- **>
- am_mainVolume_t mainVolume
-
- <**
- @description : This is the list of soundProperties, that the sink is capable of. The soundProperties itself are project specific. For sinks, a possible soundProperty could be for example settings.
- **>
- am_SoundProperty_L listSoundProperties
-
- <**
- @description : This list holds information about the formats that the Source is capable of supporting when delivering audio.
- **>
- am_ConnectionFormat_L listConnectionFormats
-
- <**
- @description : This is the list of the available mainSoundProperties. The principle is the same than with soundProperties, but they are only visible to the CommandInterface.
- **>
- am_MainSoundProperty_L listMainSoundProperties
-
- <**
- @description : This is the list of the MainNotificationConfigurations. These notifications work on the level of command interface.
- **>
- am_NotificationConfiguration_L listMainNotificationConfigurations
-
- <**
- @description : This is the list of the NotificationConfigurations. These notifications work on the level of RoutingPlugins.
- **>
- am_NotificationConfiguration_L listNotificationConfigurations
- }
-
- <**
- @description : This struct describes the attribiutes of a source
- **>
- struct am_Source_s {
-
- <**
- @description : This is the ID of the source, it is unique in the system. There are 2 ways, ID can be created: either it is assigned during the registration process (in a dynamic context, uniqueness will be ensured by the AudioManagerDaemon), or it is a fixed (the project has to ensure the uniqueness of the ID).
- **>
- am_sourceID_t sourceID
-
- <**
- @description : The domainID is the domain the source belongs to. A source can only be in one domain.
- **>
- am_domainID_t domainID
-
- <**
- @description : The name of the source. Must be unique in the whole system.
- **>
- String name
-
- <**
- @description : the sourceClassID, indicates the class the source is in. This information can be used by the Controller to implement different behaviour for different classes.
- **>
- am_sourceClass_t sourceClassID
-
- <**
- @description : The source state is an indication towards the source if it is actively heard or not. The source can use this information to implement features like automatic spin down of CD's in case the CD is not the active source or AF following of a tuner that is not actively heard. The source state is set by the AudioManagerController.There are 3 possible states:
-
- SS_ON: the source is active
- SS_OFF: the source is off
- SS_PAUSED: the source is paused and not active.
- **>
- am_SourceState_e sourceState
-
- <**
- @description : This is the volume of the source. It is set by the AudioManagerController. It is used to adopt different audiolevels in a system and mixing of sources (e.g. navigation hints &amp; music).
- **>
- am_volume_t volume
-
- <**
- @description : This Boolean flag indicates whether a source is visible to the commandInterface or not. If the User must have the possibility to choose the source in the HMI, it must be visible. But there are also good reasons for invisible sources, for example if the source is part of a crossfader or gateway. HMI relevant changes in visible sources will be automatically reported by the daemon to the commandInterface.
- **>
- Boolean visible
-
- <**
- @description : This attribute reflects the availability of the source. There are several reasons why a source could be not available for the moment. For example a CD player which has no CD entered in the slot can be unavailable, or a USB player with no or unreadable stick attached. Other scenarios involve the shutdown of a source because of overtemperature or over- &amp; undervoltage. The availability consists of two informations:
-
- Availablility: the status itself, can be A_AVAILABLE, A_UNAVAILABLE or A_UNKNOWN
- AvailabilityReason: this informs about the last reason for a change in availability. The reasons itself are product specific.
- **>
- am_Availability_s available
-
- <**
- @description : Some special sources can have special behaviors, the are so called "Low Level Interrupts". Here the current status is documented. The information can be used by the AudioManagerController to react to the changes by for example lowering the volume of the mainSources. The two states are
-
- IS_OFF: the interrupt is not active at the moment
- IS_INTERRUPTED: the interrupt is playing at the moment.
- **>
- am_InterruptState_e interruptState
-
- <**
- @description : This is the list of soundProperties, that the source is capable of. The soundProperties itself are project specific. For sources, a possible soundProperty could be navigation volume offset, for example.
- **>
- am_SoundProperty_L listSoundProperties
-
- <**
- @description : This list holds information about the formats that the Source is capable of supporting when delivering audio.
- **>
- am_ConnectionFormat_L listConnectionFormats
-
- <**
- @description : This is the list of the available mainSoundProperties. The principle is the same than with soundProperties, but they are only visible to the CommandInterface.
- **>
- am_MainSoundProperty_L listMainSoundProperties
-
- <**
- @description : The list of MainNotificationConfigurations. These notifications work on the level of CommandInterface.
- **>
- am_NotificationConfiguration_L listMainNotificationConfigurations
-
- <**
- @description : The list of MainNotificationConfigurations. These notifications work on the level of RoutingInterface.
- **>
- am_NotificationConfiguration_L listNotificationConfigurations
- }
-
- <**
- @description : This struct describes the attribiutes of a domain
- **>
- struct am_Domain_s {
-
- <**
- @description : the domain ID
- **>
- am_domainID_t domainID
-
- <**
- @description : the name of the domain
- **>
- String name
-
- <**
- @description : the busname. This is equal to a plugin name and is used to dispatch messages to the elements of a plugin
- **>
- String busname
-
- <**
- @description : the name of the node
- **>
- String nodename
-
- <**
- @description : indicated if the domain is independent at startup or not
- **>
- Boolean early
-
- <**
- @description : indicates if the domain registration is complete or not
- **>
- Boolean complete
-
- <**
- @description : the current domain state
- **>
- am_DomainState_e ^state
- }
-
- struct am_EarlyData_s {
- am_EarlyDataType_e type
- am_DataType_u sinksource
- am_EarlyData_u data
- }
-
- <**
- @description : a connection
- **>
- struct am_Connection_s {
-
- <**
- @description : the assigned ID
- **>
- am_connectionID_t connectionID
-
- <**
- @description : the source the audio flows from
- **>
- am_sourceID_t sourceID
-
- <**
- @description : the sink the audio flows to
- **>
- am_sinkID_t sinkID
-
- <**
- @description : the delay of the conneciton
- **>
- am_timeSync_t delay
-
- <**
- @description : the used connectionformat
- **>
- am_CustomConnectionFormat_t connectionFormat
- }
-
- <**
- @description : This types describe a mixed description for source and sinks volumes.
- **>
- struct am_Volumes_s {
-
- <**
- @description : describes the type of the volume: source or sink.
- **>
- am_VolumeType_e volumeType
-
- <**
- @description : either sourceID or sinkID
- **>
- am_DataType_u volumeID
-
- <**
- @description : The volume
- **>
- am_volume_t volume
-
- <**
- @description : the ramp that shall be driven
- **>
- am_CustomRampType_t ramp
-
- <**
- @description : the time for the ramp
- **>
- am_time_t time
- }
-
- <**
- @description : data type depends of am_EarlyDataType_e:
-volume_t in case of ED_SOURCE_VOLUME, ED_SINK_VOLUME
-soundProperty_t in case of ED_SOURCE_PROPERTY, ED_SINK_PROPERTY
- **>
- union am_EarlyData_u {
- am_volume_t volume
- am_SoundProperty_s soundProperty
- }
-
- <**
- @description : data type depends of am_EarlyDataType_e:
-sourceID in case of ED_SOURCE_VOLUME, ED_SOURCE_PROPERTY
-sinkID in case of ED_SINK_VOLUME, ED_SINK_PROPERTY
- **>
- union am_DataType_u {
- am_sinkID_t sink
- am_sourceID_t source
- }
-
-} \ No newline at end of file
diff --git a/AudioManagerDaemon/fidls/NodeStateManager_dbus.conf b/AudioManagerDaemon/fidls/NodeStateManager_dbus.conf
deleted file mode 100755
index 59620a7..0000000
--- a/AudioManagerDaemon/fidls/NodeStateManager_dbus.conf
+++ /dev/null
@@ -1,32 +0,0 @@
-######################################### Node state manager configuration #######################################
-# NodeStateManager_dbus.conf #
-# If you change something make sure you re-configure with 'ccmake..' which generates the *_dbus.conf file again. #
-##################################################################################################################
-#
-# Copyright (C) 2012, BMW AG
-#
-# This file is part of GENIVI Project AudioManager.
-#
-# Contributions are licensed to the GENIVI Alliance under one or more
-# Contribution License Agreements.
-#
-# \copyright
-# This Source Code Form is subject to the terms of the
-# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
-# this file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-#
-# \author Aleksandar Donchev, aleksander.donchev@partner.bmw.de BMW 2013
-#
-# For further information see http://www.genivi.org/.
-#
-
-[local:org.genivi.NodeStateManager.Consumer:org.genivi.NodeStateManager]
-dbus_connection=org.genivi.NodeStateManager
-dbus_object=/org/genivi/NodeStateManager
-dbus_interface=org.genivi.NodeStateManager.Consumer
-dbus_predefined=true
-[local:org.genivi.NodeStateManager.LifeCycleConsumer:org.genivi.audiomanager]
-dbus_connection=org.genivi.audiomanager
-dbus_object=/org/genivi/audiomanager/LifeCycleConsumer
-dbus_interface=org.genivi.NodeStateManager.LifeCycleConsumer
diff --git a/AudioManagerDaemon/include/CAmCommandReceiver.h b/AudioManagerDaemon/include/CAmCommandReceiver.h
index 8e9f0fd..fc27df7 100644
--- a/AudioManagerDaemon/include/CAmCommandReceiver.h
+++ b/AudioManagerDaemon/include/CAmCommandReceiver.h
@@ -12,7 +12,7 @@
* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*
- * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
*
* \file CAmCommandReceiver.h
* For further information see http://www.genivi.org/.
diff --git a/AudioManagerDaemon/include/CAmCommandSender.h b/AudioManagerDaemon/include/CAmCommandSender.h
index d7cc84c..78858f9 100644
--- a/AudioManagerDaemon/include/CAmCommandSender.h
+++ b/AudioManagerDaemon/include/CAmCommandSender.h
@@ -12,7 +12,7 @@
* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*
- * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
*
* \file CAmCommandSender.h
* For further information see http://www.genivi.org/.
diff --git a/AudioManagerDaemon/include/CAmControlReceiver.h b/AudioManagerDaemon/include/CAmControlReceiver.h
index 7902348..2a30108 100644
--- a/AudioManagerDaemon/include/CAmControlReceiver.h
+++ b/AudioManagerDaemon/include/CAmControlReceiver.h
@@ -12,7 +12,7 @@
* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*
- * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
*
* \file CAmControlReceiver.h
* For further information see http://www.genivi.org/.
diff --git a/AudioManagerDaemon/include/CAmControlSender.h b/AudioManagerDaemon/include/CAmControlSender.h
index fb82484..fe43fe3 100644
--- a/AudioManagerDaemon/include/CAmControlSender.h
+++ b/AudioManagerDaemon/include/CAmControlSender.h
@@ -12,7 +12,7 @@
* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*
- * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
*
* \file CAmControlSender.h
* For further information see http://www.genivi.org/.
@@ -27,7 +27,7 @@
#endif
#include "control/IAmControlSend.h"
-#include "shared/CAmSocketHandler.h"
+#include "CAmSocketHandler.h"
#include "unistd.h"
namespace am
diff --git a/AudioManagerDaemon/include/CAmDatabaseHandlerSQLite.h b/AudioManagerDaemon/include/CAmDatabaseHandlerSQLite.h
index 444ea5c..ad9a615 100644
--- a/AudioManagerDaemon/include/CAmDatabaseHandlerSQLite.h
+++ b/AudioManagerDaemon/include/CAmDatabaseHandlerSQLite.h
@@ -12,7 +12,7 @@
* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*
- * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
*
* \file CAmDatabaseHandlerSQLite.h
* For further information see http://www.genivi.org/.
diff --git a/AudioManagerDaemon/include/CAmDatabaseObserver.h b/AudioManagerDaemon/include/CAmDatabaseObserver.h
index d6f980d..4f3823d 100644
--- a/AudioManagerDaemon/include/CAmDatabaseObserver.h
+++ b/AudioManagerDaemon/include/CAmDatabaseObserver.h
@@ -12,7 +12,7 @@
* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*
- * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
*
* \file CAmDatabaseObserver.h
* For further information see http://www.genivi.org/.
@@ -24,7 +24,7 @@
#include "audiomanagertypes.h"
#include <queue>
-#include "shared/CAmSerializer.h"
+#include "CAmSerializer.h"
namespace am
{
diff --git a/AudioManagerDaemon/include/CAmNodeStateCommunicatorDBus.h b/AudioManagerDaemon/include/CAmNodeStateCommunicatorDBus.h
index cb78f0f..638adeb 100644
--- a/AudioManagerDaemon/include/CAmNodeStateCommunicatorDBus.h
+++ b/AudioManagerDaemon/include/CAmNodeStateCommunicatorDBus.h
@@ -21,7 +21,7 @@
#ifndef CAMNODESTATECOMMUNICATORDBUS_H_
#define CAMNODESTATECOMMUNICATORDBUS_H_
-#include "shared/CAmDbusWrapper.h"
+#include "CAmDbusWrapper.h"
#include "CAmNodeStateCommunicator.h"
namespace am
diff --git a/AudioManagerDaemon/include/CAmRouter.h b/AudioManagerDaemon/include/CAmRouter.h
index 6a3aacc..0c522a3 100644
--- a/AudioManagerDaemon/include/CAmRouter.h
+++ b/AudioManagerDaemon/include/CAmRouter.h
@@ -12,7 +12,7 @@
* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*
- * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
* \author Aleksandar Donchev, Aleksander.Donchev@partner.bmw.de BMW 2013,2014
*
* \file CAmRouter.h
diff --git a/AudioManagerDaemon/include/CAmRoutingReceiver.h b/AudioManagerDaemon/include/CAmRoutingReceiver.h
index be81529..c81fd50 100644
--- a/AudioManagerDaemon/include/CAmRoutingReceiver.h
+++ b/AudioManagerDaemon/include/CAmRoutingReceiver.h
@@ -12,7 +12,7 @@
* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*
- * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
*
* \file CAmRoutingReceiver.h
* For further information see http://www.genivi.org/.
diff --git a/AudioManagerDaemon/include/CAmRoutingSender.h b/AudioManagerDaemon/include/CAmRoutingSender.h
index d1e26b5..d19141d 100644
--- a/AudioManagerDaemon/include/CAmRoutingSender.h
+++ b/AudioManagerDaemon/include/CAmRoutingSender.h
@@ -12,7 +12,7 @@
* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*
- * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
*
* \file CAmRoutingSender.h
* For further information see http://www.genivi.org/.
diff --git a/AudioManagerDaemon/include/CAmTelnetMenuHelper.h b/AudioManagerDaemon/include/CAmTelnetMenuHelper.h
index 9476751..8d3f67a 100644
--- a/AudioManagerDaemon/include/CAmTelnetMenuHelper.h
+++ b/AudioManagerDaemon/include/CAmTelnetMenuHelper.h
@@ -12,7 +12,7 @@
* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*
- * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
* \author Frank Herchet, frank.fh.herchet@bmw.de BMW 2012
*
* \file CAmTelnetMenuHelper.h
diff --git a/AudioManagerDaemon/include/CAmTelnetServer.h b/AudioManagerDaemon/include/CAmTelnetServer.h
index 4275cce..e7eeda0 100644
--- a/AudioManagerDaemon/include/CAmTelnetServer.h
+++ b/AudioManagerDaemon/include/CAmTelnetServer.h
@@ -12,7 +12,7 @@
* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*
- * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
* \author Frank Herchet, frank.fh.herchet@bmw.de BMW 2012
*
* \file CAmTelnetServer.h
@@ -25,7 +25,7 @@
#include <queue>
#include <map>
-#include "shared/CAmSocketHandler.h"
+#include "CAmSocketHandler.h"
#include "CAmTelnetMenuHelper.h"
namespace am
diff --git a/AudioManagerDaemon/include/CAmWatchdog.h b/AudioManagerDaemon/include/CAmWatchdog.h
index b839f98..2f2f9f8 100755
--- a/AudioManagerDaemon/include/CAmWatchdog.h
+++ b/AudioManagerDaemon/include/CAmWatchdog.h
@@ -12,7 +12,7 @@
* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*
- * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
*
* \file CAmWatchdog.h
* For further information see http://www.genivi.org/.
@@ -22,7 +22,7 @@
#ifndef CAMWATCHDOG_H_
#define CAMWATCHDOG_H_
-#include "shared/CAmSocketHandler.h"
+#include "CAmSocketHandler.h"
namespace am
{
diff --git a/AudioManagerDaemon/include/TAmPluginTemplate.h b/AudioManagerDaemon/include/TAmPluginTemplate.h
index a421cd1..f391535 100644
--- a/AudioManagerDaemon/include/TAmPluginTemplate.h
+++ b/AudioManagerDaemon/include/TAmPluginTemplate.h
@@ -12,7 +12,7 @@
* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*
- * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
*
* \file TAmPluginTemplate.h
* For further information see http://www.genivi.org/.
@@ -24,7 +24,7 @@
#include <dlfcn.h>
#include <libgen.h>
-#include "shared/CAmDltWrapper.h"
+#include "CAmDltWrapper.h"
namespace am
{
diff --git a/AudioManagerDaemon/src/CAmCommandReceiver.cpp b/AudioManagerDaemon/src/CAmCommandReceiver.cpp
index 066fb81..43ccd20 100644
--- a/AudioManagerDaemon/src/CAmCommandReceiver.cpp
+++ b/AudioManagerDaemon/src/CAmCommandReceiver.cpp
@@ -12,7 +12,7 @@
* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*
- * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
*
* \file CAmCommandReceiver.cpp
* For further information see http://www.genivi.org/.
@@ -24,8 +24,8 @@
#include <algorithm>
#include "IAmDatabaseHandler.h"
#include "CAmControlSender.h"
-#include "shared/CAmDltWrapper.h"
-#include "shared/CAmSocketHandler.h"
+#include "CAmDltWrapper.h"
+#include "CAmSocketHandler.h"
namespace am
{
diff --git a/AudioManagerDaemon/src/CAmCommandSender.cpp b/AudioManagerDaemon/src/CAmCommandSender.cpp
index bb49c19..3882162 100644
--- a/AudioManagerDaemon/src/CAmCommandSender.cpp
+++ b/AudioManagerDaemon/src/CAmCommandSender.cpp
@@ -12,7 +12,7 @@
* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*
- * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
*
* \file CAmCommandSender.cpp
* For further information see http://www.genivi.org/.
@@ -29,7 +29,7 @@
#include <cstring>
#include "CAmCommandReceiver.h"
#include "TAmPluginTemplate.h"
-#include "shared/CAmDltWrapper.h"
+#include "CAmDltWrapper.h"
namespace am
{
diff --git a/AudioManagerDaemon/src/CAmControlReceiver.cpp b/AudioManagerDaemon/src/CAmControlReceiver.cpp
index 6ac7e0a..19b05bd 100644
--- a/AudioManagerDaemon/src/CAmControlReceiver.cpp
+++ b/AudioManagerDaemon/src/CAmControlReceiver.cpp
@@ -12,7 +12,7 @@
* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*
- * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
*
* \file CAmControlReceiver.cpp
* For further information see http://www.genivi.org/.
@@ -28,8 +28,8 @@
#include "CAmRoutingSender.h"
#include "CAmCommandSender.h"
#include "CAmRouter.h"
-#include "shared/CAmDltWrapper.h"
-#include "shared/CAmSocketHandler.h"
+#include "CAmDltWrapper.h"
+#include "CAmSocketHandler.h"
#ifdef WITH_NSM
#include "CAmNodeStateCommunicator.h"
#endif
diff --git a/AudioManagerDaemon/src/CAmControlSender.cpp b/AudioManagerDaemon/src/CAmControlSender.cpp
index dd3558e..bc51be0 100644
--- a/AudioManagerDaemon/src/CAmControlSender.cpp
+++ b/AudioManagerDaemon/src/CAmControlSender.cpp
@@ -12,7 +12,7 @@
* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*
- * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
*
* \file CAmControlSender.cpp
* For further information see http://www.genivi.org/.
@@ -26,7 +26,7 @@
#include <sstream>
#include <stdexcept>
#include "TAmPluginTemplate.h"
-#include "shared/CAmDltWrapper.h"
+#include "CAmDltWrapper.h"
namespace am
{
diff --git a/AudioManagerDaemon/src/CAmDatabaseHandlerMap.cpp b/AudioManagerDaemon/src/CAmDatabaseHandlerMap.cpp
index 864ae8c..501ea11 100644
--- a/AudioManagerDaemon/src/CAmDatabaseHandlerMap.cpp
+++ b/AudioManagerDaemon/src/CAmDatabaseHandlerMap.cpp
@@ -30,7 +30,7 @@
#include "CAmDatabaseHandlerMap.h"
#include "CAmDatabaseObserver.h"
#include "CAmRouter.h"
-#include "shared/CAmDltWrapper.h"
+#include "CAmDltWrapper.h"
namespace am
diff --git a/AudioManagerDaemon/src/CAmDatabaseHandlerSQLite.cpp b/AudioManagerDaemon/src/CAmDatabaseHandlerSQLite.cpp
index da86386..bad070c 100644
--- a/AudioManagerDaemon/src/CAmDatabaseHandlerSQLite.cpp
+++ b/AudioManagerDaemon/src/CAmDatabaseHandlerSQLite.cpp
@@ -12,7 +12,7 @@
* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*
- * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
*
* \file CAmDatabaseHandlerSQLite.cpp
* For further information see http://www.genivi.org/.
@@ -28,7 +28,7 @@
#include <string>
#include "CAmDatabaseObserver.h"
#include "CAmRouter.h"
-#include "shared/CAmDltWrapper.h"
+#include "CAmDltWrapper.h"
#include <sqlite3.h>
namespace am
diff --git a/AudioManagerDaemon/src/CAmDatabaseObserver.cpp b/AudioManagerDaemon/src/CAmDatabaseObserver.cpp
index 57a76cc..cec033f 100644
--- a/AudioManagerDaemon/src/CAmDatabaseObserver.cpp
+++ b/AudioManagerDaemon/src/CAmDatabaseObserver.cpp
@@ -12,7 +12,7 @@
* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*
- * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
*
* \file CAmDatabaseObserver.cpp
* For further information see http://www.genivi.org/.
@@ -28,8 +28,8 @@
#include "CAmCommandSender.h"
#include "CAmRoutingSender.h"
#include "CAmTelnetServer.h"
-#include "shared/CAmDltWrapper.h"
-#include "shared/CAmSerializer.h"
+#include "CAmDltWrapper.h"
+#include "CAmSerializer.h"
namespace am {
diff --git a/AudioManagerDaemon/src/CAmNodeStateCommunicatorCAPI.cpp b/AudioManagerDaemon/src/CAmNodeStateCommunicatorCAPI.cpp
index d772837..19aaa4b 100644
--- a/AudioManagerDaemon/src/CAmNodeStateCommunicatorCAPI.cpp
+++ b/AudioManagerDaemon/src/CAmNodeStateCommunicatorCAPI.cpp
@@ -1,5 +1,5 @@
/**
- * Copyright (C) 2012, BMW AG
+Von mir aus gerne. * Copyright (C) 2012, BMW AG
*
* This file is part of GENIVI Project AudioManager.
*
@@ -28,8 +28,8 @@
#include <memory>
#include <CommonAPI/CommonAPI.h>
#include "config.h"
-#include "shared/CAmCommonAPIWrapper.h"
-#include "shared/CAmDltWrapper.h"
+#include "CAmCommonAPIWrapper.h"
+#include "CAmDltWrapper.h"
#include "CAmNodeStateCommunicatorCAPI.h"
#include "CAmControlSender.h"
#include <org/genivi/NodeStateManager/LifeCycleConsumerProxy.h>
diff --git a/AudioManagerDaemon/src/CAmNodeStateCommunicatorDBus.cpp b/AudioManagerDaemon/src/CAmNodeStateCommunicatorDBus.cpp
index 4173890..14f208b 100644
--- a/AudioManagerDaemon/src/CAmNodeStateCommunicatorDBus.cpp
+++ b/AudioManagerDaemon/src/CAmNodeStateCommunicatorDBus.cpp
@@ -26,7 +26,7 @@
#include <sstream>
#include <stdexcept>
#include "CAmControlSender.h"
-#include "shared/CAmDltWrapper.h"
+#include "CAmDltWrapper.h"
#include "config.h"
namespace am
diff --git a/AudioManagerDaemon/src/CAmRouter.cpp b/AudioManagerDaemon/src/CAmRouter.cpp
index 6ab0a07..8e3069d 100644
--- a/AudioManagerDaemon/src/CAmRouter.cpp
+++ b/AudioManagerDaemon/src/CAmRouter.cpp
@@ -12,7 +12,7 @@
* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*
- * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
* \author Aleksandar Donchev, Aleksander.Donchev@partner.bmw.de BMW 2013,2014
*
* \file CAmRouter.cpp
@@ -27,7 +27,7 @@
#include "CAmRouter.h"
#include "IAmDatabaseHandler.h"
#include "CAmControlSender.h"
-#include "shared/CAmDltWrapper.h"
+#include "CAmDltWrapper.h"
diff --git a/AudioManagerDaemon/src/CAmRoutingReceiver.cpp b/AudioManagerDaemon/src/CAmRoutingReceiver.cpp
index 29f7db7..c36cde7 100644
--- a/AudioManagerDaemon/src/CAmRoutingReceiver.cpp
+++ b/AudioManagerDaemon/src/CAmRoutingReceiver.cpp
@@ -12,7 +12,7 @@
* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*
- * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
*
* \file CAmRoutingReceiver.cpp
* For further information see http://www.genivi.org/.
@@ -25,8 +25,8 @@
#include "IAmDatabaseHandler.h"
#include "CAmRoutingSender.h"
#include "CAmControlSender.h"
-#include "shared/CAmDltWrapper.h"
-#include "shared/CAmSocketHandler.h"
+#include "CAmDltWrapper.h"
+#include "CAmSocketHandler.h"
namespace am
{
diff --git a/AudioManagerDaemon/src/CAmRoutingSender.cpp b/AudioManagerDaemon/src/CAmRoutingSender.cpp
index cd9c3d7..77f12d0 100644
--- a/AudioManagerDaemon/src/CAmRoutingSender.cpp
+++ b/AudioManagerDaemon/src/CAmRoutingSender.cpp
@@ -12,7 +12,7 @@
* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*
- * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
*
* \file CAmRoutingSender.cpp
* For further information see http://www.genivi.org/.
@@ -31,7 +31,7 @@
#include <sstream>
#include "CAmRoutingReceiver.h"
#include "TAmPluginTemplate.h"
-#include "shared/CAmDltWrapper.h"
+#include "CAmDltWrapper.h"
namespace am
{
diff --git a/AudioManagerDaemon/src/CAmTelnetMenuHelper.cpp b/AudioManagerDaemon/src/CAmTelnetMenuHelper.cpp
index 1fb3ddf..f2fe095 100644
--- a/AudioManagerDaemon/src/CAmTelnetMenuHelper.cpp
+++ b/AudioManagerDaemon/src/CAmTelnetMenuHelper.cpp
@@ -12,7 +12,7 @@
* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*
- * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
* \author Frank Herchet, frank.fh.herchet@bmw.de BMW 2012
*
* \file CAmTelnetMenuHelper.cpp
@@ -32,7 +32,7 @@
#include "CAmRoutingReceiver.h"
#include "CAmCommandReceiver.h"
#include "CAmControlReceiver.h"
-#include "shared/CAmDltWrapper.h"
+#include "CAmDltWrapper.h"
static const std::string COLOR_WELCOME("\033[1;33m\033[44m");
static const std::string COLOR_HEAD("\033[1m\033[42m");
diff --git a/AudioManagerDaemon/src/CAmTelnetServer.cpp b/AudioManagerDaemon/src/CAmTelnetServer.cpp
index 3212ea7..4ae7420 100755
--- a/AudioManagerDaemon/src/CAmTelnetServer.cpp
+++ b/AudioManagerDaemon/src/CAmTelnetServer.cpp
@@ -12,7 +12,7 @@
* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*
- * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
* \author Frank Herchet, frank.fh.herchet@bmw.de BMW 2012
*
* \file CAmTelnetServer.cpp
@@ -38,7 +38,7 @@
#include <cstdlib>
#include "CAmRoutingSender.h"
#include "CAmTelnetMenuHelper.h"
-#include "shared/CAmDltWrapper.h"
+#include "CAmDltWrapper.h"
namespace am
{
diff --git a/AudioManagerDaemon/src/CAmWatchdog.cpp b/AudioManagerDaemon/src/CAmWatchdog.cpp
index db34009..874696e 100755
--- a/AudioManagerDaemon/src/CAmWatchdog.cpp
+++ b/AudioManagerDaemon/src/CAmWatchdog.cpp
@@ -12,7 +12,7 @@
* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*
- * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
*
* \file CAmWatchdog.cpp
* For further information see http://www.genivi.org/.
@@ -24,7 +24,7 @@
#include <cstdlib>
#include <stdexcept>
#include "config.h"
-#include "shared/CAmDltWrapper.h"
+#include "CAmDltWrapper.h"
#ifdef SYSTEMD_FOUND
#include <systemd/sd-daemon.h>
diff --git a/AudioManagerDaemon/src/main.cpp b/AudioManagerDaemon/src/main.cpp
index c6d212e..b8a0688 100755
--- a/AudioManagerDaemon/src/main.cpp
+++ b/AudioManagerDaemon/src/main.cpp
@@ -12,7 +12,7 @@
* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*
- * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
* \author Frank Herchet, frank.fh.herchet@bmw.de BMW 2012
*
* \file main.cpp
@@ -34,10 +34,10 @@
#endif
#ifdef WITH_CAPI_WRAPPER
- #include "shared/CAmCommonAPIWrapper.h"
+ #include "CAmCommonAPIWrapper.h"
#else
#ifdef WITH_DBUS_WRAPPER
- #include "shared/CAmDbusWrapper.h"
+ #include "CAmDbusWrapper.h"
#endif
#endif
@@ -79,8 +79,8 @@
#include "CAmCommandReceiver.h"
#include "CAmControlReceiver.h"
#include "CAmDatabaseObserver.h"
-#include "shared/CAmDltWrapper.h"
-#include "shared/CAmSocketHandler.h"
+#include "CAmDltWrapper.h"
+#include "CAmSocketHandler.h"
using namespace am;
diff --git a/AudioManagerDaemon/test/AmControlInterfaceTest/CAmControlInterfaceTest.cpp b/AudioManagerDaemon/test/AmControlInterfaceTest/CAmControlInterfaceTest.cpp
index 2dd059f..b20a4f7 100644
--- a/AudioManagerDaemon/test/AmControlInterfaceTest/CAmControlInterfaceTest.cpp
+++ b/AudioManagerDaemon/test/AmControlInterfaceTest/CAmControlInterfaceTest.cpp
@@ -12,7 +12,7 @@
* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*
- * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
*
* For further information see http://www.genivi.org/.
*
@@ -23,7 +23,7 @@
#include <string>
#include <vector>
#include <set>
-#include "shared/CAmDltWrapper.h"
+#include "CAmDltWrapper.h"
using namespace am;
using namespace testing;
@@ -32,7 +32,6 @@ DLT_DECLARE_CONTEXT(AudioManager)
CAmControlInterfaceTest::CAmControlInterfaceTest() :
pSocketHandler(), //
- pDBusWrapper((CAmDbusWrapper*) 1), //
plistCommandPluginDirs(), //
plistRoutingPluginDirs(), //
pDatabaseHandler(), //
@@ -47,7 +46,7 @@ CAmControlInterfaceTest::CAmControlInterfaceTest() :
pRouter(&pDatabaseHandler,&pControlSender), //
pDatabaseObserver(&pCommandSender, &pRoutingSender, &pSocketHandler), //
pControlReceiver(&pDatabaseHandler, &pRoutingSender, &pCommandSender, &pSocketHandler, &pRouter), //
- pRoutingReceiver(&pDatabaseHandler, &pRoutingSender, &pControlSender, &pSocketHandler, pDBusWrapper)
+ pRoutingReceiver(&pDatabaseHandler, &pRoutingSender, &pControlSender, &pSocketHandler)
{
CAmDltWrapper::instance(0)->registerApp("AudioManagerDeamon", "AudioManagerDeamon");
CAmDltWrapper::instance()->registerContext(AudioManager, "Main", "Main Context");
diff --git a/AudioManagerDaemon/test/AmControlInterfaceTest/CAmControlInterfaceTest.h b/AudioManagerDaemon/test/AmControlInterfaceTest/CAmControlInterfaceTest.h
index 861b9ac..92ebb4f 100644
--- a/AudioManagerDaemon/test/AmControlInterfaceTest/CAmControlInterfaceTest.h
+++ b/AudioManagerDaemon/test/AmControlInterfaceTest/CAmControlInterfaceTest.h
@@ -12,7 +12,7 @@
* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*
- * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
*
* For further information see http://www.genivi.org/.
*
@@ -38,8 +38,7 @@
#include "../CAmCommonFunctions.h"
#include "../MockIAmRoutingSend.h"
#include "../MockIAmControlSend.h"
-#include "shared/CAmSocketHandler.h"
-#include "shared/CAmDbusWrapper.h"
+#include "CAmSocketHandler.h"
namespace am
{
@@ -50,7 +49,6 @@ public:
CAmControlInterfaceTest();
~CAmControlInterfaceTest();
CAmSocketHandler pSocketHandler;
- CAmDbusWrapper* pDBusWrapper;
std::vector<std::string> plistCommandPluginDirs;
std::vector<std::string> plistRoutingPluginDirs;
CAmDatabaseHandlerMap pDatabaseHandler;
diff --git a/AudioManagerDaemon/test/AmControlInterfaceTest/CMakeLists.txt b/AudioManagerDaemon/test/AmControlInterfaceTest/CMakeLists.txt
index a2238b1..33a2f8b 100644
--- a/AudioManagerDaemon/test/AmControlInterfaceTest/CMakeLists.txt
+++ b/AudioManagerDaemon/test/AmControlInterfaceTest/CMakeLists.txt
@@ -7,88 +7,82 @@
#
# copyright
# This Source Code Form is subject to the terms of the
-# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+# Mozilla Public License, v. 2.0. if a copy of the MPL was not distributed with
# this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
-# author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+# author Christian Linke, christian.linke@bmw.de BMW 2011,2012
#
# For further information see http://www.genivi.org/.
#
-cmake_minimum_required(VERSION 2.6)
+cmake_minimum_required(VERSION 2.8.8)
-PROJECT(AmControlInterfaceTest)
+project(AmControlInterfaceTest)
-set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -DUNIT_TEST=1 -DDLT_CONTEXT=AudioManager")
+set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUNIT_TEST=1 -DDLT_CONTEXT=AudioManager")
-FIND_PACKAGE(PkgConfig)
-IF(WITH_DATABASE_STORAGE)
+set (AM_LINK_LIBS
+ ${CMAKE_DL_LIBS}
+ rt)
+
+if(WITH_DATABASE_STORAGE)
pkg_check_modules(SQLITE REQUIRED sqlite3)
-ENDIF(WITH_DATABASE_STORAGE)
+ set (AM_LINK_LIBS
+ ${AM_LINK_LIBS}
+ ${SQLITE_LIBRARIES})
+endif(WITH_DATABASE_STORAGE)
-IF(WITH_DLT)
+if(WITH_DLT)
pkg_check_modules(DLT REQUIRED automotive-dlt>=2.2.0)
-ENDIF(WITH_DLT)
+ set (AM_LINK_LIBS
+ ${AM_LINK_LIBS}
+ ${DLT_LIBRARIES})
+endif(WITH_DLT)
INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_BINARY_DIR}
${AUDIO_INCLUDE_FOLDER}
- ${DBUS_ARCH_INCLUDE_DIR}
- ${DBUS_INCLUDE_FOLDER}
- ${CMAKE_SOURCE_DIR}
${STD_INCLUDE_DIRS}
- ${DLT_INCLUDE_DIRS}
- ${DBUS_INCLUDE_DIR}
${INCLUDE_FOLDER}
${GOOGLE_TEST_INCLUDE_DIR}
- ${GMOCK_INCLUDE_DIR}
-)
+ ${GMOCK_INCLUDE_DIR})
+
+if(WITH_DLT)
+ INCLUDE_DIRECTORIES(
+ ${INCLUDE_DIRECTORIES}
+ ${DLT_INCLUDE_DIRS})
+endif(WITH_DLT)
+
file(GLOB CONTROL_INTERFACE_SRCS_CXX
- "../../src/CAmDatabaseHandlerMap.cpp"
- "../../src/CAmDatabaseObserver.cpp"
- "../../src/CAmRoutingSender.cpp"
- "../../src/CAmRoutingReceiver.cpp"
- "../../src/CAmCommandSender.cpp"
- "../../src/CAmCommandReceiver.cpp"
- "../../src/CAmControlReceiver.cpp"
- "../../src/CAmControlSender.cpp"
- "../../src/CAmRouter.cpp"
- "../../src/CAmDltWrapper.cpp"
- "../../src/CAmSocketHandler.cpp"
- "../../src/CAmDbusWrapper.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmDatabaseHandlerMap.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmDatabaseObserver.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmRoutingSender.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmRoutingReceiver.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmCommandSender.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmCommandReceiver.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmControlReceiver.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmControlSender.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmRouter.cpp"
+ "${AUDIOMANAGER_UTILITIES_SRC}/CAmSocketHandler.cpp"
+ "${AUDIOMANAGER_UTILITIES_SRC}/CAmDltWrapper.cpp"
"../CAmCommonFunctions.cpp"
"*.cpp"
)
-IF(WITH_NSM)
- SET (CONTROL_INTERFACE_SRCS_CXX
- ${CONTROL_INTERFACE_SRCS_CXX}
- "../../src/CAmNodeStateCommunicatorDBus.cpp")
-ENDIF(WITH_NSM)
-
-ADD_EXECUTABLE(AmControlInterfaceTest ${CONTROL_INTERFACE_SRCS_CXX})
+add_executable(AmControlInterfaceTest ${CONTROL_INTERFACE_SRCS_CXX})
TARGET_LINK_LIBRARIES(AmControlInterfaceTest
- ${SQLITE_LIBRARIES}
- ${DLT_LIBRARIES}
- ${DBUS_LIBRARY}
- ${CMAKE_THREAD_LIBS_INIT}
- ${CMAKE_DL_LIBS}
+ ${AM_LINK_LIBS}
gtest
- gmock
-)
+ gmock)
ADD_DEPENDENCIES(AmControlInterfaceTest gtest gmock)
INSTALL(TARGETS AmControlInterfaceTest
- DESTINATION "~/AudioManagerTest/"
+ DESTINATION ${TEST_EXECUTABLE_INSTALL_PATH}
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
- COMPONENT tests
-)
-
-SET(ADD_DEPEND "audiomanager-bin" "sqlite3(>=3.6.22)" "dlt" "libdbus-1-3(>=1.2.16)" "libpthread-stubs0")
-set_property(GLOBAL APPEND PROPERTY tests_prop "${ADD_DEPEND}")
+ COMPONENT tests)
diff --git a/AudioManagerDaemon/test/AmDatabaseHandlerTest/CAmDatabaseHandlerTest.cpp b/AudioManagerDaemon/test/AmDatabaseHandlerTest/CAmDatabaseHandlerTest.cpp
index 85a4c44..e5f9745 100644
--- a/AudioManagerDaemon/test/AmDatabaseHandlerTest/CAmDatabaseHandlerTest.cpp
+++ b/AudioManagerDaemon/test/AmDatabaseHandlerTest/CAmDatabaseHandlerTest.cpp
@@ -12,7 +12,7 @@
* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*
- * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
*
* For further information see http://www.genivi.org/.
*
@@ -23,7 +23,7 @@
#include <string>
#include <vector>
#include <set>
-#include "shared/CAmDltWrapper.h"
+#include "CAmDltWrapper.h"
using namespace am;
using namespace testing;
diff --git a/AudioManagerDaemon/test/AmDatabaseHandlerTest/CAmDatabaseHandlerTest.h b/AudioManagerDaemon/test/AmDatabaseHandlerTest/CAmDatabaseHandlerTest.h
index b23aba4..3ebd156 100644
--- a/AudioManagerDaemon/test/AmDatabaseHandlerTest/CAmDatabaseHandlerTest.h
+++ b/AudioManagerDaemon/test/AmDatabaseHandlerTest/CAmDatabaseHandlerTest.h
@@ -12,7 +12,7 @@
* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*
- * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
*
* For further information see http://www.genivi.org/.
*
@@ -38,7 +38,7 @@
#include "../CAmCommonFunctions.h"
#include "../MockIAmControlSend.h"
#include "../MockIAmCommandSend.h"
-#include "shared/CAmSocketHandler.h"
+#include "CAmSocketHandler.h"
namespace am
{
diff --git a/AudioManagerDaemon/test/AmDatabaseHandlerTest/CMakeLists.txt b/AudioManagerDaemon/test/AmDatabaseHandlerTest/CMakeLists.txt
index 99dd576..85741d8 100644
--- a/AudioManagerDaemon/test/AmDatabaseHandlerTest/CMakeLists.txt
+++ b/AudioManagerDaemon/test/AmDatabaseHandlerTest/CMakeLists.txt
@@ -7,87 +7,87 @@
#
# copyright
# This Source Code Form is subject to the terms of the
-# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+# Mozilla Public License, v. 2.0. if a copy of the MPL was not distributed with
# this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
-# author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+# author Christian Linke, christian.linke@bmw.de BMW 2011,2012
#
# For further information see http://www.genivi.org/.
#
-cmake_minimum_required(VERSION 2.6)
+cmake_minimum_required(VERSION 2.8.8)
-PROJECT(AmDatabaseHandlerTest)
+project(AmDatabaseHandlerTest)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -DUNIT_TEST=1 -DDLT_CONTEXT=AudioManager")
+#only build this test if sqlite is requested
+if(WITH_DATABASE_STORAGE)
-FIND_PACKAGE(PkgConfig)
-IF(WITH_DATABASE_STORAGE)
+ set (AM_LINK_LIBS
+ ${CMAKE_DL_LIBS}
+ rt)
+
pkg_check_modules(SQLITE REQUIRED sqlite3)
-IF(WITH_DLT)
- pkg_check_modules(DLT REQUIRED automotive-dlt>=2.2.0)
-ENDIF(WITH_DLT)
-
-INCLUDE_DIRECTORIES(
- ${CMAKE_CURRENT_BINARY_DIR}
- ${AUDIO_INCLUDE_FOLDER}
- ${DBUS_ARCH_INCLUDE_DIR}
- ${DBUS_INCLUDE_FOLDER}
- ${CMAKE_SOURCE_DIR}
- ${STD_INCLUDE_DIRS}
- ${DLT_INCLUDE_DIRS}
- ${DBUS_INCLUDE_DIR}
- ${INCLUDE_FOLDER}
- ${GOOGLE_TEST_INCLUDE_DIR}
- ${GMOCK_INCLUDE_DIR}
-)
-
-file(GLOB DATABASE_SRCS_CXX
- "../../src/CAmDatabaseHandlerSQLite.cpp"
- "../../src/CAmDatabaseObserver.cpp"
- "../../src/CAmCommandSender.cpp"
- "../../src/CAmRoutingSender.cpp"
- "../../src/CAmControlReceiver.cpp"
- "../../src/CAmControlSender.cpp"
- "../../src/CAmRouter.cpp"
- "../../src/CAmDltWrapper.cpp"
- "../../src/CAmSocketHandler.cpp"
- "../../src/CAmCommandReceiver.cpp"
- "../../src/CAmRoutingReceiver.cpp"
- "../../src/CAmDbusWrapper.cpp"
- "../CAmCommonFunctions.cpp"
- "*.cpp"
+ if(WITH_DLT)
+ pkg_check_modules(DLT REQUIRED automotive-dlt>=2.2.0)
+ set (AM_LINK_LIBS
+ ${AM_LINK_LIBS}
+ ${DLT_LIBRARIES})
+ endif(WITH_DLT)
+
+ INCLUDE_DIRECTORIES(
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${AUDIO_INCLUDE_FOLDER}
+ ${CMAKE_SOURCE_DIR}
+ ${STD_INCLUDE_DIRS}
+ ${INCLUDE_FOLDER}
+ ${GOOGLE_TEST_INCLUDE_DIR}
+ ${GMOCK_INCLUDE_DIR}
)
-IF(WITH_NSM)
- SET (DATABASE_SRCS_CXX
- ${DATABASE_SRCS_CXX}
- "../../src/CAmNodeStateCommunicatorDBus.cpp")
-ENDIF(WITH_NSM)
-
-ADD_EXECUTABLE( AmDatabaseHandlerTest ${DATABASE_SRCS_CXX})
-
-TARGET_LINK_LIBRARIES( AmDatabaseHandlerTest
- ${SQLITE_LIBRARIES}
- ${DLT_LIBRARIES}
- ${DBUS_LIBRARY}
- ${CMAKE_THREAD_LIBS_INIT}
- ${CMAKE_DL_LIBS}
- gtest
- gmock
-)
-
-ADD_DEPENDENCIES(AmDatabaseHandlerTest gtest gmock)
-
-INSTALL(TARGETS AmDatabaseHandlerTest
- DESTINATION "~/AudioManagerTest/"
- PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
- COMPONENT tests
-)
-
-SET(ADD_DEPEND "audiomanager-bin" "sqlite3(>=3.6.22)" "dlt" "libdbus-1-3(>=1.2.16)" "libpthread-stubs0")
-set_property(GLOBAL APPEND PROPERTY tests_prop "${ADD_DEPEND}")
-ENDIF(WITH_DATABASE_STORAGE)
+ if(WITH_DLT)
+ INCLUDE_DIRECTORIES(
+ ${INCLUDE_DIRECTORIES}
+ ${DLT_INCLUDE_DIRS})
+ endif(WITH_DLT)
+
+ file(GLOB DATABASE_SRCS_CXX
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmDatabaseHandlerSQLite.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmDatabaseObserver.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmCommandSender.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmRoutingSender.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmControlReceiver.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmControlSender.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmRouter.cpp"
+ "${AUDIOMANAGER_UTILITIES_SRC}/CAmSocketHandler.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmCommandReceiver.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmRoutingReceiver.cpp"
+ "${AUDIOMANAGER_UTILITIES_SRC}/CAmDltWrapper.cpp"
+ "../CAmCommonFunctions.cpp"
+ "*.cpp"
+ )
+
+
+ ADD_EXECUTABLE( AmDatabaseHandlerTest ${DATABASE_SRCS_CXX})
+
+ TARGET_LINK_LIBRARIES( AmDatabaseHandlerTest
+ ${AM_LINK_LIBS}
+ ${SQLITE_LIBRARIES}
+ ${CMAKE_THREAD_LIBS_INIT}
+ ${CMAKE_DL_LIBS}
+ gtest
+ gmock
+ )
+
+ ADD_DEPENDENCIES(AmDatabaseHandlerTest gtest gmock)
+
+ INSTALL(TARGETS AmDatabaseHandlerTest
+ DESTINATION ${TEST_EXECUTABLE_INSTALL_PATH}
+ PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
+ COMPONENT tests
+ )
+
+endif(WITH_DATABASE_STORAGE)
diff --git a/AudioManagerDaemon/test/AmMapHandlerTest/CAmMapHandlerTest.cpp b/AudioManagerDaemon/test/AmMapHandlerTest/CAmMapHandlerTest.cpp
index df72f2d..3ad5713 100644
--- a/AudioManagerDaemon/test/AmMapHandlerTest/CAmMapHandlerTest.cpp
+++ b/AudioManagerDaemon/test/AmMapHandlerTest/CAmMapHandlerTest.cpp
@@ -12,7 +12,7 @@
* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*
- * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
* \author Aleksandar Donchev, aleksander.donchev@partner.bmw.de BMW 2013
*
* For further information see http://www.genivi.org/.
@@ -25,7 +25,7 @@
#include <vector>
#include <set>
#include <ios>
-#include "shared/CAmDltWrapper.h"
+#include "CAmDltWrapper.h"
using namespace am;
using namespace testing;
diff --git a/AudioManagerDaemon/test/AmMapHandlerTest/CAmMapHandlerTest.h b/AudioManagerDaemon/test/AmMapHandlerTest/CAmMapHandlerTest.h
index f35aa0b..ae9b0f1 100644
--- a/AudioManagerDaemon/test/AmMapHandlerTest/CAmMapHandlerTest.h
+++ b/AudioManagerDaemon/test/AmMapHandlerTest/CAmMapHandlerTest.h
@@ -12,7 +12,7 @@
* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*
- * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
* \author Aleksandar Donchev, aleksander.donchev@partner.bmw.de BMW 2013
*
* For further information see http://www.genivi.org/.
@@ -27,7 +27,7 @@
#include "gtest/gtest.h"
#include "gmock/gmock.h"
-#include "shared/CAmSocketHandler.h"
+#include "CAmSocketHandler.h"
#include "CAmDatabaseHandlerMap.h"
#include "CAmControlReceiver.h"
#include "CAmControlSender.h"
diff --git a/AudioManagerDaemon/test/AmMapHandlerTest/CMakeLists.txt b/AudioManagerDaemon/test/AmMapHandlerTest/CMakeLists.txt
index 0381966..b4555e1 100644
--- a/AudioManagerDaemon/test/AmMapHandlerTest/CMakeLists.txt
+++ b/AudioManagerDaemon/test/AmMapHandlerTest/CMakeLists.txt
@@ -7,73 +7,67 @@
#
# copyright
# This Source Code Form is subject to the terms of the
-# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+# Mozilla Public License, v. 2.0. if a copy of the MPL was not distributed with
# this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
-# author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+# author Christian Linke, christian.linke@bmw.de BMW 2011,2012
#
# For further information see http://www.genivi.org/.
#
-cmake_minimum_required(VERSION 2.6)
+cmake_minimum_required(VERSION 2.8.8)
-PROJECT(AmMapHandlerTest)
+project(AmMapHandlerTest)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -DUNIT_TEST=1 -DDLT_CONTEXT=AudioManager")
-
-FIND_PACKAGE(PkgConfig)
-#pkg_check_modules(SQLITE REQUIRED sqlite3)
-
-IF(WITH_DLT)
+set (AM_LINK_LIBS
+ ${CMAKE_DL_LIBS}
+ rt)
+
+if(WITH_DLT)
pkg_check_modules(DLT REQUIRED automotive-dlt>=2.2.0)
-ENDIF(WITH_DLT)
+ set (AM_LINK_LIBS
+ ${AM_LINK_LIBS}
+ ${DLT_LIBRARIES})
+endif(WITH_DLT)
INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_BINARY_DIR}
${AUDIO_INCLUDE_FOLDER}
- ${DBUS_ARCH_INCLUDE_DIR}
- ${DBUS_INCLUDE_FOLDER}
${CMAKE_SOURCE_DIR}
${STD_INCLUDE_DIRS}
- ${DLT_INCLUDE_DIRS}
- ${DBUS_INCLUDE_DIR}
${INCLUDE_FOLDER}
${GOOGLE_TEST_INCLUDE_DIR}
${GMOCK_INCLUDE_DIR}
)
+if(WITH_DLT)
+ INCLUDE_DIRECTORIES(
+ ${INCLUDE_DIRECTORIES}
+ ${DLT_INCLUDE_DIRS})
+endif(WITH_DLT)
+
file(GLOB DATABASE_SRCS_CXX
- "../../src/CAmDatabaseHandlerMap.cpp"
- "../../src/CAmCommandSender.cpp"
- "../../src/CAmRoutingSender.cpp"
- "../../src/CAmControlReceiver.cpp"
- "../../src/CAmControlSender.cpp"
- "../../src/CAmRouter.cpp"
- "../../src/CAmDltWrapper.cpp"
- "../../src/CAmSocketHandler.cpp"
- "../../src/CAmCommandReceiver.cpp"
- "../../src/CAmRoutingReceiver.cpp"
- "../../src/CAmDbusWrapper.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmDatabaseHandlerMap.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmCommandSender.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmRoutingSender.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmControlReceiver.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmControlSender.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmRouter.cpp"
+ "${AUDIOMANAGER_UTILITIES_SRC}/CAmSocketHandler.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmCommandReceiver.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmRoutingReceiver.cpp"
+ "${AUDIOMANAGER_UTILITIES_SRC}/CAmDltWrapper.cpp"
"../CAmCommonFunctions.cpp"
"CAmTestDatabaseObserver.cpp"
"*.cpp"
)
-IF(WITH_NSM)
- IF(WITH_DBUS_WRAPPER)
- SET (DATABASE_SRCS_CXX
- ${DATABASE_SRCS_CXX}
- "../../src/CAmNodeStateCommunicatorDBus.cpp")
- ENDIF()
-ENDIF(WITH_NSM)
-
ADD_EXECUTABLE( AmMapHandlerTest ${DATABASE_SRCS_CXX})
TARGET_LINK_LIBRARIES( AmMapHandlerTest
- ${SQLITE_LIBRARIES}
- ${DLT_LIBRARIES}
- ${DBUS_LIBRARY}
+ ${AM_LINK_LIBS}
${CMAKE_THREAD_LIBS_INIT}
${CMAKE_DL_LIBS}
gtest
@@ -83,11 +77,8 @@ TARGET_LINK_LIBRARIES( AmMapHandlerTest
ADD_DEPENDENCIES(AmMapHandlerTest gtest gmock)
INSTALL(TARGETS AmMapHandlerTest
- DESTINATION "~/AudioManagerTest/"
+ DESTINATION ${TEST_EXECUTABLE_INSTALL_PATH}
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
COMPONENT tests
)
-SET(ADD_DEPEND "audiomanager-bin" "dlt" "libdbus-1-3(>=1.2.16)" "libpthread-stubs0")
-set_property(GLOBAL APPEND PROPERTY tests_prop "${ADD_DEPEND}")
-
diff --git a/AudioManagerDaemon/test/AmNodeStateCommunicatorCAPITest/CAmNodeStateCommunicatorTest.cpp b/AudioManagerDaemon/test/AmNodeStateCommunicatorCAPITest/CAmNodeStateCommunicatorTest.cpp
index e41e556..6eaf75a 100644
--- a/AudioManagerDaemon/test/AmNodeStateCommunicatorCAPITest/CAmNodeStateCommunicatorTest.cpp
+++ b/AudioManagerDaemon/test/AmNodeStateCommunicatorCAPITest/CAmNodeStateCommunicatorTest.cpp
@@ -20,8 +20,8 @@
*/
#include "CAmNodeStateCommunicatorTest.h"
-#include "shared/CAmDltWrapper.h"
-#include "shared/CAmSocketHandler.h"
+#include "CAmDltWrapper.h"
+#include "CAmSocketHandler.h"
#include <unistd.h>
diff --git a/AudioManagerDaemon/test/AmNodeStateCommunicatorCAPITest/CAmNodeStateCommunicatorTest.h b/AudioManagerDaemon/test/AmNodeStateCommunicatorCAPITest/CAmNodeStateCommunicatorTest.h
index c6a9a5a..d86b9c5 100644
--- a/AudioManagerDaemon/test/AmNodeStateCommunicatorCAPITest/CAmNodeStateCommunicatorTest.h
+++ b/AudioManagerDaemon/test/AmNodeStateCommunicatorCAPITest/CAmNodeStateCommunicatorTest.h
@@ -29,7 +29,7 @@
#include "gmock/gmock.h"
#include "../IAmControlBackdoor.h"
#include "../MockIAmControlSend.h"
-#include "shared/CAmCommonAPIWrapper.h"
+#include "CAmCommonAPIWrapper.h"
using namespace testing;
using namespace am;
diff --git a/AudioManagerDaemon/test/AmNodeStateCommunicatorCAPITest/CMakeLists.txt b/AudioManagerDaemon/test/AmNodeStateCommunicatorCAPITest/CMakeLists.txt
index 3a58b24..018d71a 100644
--- a/AudioManagerDaemon/test/AmNodeStateCommunicatorCAPITest/CMakeLists.txt
+++ b/AudioManagerDaemon/test/AmNodeStateCommunicatorCAPITest/CMakeLists.txt
@@ -15,71 +15,66 @@
# For further information see http://www.genivi.org/.
#
-cmake_minimum_required(VERSION 2.6)
+cmake_minimum_required(VERSION 2.8.8)
-PROJECT(AmNodeStateCommunicatorCAPITest)
+project(AmNodeStateCommunicatorCAPITest)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -DUNIT_TEST=1")
-set(STD_INCLUDE_DIRS "/usr/include")
+find_package(Threads)
+find_package(CommonAPI REQUIRED)
+find_package(PythonLibs REQUIRED)
-set(EXECUTABLE_OUTPUT_PATH ${TEST_EXECUTABLE_OUTPUT_PATH})
-
-FIND_PACKAGE(Threads)
-FIND_PACKAGE(PkgConfig)
-FIND_PACKAGE(CommonAPI REQUIRED)
-IF(WITH_DATABASE_STORAGE)
- pkg_check_modules(SQLITE REQUIRED sqlite3)
-ENDIF(WITH_DATABASE_STORAGE)
+set (AM_LINK_LIBS
+ ${CMAKE_DL_LIBS}
+ rt)
-IF(WITH_DLT)
- pkg_check_modules(DLT REQUIRED automotive-dlt>=2.2.0)
-ENDIF(WITH_DLT)
+if(WITH_DLT)
+ pkg_check_modules(DLT REQUIRED automotive-dlt>=2.2.0)
+ set (AM_LINK_LIBS
+ ${AM_LINK_LIBS}
+ ${DLT_LIBRARIES})
+endif(WITH_DLT)
INCLUDE_DIRECTORIES(
- ${STD_INCLUDE_DIRS}
${CMAKE_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${AUDIO_INCLUDE_FOLDER}
- ${CMAKE_SOURCE_DIR}
- ${DLT_INCLUDE_DIRS}
- ${INCLUDE_FOLDER}
${PYTHON_INCLUDE_DIRS}
${GOOGLE_TEST_INCLUDE_DIR}
${GMOCK_INCLUDE_DIR}
- "../../include"
${COMMON_API_INCLUDE_DIRS}
${COMMON_API_DBUS_INCLUDE_DIRS}
${COMMON_API_GEN_INCLUDE_DIR}
)
+if(WITH_DLT)
+INCLUDE_DIRECTORIES(
+ ${INCLUDE_DIRECTORIES}
+ ${DLT_INCLUDE_DIRS})
+endif(WITH_DLT)
+
-file(GLOB NODESTATECOMMUNICATORCAPI
- "../../src/CAmDatabaseHandler.cpp"
- "../../src/CAmDatabaseObserver.cpp"
- "../../src/CAmRoutingSender.cpp"
- "../../src/CAmRoutingReceiver.cpp"
- "../../src/CAmCommonAPIWrapper.cpp"
- "../../src/CAmDltWrapper.cpp"
- "../../src/CAmSocketHandler.cpp"
- "../../src/CAmNodeStateCommunicatorCAPI.cpp"
- "../../src/CAmControlSender.cpp"
- "../../src/CAmCommandSender.cpp"
- "../../src/CAmCommandReceiver.cpp"
- "../CAmCommonFunctions.cpp"
- "../../src/CAmRouter.cpp"
- "*.cpp"
- ${COMMON_API_GEN_SOURCES}
- )
-
-CONFIGURE_FILE( ${CMAKE_SOURCE_DIR}/AudioManagerDaemon/fidls/AudioManager_dbus.conf.in ${CMAKE_BINARY_DIR}/AmNodeStateCommunicatorCAPITest_dbus.conf)
-
-ADD_EXECUTABLE(AmNodeStateCommunicatorCAPITest ${NODESTATECOMMUNICATORCAPI} ${COMMON_API_GEN_SOURCES})
+file(GLOB NODESTATECOMMUNICATORCAPI_SRCS_CXX
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmDatabaseHandler.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmDatabaseObserver.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmRoutingSender.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmRoutingReceiver.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmNodeStateCommunicatorCAPI.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmControlSender.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmCommandSender.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmCommandReceiver.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmRouter.cpp"
+ "${AUDIOMANAGER_UTILITIES_SRC}/CAmCommonAPIWrapper.cpp"
+ "${AUDIOMANAGER_UTILITIES_SRC}/CAmDltWrapper.cpp"
+ "${AUDIOMANAGER_UTILITIES_SRC}/CAmSocketHandler.cpp"
+ "../CAmCommonFunctions.cpp"
+ "*.cpp")
+
+ADD_EXECUTABLE(AmNodeStateCommunicatorCAPITest ${NODESTATECOMMUNICATORCAPI_SRCS_CXX} ${COMMON_API_GEN_SOURCES})
TARGET_LINK_LIBRARIES(AmNodeStateCommunicatorCAPITest
- ${SQLITE_LIBRARIES}
- ${DLT_LIBRARIES}
- ${CMAKE_DL_LIBS}
+ ${AM_LINK_LIBS}
${CMAKE_THREAD_LIBS_INIT}
${PYTHON_LIBRARY}
${COMMON_API_LIBRARIES}
@@ -91,7 +86,7 @@ TARGET_LINK_LIBRARIES(AmNodeStateCommunicatorCAPITest
ADD_DEPENDENCIES(AmNodeStateCommunicatorCAPITest gtest gmock)
INSTALL(TARGETS AmNodeStateCommunicatorCAPITest
- DESTINATION "~/AudioManagerTest/"
+ DESTINATION ${TEST_EXECUTABLE_INSTALL_PATH}
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
COMPONENT tests
)
@@ -100,20 +95,17 @@ INSTALL(FILES
${CMAKE_CURRENT_SOURCE_DIR}/org.genivi.NodeStateManager.Consumer.xml
${CMAKE_CURRENT_SOURCE_DIR}/nsm.py
${CMAKE_CURRENT_SOURCE_DIR}/send2nsm.py
- DESTINATION "~/AudioManagerTest/"
+ DESTINATION ${TEST_EXECUTABLE_INSTALL_PATH}
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
COMPONENT tests
)
-IF(USE_BUILD_LIBS)
+if(USE_BUILD_LIBS)
execute_process(
COMMAND mkdir -p ${EXECUTABLE_OUTPUT_PATH}
COMMAND cp "${CMAKE_CURRENT_SOURCE_DIR}/org.genivi.NodeStateManager.Consumer.xml" ${EXECUTABLE_OUTPUT_PATH}/org.genivi.NodeStateManager.Consumer.xml
COMMAND cp "${CMAKE_CURRENT_SOURCE_DIR}/nsm.py" ${EXECUTABLE_OUTPUT_PATH}/nsm.py
COMMAND cp "${CMAKE_CURRENT_SOURCE_DIR}/send2nsm.py" ${EXECUTABLE_OUTPUT_PATH}/send2nsm.py
- COMMAND cp "${CMAKE_BINARY_DIR}/AmNodeStateCommunicatorCAPITest_dbus.conf" ${EXECUTABLE_OUTPUT_PATH})
-ENDIF(USE_BUILD_LIBS)
-
-SET(ADD_DEPEND "audiomanager-bin" "sqlite3(>=3.6.22)" "dlt" "gtest" "libpthread-stubs0")
-set_property(GLOBAL APPEND PROPERTY tests_prop "${ADD_DEPEND}")
+ COMMAND cp "${AUDIOMANAGER_DAEMON_FOLDER}/fidls/NodeStateManager_dbus.conf" ${EXECUTABLE_OUTPUT_PATH}/AmNodeStateCommunicatorCAPITest_dbus.conf)
+endif(USE_BUILD_LIBS)
diff --git a/AudioManagerDaemon/test/AmNodeStateCommunicatorDBusTest/CAmNodeStateCommunicatorTest.cpp b/AudioManagerDaemon/test/AmNodeStateCommunicatorDBusTest/CAmNodeStateCommunicatorTest.cpp
index 09e5f2b..df42fc1 100644
--- a/AudioManagerDaemon/test/AmNodeStateCommunicatorDBusTest/CAmNodeStateCommunicatorTest.cpp
+++ b/AudioManagerDaemon/test/AmNodeStateCommunicatorDBusTest/CAmNodeStateCommunicatorTest.cpp
@@ -20,9 +20,9 @@
*/
#include "CAmNodeStateCommunicatorTest.h"
-#include "shared/CAmDltWrapper.h"
-#include "shared/CAmSocketHandler.h"
-#include "shared/CAmDbusWrapper.h"
+#include "CAmDltWrapper.h"
+#include "CAmSocketHandler.h"
+#include "CAmDbusWrapper.h"
#include <unistd.h>
diff --git a/AudioManagerDaemon/test/AmNodeStateCommunicatorDBusTest/CMakeLists.txt b/AudioManagerDaemon/test/AmNodeStateCommunicatorDBusTest/CMakeLists.txt
index 242aff4..29e0e4e 100644
--- a/AudioManagerDaemon/test/AmNodeStateCommunicatorDBusTest/CMakeLists.txt
+++ b/AudioManagerDaemon/test/AmNodeStateCommunicatorDBusTest/CMakeLists.txt
@@ -15,70 +15,63 @@
# For further information see http://www.genivi.org/.
#
-cmake_minimum_required(VERSION 2.6)
+cmake_minimum_required(VERSION 2.8.8)
-PROJECT(AmNodeStateCommunicatorDBusTest)
+project(AmNodeStateCommunicatorDBusTest)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -DUNIT_TEST=1")
-set(STD_INCLUDE_DIRS "/usr/include")
-set(EXECUTABLE_OUTPUT_PATH ${TEST_EXECUTABLE_OUTPUT_PATH})
-
-FIND_PACKAGE(Threads)
-FIND_PACKAGE(DBUS REQUIRED)
-FIND_PACKAGE(PkgConfig)
-IF(WITH_DATABASE_STORAGE)
- pkg_check_modules(SQLITE REQUIRED sqlite3)
-ENDIF(WITH_DATABASE_STORAGE)
+find_package(Threads)
+find_package(CommonAPI REQUIRED)
+find_package(PythonLibs REQUIRED)
+set (AM_LINK_LIBS
+ ${CMAKE_DL_LIBS}
+ rt)
-IF(WITH_DLT)
- pkg_check_modules(DLT REQUIRED automotive-dlt>=2.2.0)
-ENDIF(WITH_DLT)
+if(WITH_DLT)
+ pkg_check_modules(DLT REQUIRED automotive-dlt>=2.2.0)
+ set (AM_LINK_LIBS
+ ${AM_LINK_LIBS}
+ ${DLT_LIBRARIES})
+endif(WITH_DLT)
INCLUDE_DIRECTORIES(
- ${STD_INCLUDE_DIRS}
${CMAKE_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${AUDIO_INCLUDE_FOLDER}
- ${DBUS_ARCH_INCLUDE_DIR}
- ${DBUS_INCLUDE_FOLDER}
- ${CMAKE_SOURCE_DIR}
- ${DLT_INCLUDE_DIRS}
- ${DBUS_INCLUDE_DIR}
- ${INCLUDE_FOLDER}
${PYTHON_INCLUDE_DIRS}
${GOOGLE_TEST_INCLUDE_DIR}
${GMOCK_INCLUDE_DIR}
- "../../include"
+ ${DBUS_ARCH_INCLUDE_DIR}
+ ${DBUS_INCLUDE_FOLDER}
)
-
+
file(GLOB NODESTATECOMMUNICATOR
- "../../src/CAmDatabaseHandler.cpp"
- "../../src/CAmDatabaseObserver.cpp"
- "../../src/CAmRoutingSender.cpp"
- "../../src/CAmRoutingReceiver.cpp"
- "../../src/CAmDbusWrapper.cpp"
- "../../src/CAmDltWrapper.cpp"
- "../../src/CAmSocketHandler.cpp"
- "../../src/CAmNodeStateCommunicatorDBus.cpp"
- "../../src/CAmControlSender.cpp"
- "../../src/CAmCommandSender.cpp"
- "../../src/CAmCommandReceiver.cpp"
- "../CAmCommonFunctions.cpp"
- "../../src/CAmRouter.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmDatabaseHandler.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmDatabaseObserver.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmRoutingSender.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmRoutingReceiver.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmDbusWrapper.cpp"
+ "${AUDIOMANAGER_UTILITIES_SRC}/CAmDltWrapper.cpp"
+ "${AUDIOMANAGER_UTILITIES_SRC}/CAmSocketHandler.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmNodeStateCommunicatorDBus.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmControlSender.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmCommandSender.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmCommandReceiver.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmRouter.cpp"
+ "../CAmCommonFunctions.cpp"
"*.cpp"
)
ADD_EXECUTABLE(AmNodeStateCommunicatorDBusTest ${NODESTATECOMMUNICATOR})
-TARGET_LINK_LIBRARIES(AmNodeStateCommunicatorDBusTest
- ${SQLITE_LIBRARIES}
- ${DLT_LIBRARIES}
- ${DBUS_LIBRARY}
- ${CMAKE_DL_LIBS}
+TARGET_LINK_LIBRARIES(AmNodeStateCommunicatorCAPITest
+ ${AM_LINK_LIBS}
${CMAKE_THREAD_LIBS_INIT}
${PYTHON_LIBRARY}
+ ${COMMON_API_LIBRARIES}
+ ${COMMON_API_DBUS_LIBRARIES}
gtest
gmock
)
@@ -86,7 +79,7 @@ TARGET_LINK_LIBRARIES(AmNodeStateCommunicatorDBusTest
ADD_DEPENDENCIES(AmNodeStateCommunicatorDBusTest gtest gmock)
INSTALL(TARGETS AmNodeStateCommunicatorDBusTest
- DESTINATION "~/AudioManagerTest/"
+ DESTINATION ${TEST_EXECUTABLE_INSTALL_PATH}
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
COMPONENT tests
)
@@ -95,7 +88,7 @@ INSTALL(FILES
${CMAKE_CURRENT_SOURCE_DIR}/org.genivi.NodeStateManager.Consumer.xml
${CMAKE_CURRENT_SOURCE_DIR}/nsm.py
${CMAKE_CURRENT_SOURCE_DIR}/send2nsm.py
- DESTINATION "~/AudioManagerTest/"
+ DESTINATION ${TEST_EXECUTABLE_INSTALL_PATH}
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
COMPONENT tests
)
@@ -108,6 +101,3 @@ IF(USE_BUILD_LIBS)
COMMAND cp "${CMAKE_CURRENT_SOURCE_DIR}/send2nsm.py" ${EXECUTABLE_OUTPUT_PATH}/send2nsm.py)
ENDIF(USE_BUILD_LIBS)
-SET(ADD_DEPEND "audiomanager-bin" "sqlite3(>=3.6.22)" "dlt" "libdbus-1-3(>=1.2.16)" "gtest" "libpthread-stubs0")
-set_property(GLOBAL APPEND PROPERTY tests_prop "${ADD_DEPEND}")
-
diff --git a/AudioManagerDaemon/test/AmRouterMapTest/CAmRouterMapTest.cpp b/AudioManagerDaemon/test/AmRouterMapTest/CAmRouterMapTest.cpp
index a6680e5..6481a59 100644
--- a/AudioManagerDaemon/test/AmRouterMapTest/CAmRouterMapTest.cpp
+++ b/AudioManagerDaemon/test/AmRouterMapTest/CAmRouterMapTest.cpp
@@ -20,7 +20,7 @@
#include "CAmRouterMapTest.h"
#include <string.h>
-#include "shared/CAmDltWrapper.h"
+#include "CAmDltWrapper.h"
using namespace am;
diff --git a/AudioManagerDaemon/test/AmRouterMapTest/CAmRouterMapTest.h b/AudioManagerDaemon/test/AmRouterMapTest/CAmRouterMapTest.h
index 19bccfe..5b86e1a 100644
--- a/AudioManagerDaemon/test/AmRouterMapTest/CAmRouterMapTest.h
+++ b/AudioManagerDaemon/test/AmRouterMapTest/CAmRouterMapTest.h
@@ -36,7 +36,7 @@
#include "CAmDatabaseObserver.h"
#include "CAmRoutingSender.h"
#include "CAmRouter.h"
-#include "shared/CAmSocketHandler.h"
+#include "CAmSocketHandler.h"
#include "../IAmControlBackdoor.h"
#include "../IAmCommandBackdoor.h"
#include "../CAmCommonFunctions.h"
diff --git a/AudioManagerDaemon/test/AmRouterMapTest/CMakeLists.txt b/AudioManagerDaemon/test/AmRouterMapTest/CMakeLists.txt
index 2209f40..e870e20 100644
--- a/AudioManagerDaemon/test/AmRouterMapTest/CMakeLists.txt
+++ b/AudioManagerDaemon/test/AmRouterMapTest/CMakeLists.txt
@@ -10,80 +10,65 @@
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
# this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
-# author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+# author Christian Linke, christian.linke@bmw.de BMW 2011,2012
#
# For further information see http://www.genivi.org/.
#
-cmake_minimum_required(VERSION 2.6)
+cmake_minimum_required(VERSION 2.8.8)
-PROJECT(AmRouterMapTest)
+project (AmRouterMapTest)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -DUNIT_TEST=1 -DDLT_CONTEXT=AudioManager")
-
-FIND_PACKAGE(PkgConfig)
-
-IF(WITH_DLT)
+set (AM_LINK_LIBS
+ ${CMAKE_DL_LIBS}
+ rt)
+
+if(WITH_DLT)
pkg_check_modules(DLT REQUIRED automotive-dlt>=2.2.0)
-ENDIF(WITH_DLT)
+ set (AM_LINK_LIBS
+ ${AM_LINK_LIBS}
+ ${DLT_LIBRARIES})
+endif(WITH_DLT)
INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_BINARY_DIR}
${AUDIO_INCLUDE_FOLDER}
- ${DBUS_ARCH_INCLUDE_DIR}
- ${DBUS_INCLUDE_FOLDER}
${CMAKE_SOURCE_DIR}
- ${STD_INCLUDE_DIRS}
- ${DLT_INCLUDE_DIRS}
- ${DBUS_INCLUDE_DIR}
${INCLUDE_FOLDER}
${GOOGLE_TEST_INCLUDE_DIR}
${GMOCK_INCLUDE_DIR}
)
file(GLOB ROUTINGMAP_SRCS_CXX
- "../../src/CAmDatabaseHandlerMap.cpp"
- "../../src/CAmDatabaseObserver.cpp"
- "../../src/CAmCommandSender.cpp"
- "../../src/CAmRoutingSender.cpp"
- "../../src/CAmControlReceiver.cpp"
- "../../src/CAmControlSender.cpp"
- "../../src/CAmRouter.cpp"
- "../../src/CAmDltWrapper.cpp"
- "../../src/CAmSocketHandler.cpp"
- "../../src/CAmCommandReceiver.cpp"
- "../../src/CAmRoutingReceiver.cpp"
- "../../src/CAmDbusWrapper.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmDatabaseHandlerMap.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmDatabaseObserver.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmCommandSender.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmRoutingSender.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmControlReceiver.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmControlSender.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmRouter.cpp"
+ "${AUDIOMANAGER_UTILITIES_SRC}/CAmDltWrapper.cpp"
+ "${AUDIOMANAGER_UTILITIES_SRC}/CAmSocketHandler.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmCommandReceiver.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmRoutingReceiver.cpp"
"../CAmCommonFunctions.cpp"
"*.cpp"
)
-IF(WITH_NSM)
- SET (DATABASE_SRCS_CXX
- ${DATABASE_SRCS_CXX}
- "../../src/CAmNodeStateCommunicatorDBus.cpp")
-ENDIF(WITH_NSM)
-
ADD_EXECUTABLE( AmRouterMapTest ${ROUTINGMAP_SRCS_CXX})
-TARGET_LINK_LIBRARIES( AmRouterMapTest
- ${DLT_LIBRARIES}
- ${DBUS_LIBRARY}
- ${CMAKE_THREAD_LIBS_INIT}
- ${CMAKE_DL_LIBS}
+TARGET_LINK_LIBRARIES(AmRouterMapTest
+ ${AM_LINK_LIBS}
gtest
- gmock
-)
+ gmock)
ADD_DEPENDENCIES(AmRouterMapTest gtest gmock)
INSTALL(TARGETS AmRouterMapTest
- DESTINATION "~/AudioManagerTest/"
+ DESTINATION ${TEST_EXECUTABLE_INSTALL_PATH}
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
COMPONENT tests
)
-SET(ADD_DEPEND "audiomanager-bin" "dlt" "libdbus-1-3(>=1.2.16)" "libpthread-stubs0")
-set_property(GLOBAL APPEND PROPERTY tests_prop "${ADD_DEPEND}")
-
diff --git a/AudioManagerDaemon/test/AmRouterTest/CAmRouterTest.cpp b/AudioManagerDaemon/test/AmRouterTest/CAmRouterTest.cpp
index f6f523f..dc6871a 100644
--- a/AudioManagerDaemon/test/AmRouterTest/CAmRouterTest.cpp
+++ b/AudioManagerDaemon/test/AmRouterTest/CAmRouterTest.cpp
@@ -20,7 +20,7 @@
#include "CAmRouterTest.h"
#include <string.h>
-#include "shared/CAmDltWrapper.h"
+#include "CAmDltWrapper.h"
using namespace am;
using namespace testing;
diff --git a/AudioManagerDaemon/test/AmRouterTest/CAmRouterTest.h b/AudioManagerDaemon/test/AmRouterTest/CAmRouterTest.h
index ee66bf3..fd0c15a 100644
--- a/AudioManagerDaemon/test/AmRouterTest/CAmRouterTest.h
+++ b/AudioManagerDaemon/test/AmRouterTest/CAmRouterTest.h
@@ -36,7 +36,7 @@
#include "CAmDatabaseObserver.h"
#include "CAmRoutingSender.h"
#include "CAmRouter.h"
-#include "shared/CAmSocketHandler.h"
+#include "CAmSocketHandler.h"
#include "../IAmControlBackdoor.h"
#include "../IAmCommandBackdoor.h"
#include "../CAmCommonFunctions.h"
diff --git a/AudioManagerDaemon/test/AmRouterTest/CMakeLists.txt b/AudioManagerDaemon/test/AmRouterTest/CMakeLists.txt
index 7a7b890..b19f6f1 100644
--- a/AudioManagerDaemon/test/AmRouterTest/CMakeLists.txt
+++ b/AudioManagerDaemon/test/AmRouterTest/CMakeLists.txt
@@ -7,84 +7,68 @@
#
# copyright
# This Source Code Form is subject to the terms of the
-# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+# Mozilla Public License, v. 2.0. if a copy of the MPL was not distributed with
# this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
-# author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+# author Christian Linke, christian.linke@bmw.de BMW 2011,2012
#
# For further information see http://www.genivi.org/.
#
-cmake_minimum_required(VERSION 2.6)
+cmake_minimum_required(VERSION 2.8.8)
-PROJECT(AmRouterTest)
+project(AmRouterTest)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -DUNIT_TEST=1 -DDLT_CONTEXT=AudioManager")
+set (AM_LINK_LIBS
+ ${CMAKE_DL_LIBS}
+ rt)
-FIND_PACKAGE(PkgConfig)
-
-IF(WITH_DLT)
+if(WITH_DLT)
pkg_check_modules(DLT REQUIRED automotive-dlt>=2.2.0)
-ENDIF(WITH_DLT)
+ set (AM_LINK_LIBS
+ ${AM_LINK_LIBS}
+ ${DLT_LIBRARIES})
+endif(WITH_DLT)
INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_BINARY_DIR}
${AUDIO_INCLUDE_FOLDER}
- ${DBUS_ARCH_INCLUDE_DIR}
- ${DBUS_INCLUDE_FOLDER}
${CMAKE_SOURCE_DIR}
- ${STD_INCLUDE_DIRS}
- ${DLT_INCLUDE_DIRS}
- ${DBUS_INCLUDE_DIR}
${INCLUDE_FOLDER}
${GOOGLE_TEST_INCLUDE_DIR}
${GMOCK_INCLUDE_DIR}
)
file(GLOB ROUTING_SRCS_CXX
- "../../src/CAmDatabaseHandlerMap.cpp"
- "../../src/CAmDatabaseObserver.cpp"
- "../../src/CAmCommandSender.cpp"
- "../../src/CAmRoutingSender.cpp"
- "../../src/CAmControlReceiver.cpp"
- "../../src/CAmControlSender.cpp"
- "../../src/CAmRouter.cpp"
- "../../src/CAmDltWrapper.cpp"
- "../../src/CAmSocketHandler.cpp"
- "../../src/CAmCommandReceiver.cpp"
- "../../src/CAmRoutingReceiver.cpp"
- "../../src/CAmDbusWrapper.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmDatabaseHandlerMap.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmDatabaseObserver.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmCommandSender.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmRoutingSender.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmControlReceiver.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmControlSender.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmRouter.cpp"
+ "${AUDIOMANAGER_UTILITIES_SRC}/CAmDltWrapper.cpp"
+ "${AUDIOMANAGER_UTILITIES_SRC}/CAmSocketHandler.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmCommandReceiver.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmRoutingReceiver.cpp"
"../CAmCommonFunctions.cpp"
"*.cpp"
)
-IF(WITH_NSM)
- SET (DATABASE_SRCS_CXX
- ${DATABASE_SRCS_CXX}
- "../../src/CAmNodeStateCommunicatorDBus.cpp")
-ENDIF(WITH_NSM)
-
ADD_EXECUTABLE( AmRouterTest ${ROUTING_SRCS_CXX})
-TARGET_LINK_LIBRARIES( AmRouterTest
- ${SQLITE_LIBRARIES}
- ${DLT_LIBRARIES}
- ${DBUS_LIBRARY}
- ${CMAKE_THREAD_LIBS_INIT}
- ${CMAKE_DL_LIBS}
+TARGET_LINK_LIBRARIES(AmRouterTest
+ ${AM_LINK_LIBS}
gtest
- gmock
-)
+ gmock)
ADD_DEPENDENCIES(AmRouterTest gtest gmock)
INSTALL(TARGETS AmRouterTest
- DESTINATION "~/AudioManagerTest/"
+ DESTINATION ${TEST_EXECUTABLE_INSTALL_PATH}
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
COMPONENT tests
)
-SET(ADD_DEPEND "audiomanager-bin" "sqlite3(>=3.6.22)" "dlt" "libdbus-1-3(>=1.2.16)" "libpthread-stubs0")
-set_property(GLOBAL APPEND PROPERTY tests_prop "${ADD_DEPEND}")
-
diff --git a/AudioManagerDaemon/test/AmRoutingInterfaceTest/CAmRoutingInterfaceTest.cpp b/AudioManagerDaemon/test/AmRoutingInterfaceTest/CAmRoutingInterfaceTest.cpp
index ea94f7b..9eca986 100644
--- a/AudioManagerDaemon/test/AmRoutingInterfaceTest/CAmRoutingInterfaceTest.cpp
+++ b/AudioManagerDaemon/test/AmRoutingInterfaceTest/CAmRoutingInterfaceTest.cpp
@@ -12,14 +12,14 @@
* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*
- * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
*
* For further information see http://www.genivi.org/.
*
*/
#include "CAmRoutingInterfaceTest.h"
-#include "shared/CAmDltWrapper.h"
+#include "CAmDltWrapper.h"
using namespace am;
using namespace testing;
diff --git a/AudioManagerDaemon/test/AmRoutingInterfaceTest/CAmRoutingInterfaceTest.h b/AudioManagerDaemon/test/AmRoutingInterfaceTest/CAmRoutingInterfaceTest.h
index c354f75..ec30bfb 100644
--- a/AudioManagerDaemon/test/AmRoutingInterfaceTest/CAmRoutingInterfaceTest.h
+++ b/AudioManagerDaemon/test/AmRoutingInterfaceTest/CAmRoutingInterfaceTest.h
@@ -12,7 +12,7 @@
* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*
- * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
*
* For further information see http://www.genivi.org/.
*
@@ -36,7 +36,7 @@
#include "../IAmCommandBackdoor.h"
#include "../CAmCommonFunctions.h"
#include "../MockIAmRoutingSend.h"
-#include "shared/CAmSocketHandler.h"
+#include "CAmSocketHandler.h"
namespace am
{
diff --git a/AudioManagerDaemon/test/AmRoutingInterfaceTest/CMakeLists.txt b/AudioManagerDaemon/test/AmRoutingInterfaceTest/CMakeLists.txt
index b9aa9c5..6294f7d 100644
--- a/AudioManagerDaemon/test/AmRoutingInterfaceTest/CMakeLists.txt
+++ b/AudioManagerDaemon/test/AmRoutingInterfaceTest/CMakeLists.txt
@@ -10,84 +10,74 @@
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
# this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
-# author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+# author Christian Linke, christian.linke@bmw.de BMW 2011,2012
#
# For further information see http://www.genivi.org/.
#
-cmake_minimum_required(VERSION 2.6)
+cmake_minimum_required(VERSION 2.8.8)
-PROJECT(AmRoutingInterfaceTest)
+project (AmRoutingInterfaceTest)
-#set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUNIT_TEST=1 -DDLT_CONTEXT=AudioManager")
+find_package(PkgConfig)
-FIND_PACKAGE(PkgConfig)
-
-IF(WITH_DLT)
+set (AM_LINK_LIBS
+ ${CMAKE_DL_LIBS}
+ rt)
+
+if(WITH_DLT)
pkg_check_modules(DLT REQUIRED automotive-dlt>=2.2.0)
-ENDIF(WITH_DLT)
+ set (AM_LINK_LIBS
+ ${AM_LINK_LIBS}
+ ${DLT_LIBRARIES})
+endif(WITH_DLT)
INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_BINARY_DIR}
${AUDIO_INCLUDE_FOLDER}
- ${DBUS_ARCH_INCLUDE_DIR}
- ${DBUS_INCLUDE_FOLDER}
${CMAKE_SOURCE_DIR}
${STD_INCLUDE_DIRS}
- ${DLT_INCLUDE_DIRS}
- ${DBUS_INCLUDE_DIR}
${INCLUDE_FOLDER}
${GOOGLE_TEST_INCLUDE_DIR}
${GMOCK_INCLUDE_DIR}
)
+
+if(WITH_DLT)
+ INCLUDE_DIRECTORIES(
+ ${INCLUDE_DIRECTORIES}
+ ${DLT_INCLUDE_DIRS})
+endif(WITH_DLT)
file(GLOB ROUTING_INTERFACE_SRCS_CXX
- "../../src/CAmControlReceiver.cpp"
- "../../src/CAmDatabaseHandlerMap.cpp"
- "../../src/CAmDatabaseObserver.cpp"
- "../../src/CAmCommandSender.cpp"
- "../../src/CAmRoutingSender.cpp"
- "../../src/CAmRouter.cpp"
- "../../src/CAmControlSender.cpp"
- "../CAmCommonFunctions.cpp"
- "../../src/CAmDltWrapper.cpp"
- "../../src/CAmSocketHandler.cpp"
- "../../src/CAmRoutingReceiver.cpp"
- "../../src/CAmCommandReceiver.cpp"
- "../../src/CAmDbusWrapper.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmControlReceiver.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmDatabaseHandlerMap.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmDatabaseObserver.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmCommandSender.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmRoutingSender.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmRouter.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmControlSender.cpp"
+ "${AUDIOMANAGER_UTILITIES_SRC}/CAmDltWrapper.cpp"
+ "${AUDIOMANAGER_UTILITIES_SRC}/CAmSocketHandler.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmRoutingReceiver.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmCommandReceiver.cpp"
+ "../CAmCommonFunctions.cpp"
"*.cpp"
)
-IF(WITH_NSM)
- SET (DATABASE_SRCS_CXX
- ${DATABASE_SRCS_CXX}
- "../../src/CAmNodeStateCommunicatorDBus.cpp")
-ENDIF(WITH_NSM)
-
ADD_EXECUTABLE(AmRoutingInterfaceTest ${ROUTING_INTERFACE_SRCS_CXX})
TARGET_LINK_LIBRARIES(AmRoutingInterfaceTest
- ${SQLITE_LIBRARIES}
- ${DLT_LIBRARIES}
- ${DBUS_LIBRARY}
- ${CMAKE_THREAD_LIBS_INIT}
- ${CMAKE_DL_LIBS}
+ ${AM_LINK_LIBS}
gtest
- gmock
-)
+ gmock)
ADD_DEPENDENCIES(AmRoutingInterfaceTest gtest gmock)
INSTALL(TARGETS AmRoutingInterfaceTest
- DESTINATION "~/AudioManagerTest/"
+ DESTINATION ${TEST_EXECUTABLE_INSTALL_PATH}
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
COMPONENT tests
)
-SET(ADD_DEPEND "audiomanager-bin" "sqlite3(>=3.6.22)" "dlt" "libdbus-1-3(>=1.2.16)" "libpthread-stubs0")
-set_property(GLOBAL APPEND PROPERTY tests_prop "${ADD_DEPEND}")
-
-
-
diff --git a/AudioManagerDaemon/test/AmSocketHandlerTest/CAmSocketHandlerTest.cpp b/AudioManagerDaemon/test/AmSocketHandlerTest/CAmSocketHandlerTest.cpp
index d357d80..1b28326 100644
--- a/AudioManagerDaemon/test/AmSocketHandlerTest/CAmSocketHandlerTest.cpp
+++ b/AudioManagerDaemon/test/AmSocketHandlerTest/CAmSocketHandlerTest.cpp
@@ -12,7 +12,7 @@
* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*
- * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
*
* For further information see http://www.genivi.org/.
*
@@ -28,7 +28,7 @@
#include <fcntl.h>
#include <sys/un.h>
#include <sys/poll.h>
-#include "shared/CAmSocketHandler.h"
+#include "CAmSocketHandler.h"
//todo: expand test, implement more usecases
//todo: test removeFD
diff --git a/AudioManagerDaemon/test/AmSocketHandlerTest/CAmSocketHandlerTest.h b/AudioManagerDaemon/test/AmSocketHandlerTest/CAmSocketHandlerTest.h
index 3866fa8..aea5fb1 100644
--- a/AudioManagerDaemon/test/AmSocketHandlerTest/CAmSocketHandlerTest.h
+++ b/AudioManagerDaemon/test/AmSocketHandlerTest/CAmSocketHandlerTest.h
@@ -12,7 +12,7 @@
* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*
- * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
*
* For further information see http://www.genivi.org/.
*
@@ -21,9 +21,11 @@
#ifndef SOCKETHANDLERTEST_H_
#define SOCKETHANDLERTEST_H_
+#define WITH_DLT
+
#include "gtest/gtest.h"
#include <queue>
-#include "shared/CAmSocketHandler.h"
+#include "CAmSocketHandler.h"
namespace am
{
diff --git a/AudioManagerDaemon/test/AmSocketHandlerTest/CMakeLists.txt b/AudioManagerDaemon/test/AmSocketHandlerTest/CMakeLists.txt
index 1d02636..8cd4197 100644
--- a/AudioManagerDaemon/test/AmSocketHandlerTest/CMakeLists.txt
+++ b/AudioManagerDaemon/test/AmSocketHandlerTest/CMakeLists.txt
@@ -10,71 +10,64 @@
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
# this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
-# author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+# author Christian Linke, christian.linke@bmw.de BMW 2011,2012
#
# For further information see http://www.genivi.org/.
#
-cmake_minimum_required(VERSION 2.6)
+cmake_minimum_required(VERSION 2.8.8)
-PROJECT(AmSocketHandlerTest)
+project(AmSocketHandlerTest)
-set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -DUNIT_TEST=1 -DDLT_CONTEXT=AudioManager")
-set(STD_INCLUDE_DIRS "/usr/include")
-set(DBUS_FOLDER ${CMAKE_SOURCE_DIR}/../../../dbusInterfaces)
-set(AUDIO_INCLUDE_FOLDER ${CMAKE_SOURCE_DIR}/../../../include)
-set(DBUS_INCLUDE_FOLDER ${CMAKE_SOURCE_DIR}/../../../../dbusinclude)
-set(INCLUDE_FOLDER ${CMAKE_SOURCE_DIR}/../../include)
+set (AM_LINK_LIBS
+ ${CMAKE_DL_LIBS}
+ rt)
-
-FIND_PACKAGE(PkgConfig)
-
-IF(WITH_DLT)
+if(WITH_DLT)
pkg_check_modules(DLT REQUIRED automotive-dlt>=2.2.0)
-ENDIF(WITH_DLT)
+ set (AM_LINK_LIBS
+ ${AM_LINK_LIBS}
+ ${DLT_LIBRARIES})
+endif(WITH_DLT)
+
INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_BINARY_DIR}
${AUDIO_INCLUDE_FOLDER}
- ${DBUS_ARCH_INCLUDE_DIR}
- ${DBUS_INCLUDE_FOLDER}
${CMAKE_SOURCE_DIR}
- ${STD_INCLUDE_DIRS}
- ${DLT_INCLUDE_DIRS}
- ${DBUS_INCLUDE_DIR}
${INCLUDE_FOLDER}
${GOOGLE_TEST_INCLUDE_DIR}
+ ${AUDIOMANAGER_UTILITIES_INCLUDE}
${GMOCK_INCLUDE_DIR}
)
+
+if(WITH_DLT)
+ INCLUDE_DIRECTORIES(
+ ${INCLUDE_DIRECTORIES}
+ ${DLT_INCLUDE_DIRS})
+endif(WITH_DLT)
file(GLOB Socket_SRCS_CXX
- "../../src/CAmSocketHandler.cpp"
- "../../src/CAmDltWrapper.cpp"
+ "${AUDIOMANAGER_UTILITIES_SRC}/CAmSocketHandler.cpp"
+ "${AUDIOMANAGER_UTILITIES_SRC}/CAmDltWrapper.cpp"
"*.cpp"
)
ADD_EXECUTABLE(AmSocketHandlerTest ${Socket_SRCS_CXX})
TARGET_LINK_LIBRARIES(AmSocketHandlerTest
- ${DLT_LIBRARIES}
- ${DBUS_LIBRARY}
- ${CMAKE_THREAD_LIBS_INIT}
+ ${AM_LINK_LIBS}
gtest
- gmock
- rt
-)
+ gmock)
ADD_DEPENDENCIES(AmSocketHandlerTest gtest gmock)
INSTALL(TARGETS AmSocketHandlerTest
- DESTINATION "~/AudioManagerTest/"
+ DESTINATION ${TEST_EXECUTABLE_INSTALL_PATH}
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
COMPONENT tests
)
-SET(ADD_DEPEND "sqlite3(>=3.6.22)" "dlt" "libdbus-1-3(>=1.2.16)" "libpthread-stubs0")
-set_property(GLOBAL APPEND PROPERTY tests_prop "${ADD_DEPEND}")
-
diff --git a/AudioManagerDaemon/test/AmTelnetServerTest/CAmTelnetServerTest.cpp b/AudioManagerDaemon/test/AmTelnetServerTest/CAmTelnetServerTest.cpp
index e940423..1d677ad 100644
--- a/AudioManagerDaemon/test/AmTelnetServerTest/CAmTelnetServerTest.cpp
+++ b/AudioManagerDaemon/test/AmTelnetServerTest/CAmTelnetServerTest.cpp
@@ -12,7 +12,7 @@
* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*
- * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
* \author Frank Herchet, frank.fh.herchet@bmw.de BMW 2012
*
* For further information see http://www.genivi.org/.
@@ -57,7 +57,6 @@ CAmEnvironment::CAmEnvironment()
, mDatabasehandler()
, mRoutingSender(mlistRoutingPluginDirs)
, mCommandSender(mlistRoutingPluginDirs)
-, mControlSender(controllerPlugin,&mSocketHandler)
, mRouter(&mDatabasehandler,&mControlSender)
, mpCommandReceiver(NULL)
, mpRoutingReceiver(NULL)
@@ -102,12 +101,12 @@ void CAmEnvironment::setSocketHandler(CAmSocketHandler* pSocketHandler)
mpControlReceiver = new CAmControlReceiver(&mDatabasehandler,&mRoutingSender,&mCommandSender,mpSocketHandler,&mRouter);
//startup all the Plugins and Interfaces
- mControlSender.startupController(mpControlReceiver);
- mCommandSender.startupInterfaces(mpCommandReceiver);
- mRoutingSender.startupInterfaces(mpRoutingReceiver);
+ //mControlSender.startupController(mpControlReceiver);
+ //mCommandSender.startupInterfaces(mpCommandReceiver);
+ //mRoutingSender.startupInterfaces(mpRoutingReceiver);
//when the routingInterface is done, all plugins are loaded:
- mControlSender.setControllerReady();
+ //mControlSender.setControllerReady();
// Starting TelnetServer
mpTelnetServer = new CAmTelnetServer(mpSocketHandler,&mCommandSender,mpCommandReceiver,&mRoutingSender,mpRoutingReceiver,&mControlSender,mpControlReceiver,&mDatabasehandler,&mRouter,servPort,3);
diff --git a/AudioManagerDaemon/test/AmTelnetServerTest/CAmTelnetServerTest.h b/AudioManagerDaemon/test/AmTelnetServerTest/CAmTelnetServerTest.h
index 6f4ab6a..2be89f5 100644
--- a/AudioManagerDaemon/test/AmTelnetServerTest/CAmTelnetServerTest.h
+++ b/AudioManagerDaemon/test/AmTelnetServerTest/CAmTelnetServerTest.h
@@ -12,7 +12,7 @@
* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*
- * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
* \author Frank Herchet, frank.fh.herchet@bmw.de BMW 2012
*
* For further information see http://www.genivi.org/.
@@ -29,11 +29,7 @@
#include "CAmControlSender.h"
#include "CAmRouter.h"
#include "config.h"
-#ifdef WITH_DATABASE_STORAGE
- #include "CAmDatabaseHandlerSQLite.h"
-#else
- #include "CAmDatabaseHandlerMap.h"
-#endif
+#include "CAmDatabaseHandlerMap.h"
@@ -72,11 +68,7 @@ class CAmEnvironment : public ::testing::Environment
std::vector<std::string> mlistCommandPluginDirs;
CAmSocketHandler mSocketHandler;
-#ifdef WITH_DATABASE_STORAGE
- CAmDatabaseHandlerSQLite mDatabasehandler;
-#else
CAmDatabaseHandlerMap mDatabasehandler;
-#endif
CAmRoutingSender mRoutingSender;
CAmCommandSender mCommandSender;
CAmControlSender mControlSender;
diff --git a/AudioManagerDaemon/test/AmTelnetServerTest/CMakeLists.txt b/AudioManagerDaemon/test/AmTelnetServerTest/CMakeLists.txt
index 1dfa5c1..d613ed6 100644
--- a/AudioManagerDaemon/test/AmTelnetServerTest/CMakeLists.txt
+++ b/AudioManagerDaemon/test/AmTelnetServerTest/CMakeLists.txt
@@ -10,95 +10,74 @@
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
# this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
-# author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+# author Christian Linke, christian.linke@bmw.de BMW 2011,2012
#
# For further information see http://www.genivi.org/.
#
-cmake_minimum_required(VERSION 2.6)
+cmake_minimum_required(VERSION 2.8.8)
PROJECT(AmTelnetServerTest)
-set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic")
-set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -DUNIT_TEST=1 -DDLT_CONTEXT=AudioManager")
-
-set(STD_INCLUDE_DIRS "/usr/include")
-set(DBUS_FOLDER ${CMAKE_SOURCE_DIR}/../../../dbusInterfaces)
-set(AUDIO_INCLUDE_FOLDER ${CMAKE_SOURCE_DIR}/../../../include)
-set(DBUS_INCLUDE_FOLDER ${CMAKE_SOURCE_DIR}/../../../../dbusinclude)
-set(INCLUDE_FOLDER ${CMAKE_SOURCE_DIR}/../../include)
+set (AM_LINK_LIBS
+ ${CMAKE_DL_LIBS}
+ rt)
+set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -DUNIT_TEST=1 -DDLT_CONTEXT=AudioManager")
-FIND_PACKAGE(PkgConfig)
-IF(WITH_DLT)
+if(WITH_DLT)
pkg_check_modules(DLT REQUIRED automotive-dlt>=2.2.0)
-ENDIF(WITH_DLT)
+ set (AM_LINK_LIBS
+ ${AM_LINK_LIBS}
+ ${DLT_LIBRARIES})
+endif(WITH_DLT)
INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_BINARY_DIR}
${AUDIO_INCLUDE_FOLDER}
- ${DBUS_ARCH_INCLUDE_DIR}
- ${DBUS_INCLUDE_FOLDER}
${CMAKE_SOURCE_DIR}
- ${STD_INCLUDE_DIRS}
- ${DLT_INCLUDE_DIRS}
- ${DBUS_INCLUDE_DIR}
${INCLUDE_FOLDER}
${GOOGLE_TEST_INCLUDE_DIR}
${GMOCK_INCLUDE_DIR}
)
+
+if(WITH_DLT)
+INCLUDE_DIRECTORIES(
+ ${INCLUDE_DIRECTORIES}
+ ${DLT_INCLUDE_DIRS})
+endif(WITH_DLT)
file(GLOB TELNET_SRCS_CXX
- "../../src/CAmCommandReceiver.cpp"
- "../../src/CAmCommandSender.cpp"
- "../../src/CAmControlReceiver.cpp"
- "../../src/CAmControlSender.cpp"
- "../../src/CAmDatabaseObserver.cpp"
- "../../src/CAmRoutingReceiver.cpp"
- "../../src/CAmRoutingSender.cpp"
- "../../src/CAmSocketHandler.cpp"
- "../../src/CAmTelnetServer.cpp"
- "../../src/CAmRouter.cpp"
- "../../src/CAmDltWrapper.cpp"
- "../../src/CAmTelnetMenuHelper.cpp"
- "../../src/CAmDbusWrapper.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmCommandReceiver.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmCommandSender.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmControlReceiver.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmControlSender.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmDatabaseObserver.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmRoutingReceiver.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmRoutingSender.cpp"
+ "${AUDIOMANAGER_UTILITIES_SRC}/CAmSocketHandler.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmTelnetServer.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmRouter.cpp"
+ "${AUDIOMANAGER_UTILITIES_SRC}/CAmDltWrapper.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmTelnetMenuHelper.cpp"
+ "${AUDIOMANAGER_DAEMON_FOLDER}/src/CAmDatabaseHandlerMap.cpp"
"*.cpp"
)
-IF(WITH_DATABASE_STORAGE)
- SET (TELNET_SRCS_CXX ${TELNET_SRCS_CXX} "../../src/CAmDatabaseHandlerSQLite.cpp")
-ELSE(WITH_DATABASE_STORAGE)
- SET (TELNET_SRCS_CXX ${TELNET_SRCS_CXX} "../../src/CAmDatabaseHandlerMap.cpp")
-ENDIF(WITH_DATABASE_STORAGE)
-
-IF(WITH_NSM)
- SET (DATABASE_SRCS_CXX
- ${DATABASE_SRCS_CXX}
- "../../src/CAmNodeStateCommunicatorDBus.cpp")
-ENDIF(WITH_NSM)
-
ADD_EXECUTABLE(AmTelnetServerTest ${TELNET_SRCS_CXX})
TARGET_LINK_LIBRARIES(AmTelnetServerTest
- ${SQLITE_LIBRARIES}
- ${DLT_LIBRARIES}
- ${DBUS_LIBRARY}
- ${CMAKE_THREAD_LIBS_INIT}
- ${CMAKE_DL_LIBS}
+ ${AM_LINK_LIBS}
gtest
- gmock
-)
+ gmock)
ADD_DEPENDENCIES(AmTelnetServerTest gtest gmock)
INSTALL(TARGETS AmTelnetServerTest
- DESTINATION "~/AudioManagerTest/"
+ DESTINATION ${TEST_EXECUTABLE_INSTALL_PATH}
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
COMPONENT tests
)
-SET(ADD_DEPEND "sqlite3(>=3.6.22)" "dlt" "libdbus-1-3(>=1.2.16)" "libpthread-stubs0")
-set_property(GLOBAL APPEND PROPERTY tests_prop "${ADD_DEPEND}")
-
diff --git a/AudioManagerDaemon/test/CAmCommonFunctions.cpp b/AudioManagerDaemon/test/CAmCommonFunctions.cpp
index 5ab6aef..34012be 100644
--- a/AudioManagerDaemon/test/CAmCommonFunctions.cpp
+++ b/AudioManagerDaemon/test/CAmCommonFunctions.cpp
@@ -12,7 +12,7 @@
* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*
- * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
*
* For further information see http://www.genivi.org/.
*
diff --git a/AudioManagerDaemon/test/CAmCommonFunctions.h b/AudioManagerDaemon/test/CAmCommonFunctions.h
index ba152c3..1b25434 100644
--- a/AudioManagerDaemon/test/CAmCommonFunctions.h
+++ b/AudioManagerDaemon/test/CAmCommonFunctions.h
@@ -12,7 +12,7 @@
* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*
- * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
*
* For further information see http://www.genivi.org/.
*
diff --git a/AudioManagerDaemon/test/CMakeLists.txt b/AudioManagerDaemon/test/CMakeLists.txt
index e0ae651..dceb22c 100644
--- a/AudioManagerDaemon/test/CMakeLists.txt
+++ b/AudioManagerDaemon/test/CMakeLists.txt
@@ -10,12 +10,12 @@
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
# this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
-# author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+# author Christian Linke, christian.linke@bmw.de BMW 2011,2012
#
# For further information see http://www.genivi.org/.
#
-cmake_minimum_required(VERSION 2.6)
+cmake_minimum_required(VERSION 2.8.8)
set(EXECUTABLE_OUTPUT_PATH ${TEST_EXECUTABLE_OUTPUT_PATH})
diff --git a/AudioManagerDaemon/test/IAmCommandBackdoor.h b/AudioManagerDaemon/test/IAmCommandBackdoor.h
index 5a01c06..33aef19 100644
--- a/AudioManagerDaemon/test/IAmCommandBackdoor.h
+++ b/AudioManagerDaemon/test/IAmCommandBackdoor.h
@@ -12,7 +12,7 @@
* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*
- * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
*
* For further information see http://www.genivi.org/.
*
diff --git a/AudioManagerDaemon/test/IAmControlBackdoor.h b/AudioManagerDaemon/test/IAmControlBackdoor.h
index 3a1edef..1c006f0 100644
--- a/AudioManagerDaemon/test/IAmControlBackdoor.h
+++ b/AudioManagerDaemon/test/IAmControlBackdoor.h
@@ -12,7 +12,7 @@
* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*
- * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
*
* For further information see http://www.genivi.org/.
*
diff --git a/AudioManagerDaemon/test/IAmRoutingBackdoor.h b/AudioManagerDaemon/test/IAmRoutingBackdoor.h
index 31cfded..f8bda2b 100644
--- a/AudioManagerDaemon/test/IAmRoutingBackdoor.h
+++ b/AudioManagerDaemon/test/IAmRoutingBackdoor.h
@@ -12,7 +12,7 @@
* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*
- * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
*
* For further information see http://www.genivi.org/.
*
diff --git a/AudioManagerDaemon/test/MockIAmCommandSend.h b/AudioManagerDaemon/test/MockIAmCommandSend.h
index 381f323..8d1c17f 100644
--- a/AudioManagerDaemon/test/MockIAmCommandSend.h
+++ b/AudioManagerDaemon/test/MockIAmCommandSend.h
@@ -12,7 +12,7 @@
* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*
- * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
*
* For further information see http://www.genivi.org/.
*
diff --git a/AudioManagerDaemon/test/MockIAmControlSend.h b/AudioManagerDaemon/test/MockIAmControlSend.h
index dc9bdc0..219a7f1 100644
--- a/AudioManagerDaemon/test/MockIAmControlSend.h
+++ b/AudioManagerDaemon/test/MockIAmControlSend.h
@@ -12,7 +12,7 @@
* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*
- * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
*
* For further information see http://www.genivi.org/.
*
diff --git a/AudioManagerDaemon/test/MockIAmRoutingSend.h b/AudioManagerDaemon/test/MockIAmRoutingSend.h
index 6ebb94d..f995828 100644
--- a/AudioManagerDaemon/test/MockIAmRoutingSend.h
+++ b/AudioManagerDaemon/test/MockIAmRoutingSend.h
@@ -12,7 +12,7 @@
* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*
- * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
*
* For further information see http://www.genivi.org/.
*
diff --git a/include/shared/CAmCommonAPIWrapper.h b/AudioManagerUtilities/include/CAmCommonAPIWrapper.h
index dd0d983..9c293f7 100644
--- a/include/shared/CAmCommonAPIWrapper.h
+++ b/AudioManagerUtilities/include/CAmCommonAPIWrapper.h
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2012, BMW AG
*
- * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
* \author Aleksandar Donchev, aleksander.donchev@partner.bmw.de BMW 2013
*
* \copyright
diff --git a/include/shared/CAmDbusWrapper.h b/AudioManagerUtilities/include/CAmDbusWrapper.h
index 35b5e77..0f8a0bd 100644
--- a/include/shared/CAmDbusWrapper.h
+++ b/AudioManagerUtilities/include/CAmDbusWrapper.h
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2012, BMW AG
*
- * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \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,
diff --git a/include/shared/CAmDltWrapper.h b/AudioManagerUtilities/include/CAmDltWrapper.h
index 49cae31..8492567 100644
--- a/include/shared/CAmDltWrapper.h
+++ b/AudioManagerUtilities/include/CAmDltWrapper.h
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2012, BMW AG
*
- * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
* Jens Lorenz, jlorenz@de.adit-jv.com ADIT 2014
*
* \copyright
@@ -20,9 +20,10 @@
#ifndef DLTWRAPPER_H_
#define DLTWRAPPER_H_
-#include "config.h"
+#include <config.h>
#include <string>
#include <pthread.h>
+#include <config.h>
#include "audiomanagertypes.h"
#ifdef WITH_DLT
diff --git a/include/shared/CAmSerializer.h b/AudioManagerUtilities/include/CAmSerializer.h
index 7d6cf80..1f13a66 100644
--- a/include/shared/CAmSerializer.h
+++ b/AudioManagerUtilities/include/CAmSerializer.h
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2012, BMW AG
*
- * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \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,
diff --git a/include/shared/CAmSocketHandler.h b/AudioManagerUtilities/include/CAmSocketHandler.h
index 1e91b5f..7759346 100644
--- a/include/shared/CAmSocketHandler.h
+++ b/AudioManagerUtilities/include/CAmSocketHandler.h
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2012, BMW AG
*
- * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \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,
diff --git a/AudioManagerDaemon/src/CAmCommonAPIWrapper.cpp b/AudioManagerUtilities/src/CAmCommonAPIWrapper.cpp
index 28103de..46aa004 100644
--- a/AudioManagerDaemon/src/CAmCommonAPIWrapper.cpp
+++ b/AudioManagerUtilities/src/CAmCommonAPIWrapper.cpp
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2012, BMW AG
*
- * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
* \author Aleksandar Donchev, aleksander.donchev@partner.bmw.de BMW 2013
*
* \copyright
@@ -29,9 +29,9 @@
#include <poll.h>
#include <tuple>
#include "audiomanagertypes.h"
-#include "shared/CAmSocketHandler.h"
-#include "shared/CAmDltWrapper.h"
-#include "shared/CAmCommonAPIWrapper.h"
+#include "CAmSocketHandler.h"
+#include "CAmDltWrapper.h"
+#include "CAmCommonAPIWrapper.h"
namespace am
diff --git a/AudioManagerDaemon/src/CAmDbusWrapper.cpp b/AudioManagerUtilities/src/CAmDbusWrapper.cpp
index c9c26a4..c5230ec 100644
--- a/AudioManagerDaemon/src/CAmDbusWrapper.cpp
+++ b/AudioManagerUtilities/src/CAmDbusWrapper.cpp
@@ -12,14 +12,14 @@
* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*
- * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
*
* \file CAmDbusWrapper.cpp
* For further information see http://www.genivi.org/.
*
*/
-#include "shared/CAmDbusWrapper.h"
+#include "CAmDbusWrapper.h"
#include <config.h>
#include <fstream>
#include <sstream>
@@ -27,8 +27,8 @@
#include <cassert>
#include <cstdlib>
#include <stdexcept>
-#include "shared/CAmDltWrapper.h"
-#include "shared/CAmSocketHandler.h"
+#include "CAmDltWrapper.h"
+#include "CAmSocketHandler.h"
namespace am
{
diff --git a/AudioManagerDaemon/src/CAmDltWrapper.cpp b/AudioManagerUtilities/src/CAmDltWrapper.cpp
index fc2aaa4..b841eb8 100644
--- a/AudioManagerDaemon/src/CAmDltWrapper.cpp
+++ b/AudioManagerUtilities/src/CAmDltWrapper.cpp
@@ -12,7 +12,7 @@
* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*
- * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
* Jens Lorenz, jlorenz@de.adit-jv.com ADIT 2014
*
* \file CAmDltWrapper.cpp
@@ -21,7 +21,7 @@
*/
-#include "shared/CAmDltWrapper.h"
+#include "CAmDltWrapper.h"
#include <string>
#include <sstream>
#include <iostream>
diff --git a/AudioManagerDaemon/src/CAmSocketHandler.cpp b/AudioManagerUtilities/src/CAmSocketHandler.cpp
index 455cb32..2e8806a 100644
--- a/AudioManagerDaemon/src/CAmSocketHandler.cpp
+++ b/AudioManagerUtilities/src/CAmSocketHandler.cpp
@@ -12,15 +12,15 @@
* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*
- * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
*
* \file CAmSocketHandler.cpp
* For further information see http://www.genivi.org/.
*
*/
-#include "shared/CAmSocketHandler.h"
-#include <config.h>
+#include "CAmSocketHandler.h"
+//#include <config.h>
#include <cassert>
#include <sys/fcntl.h>
#include <sys/errno.h>
@@ -30,7 +30,7 @@
#include <features.h>
#include <csignal>
#include <unistd.h>
-#include "shared/CAmDltWrapper.h"
+#include "CAmDltWrapper.h"
namespace am
{
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c97d876..24e09c4 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,265 +7,236 @@
#
# copyright
# This Source Code Form is subject to the terms of the
-# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+# Mozilla Public License, v. 2.0. if a copy of the MPL was not distributed with
# this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
-# author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+# author Christian Linke, christian.linke@bmw.de BMW 2011,2012,2015
#
# For further information see http://www.genivi.org/.
#
-cmake_minimum_required(VERSION 2.6)
-include(CMakeDependentOption)
+cmake_minimum_required(VERSION 2.8.8)
-execute_process(COMMAND git describe --tags WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
- OUTPUT_VARIABLE DAEMONVERSION
- OUTPUT_STRIP_TRAILING_WHITESPACE)
+set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
-IF (NOT DAEMONVERSION)
- #Can be changed via passing -DVERSION="XXX" to cmake
- IF(NOT DEFINED VERSION)
- SET( DAEMONVERSION "homebrew-${CMAKE_SOURCE_DIR}" )
- ELSE (NOT DEFINED VERSION)
- SET( DAEMONVERSION "${VERSION}" )
- ENDIF(NOT DEFINED VERSION)
-ELSE (NOT DAEMONVERSION)
- STRING(REGEX REPLACE "(-)[^-]+$" "" DAEMONVERSION ${DAEMONVERSION})
- STRING(REGEX REPLACE "-" "." DAEMONVERSION ${DAEMONVERSION})
-ENDIF(NOT DAEMONVERSION)
+include ( CMakeDependentOption )
+include ( MacroVersionFromGit )
+include ( MacroInterfaceVersions )
+include ( CMakePackageConfigHelpers )
-message(STATUS "Build Version ${DAEMONVERSION}")
+project(AudioManagerDeamon)
-execute_process(COMMAND git log --pretty=short WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
- OUTPUT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/CHANGELOG)
-
-PROJECT(AudioManagerDeamon)
+if (NOT ${CMAKE_TOOLCHAIN_FILE} EQUAL "")
+ message(STATUS "Using CMAKE_TOOLCHAIN_FILE='${CMAKE_TOOLCHAIN_FILE}'" )
+endif (NOT ${CMAKE_TOOLCHAIN_FILE} EQUAL "")
-message( STATUS "CMAKE_TOOLCHAIN_FILE='${CMAKE_TOOLCHAIN_FILE}'" )
+find_package(PkgConfig)
-FIND_PACKAGE(PkgConfig)
+#we need this anyway - even if not installed, then we take our stuff.
+find_package(NSM REQUIRED)
-SET(WITH_ENABLED_IPC "CAPI" CACHE STRING "Disable 'NONE' / Enable Common-API 'CAPI' or Dbus 'DBUS' Support")
+set(WITH_ENABLED_IPC "CAPI" CACHE STRING "Disable 'NONE' / Enable Common-API 'CAPI' or Dbus 'DBUS' Support")
+set_property(CACHE WITH_ENABLED_IPC PROPERTY STRINGS "NONE" "CAPI" "DBUS")
-SET_PROPERTY(CACHE WITH_ENABLED_IPC PROPERTY STRINGS "NONE" "CAPI" "DBUS")
-
-OPTION( WITH_DLT
- "Enable automotive-DLT Support" ON )
-
-OPTION( WITH_TESTS
+option( WITH_TESTS
"Build together with all available unitTest" ON )
-OPTION( WITH_DOCUMENTATION
+option( WITH_DOCUMENTATION
"Build together with Doxygen Documentation" OFF )
-OPTION( WITH_PLUGIN_COMMAND
- "Build command pluings" ON)
-
-OPTION( WITH_PLUGIN_CONTROL
- "Build control plugin" ON)
+option( WITH_DLT
+ "Enable automotive-DLT Support" ON )
-OPTION( WITH_PLUGIN_ROUTING
- "Build routing pluings" ON)
+option( WITH_DOCUMENTATION
+ "Build together with Doxygen Documentation" OFF )
-OPTION( WITH_TELNET
- "build with Telnetserver (can only work with SocketHandler)" ON)
+option( WITH_TELNET
+ "Build with Telnetserver (can only work with SocketHandler)" ON)
-OPTION ( WITH_SYSTEMD_WATCHDOG
- "build with systemD support & watchdog" OFF)
+option ( WITH_SYSTEMD_WATCHDOG
+ "Build with systemD support & watchdog" OFF)
-OPTION ( USE_BUILD_LIBS
- "build with default library path = build path" ON)
+option ( USE_BUILD_LIBS
+ "Build with default library path = build path" ON)
-OPTION ( GLIB_DBUS_TYPES_TOLERANT
- "build dbus with tolerance towards glib 16bit/32bit handling" ON)
-
-IF (WITH_ENABLED_IPC STREQUAL "NONE")
- SET (ENABLE_NSM OFF)
-ELSE ()
- SET (ENABLE_NSM ON)
-ENDIF ()
-
-CMAKE_DEPENDENT_OPTION(WITH_NSM "build with NSM support" ON
- "ENABLE_NSM" OFF)
+option ( GLIB_DBUS_TYPES_TOLERANT
+ "Build dbus with tolerance towards glib 16bit/32bit handling" ON)
-OPTION ( WITH_NSM
- "build with NSM support" ON)
+option( WITH_NSM
+ "build with NSM support" OFF)
- OPTION ( WITH_DATABASE_STORAGE
- "build with sqlite as in memory storage" OFF)
+ option ( WITH_DATABASE_STORAGE
+ "Build with sqlite as in memory storage" OFF)
-SET (WITH_COMMON_API_GEN ON CACHE INTERNAL "hide this!" FORCE)
+set (WITH_COMMON_API_GEN ON CACHE INTERNAL "hide this!" FORCE)
-IF (WITH_ENABLED_IPC STREQUAL "DBUS")
- SET (WITH_DBUS_WRAPPER ON CACHE INTERNAL "hide this!" FORCE)
- SET (WITH_CAPI_WRAPPER OFF CACHE INTERNAL "hide this!" FORCE)
-ELSEIF(WITH_ENABLED_IPC STREQUAL "CAPI")
- SET (WITH_CAPI_WRAPPER ON CACHE INTERNAL "hide this!" FORCE)
- SET (WITH_DBUS_WRAPPER OFF CACHE INTERNAL "hide this!" FORCE)
+if (WITH_ENABLED_IPC STREQUAL "DBUS")
+ set (WITH_DBUS_WRAPPER ON CACHE INTERNAL "hide this!" FORCE)
+ set (WITH_CAPI_WRAPPER OFF CACHE INTERNAL "hide this!" FORCE)
+elseif(WITH_ENABLED_IPC STREQUAL "CAPI")
+ set (WITH_CAPI_WRAPPER ON CACHE INTERNAL "hide this!" FORCE)
+ set (WITH_DBUS_WRAPPER OFF CACHE INTERNAL "hide this!" FORCE)
+elseif(WITH_ENABLED_IPC STREQUAL "NONE")
+ set (WITH_CAPI_WRAPPER OFF CACHE INTERNAL "hide this!" FORCE)
+ set (WITH_DBUS_WRAPPER OFF CACHE INTERNAL "hide this!" FORCE)
+endif ()
+
+set(DBUS_SERVICE_PREFIX "org.genivi.audiomanager\0"
+ CACHE PROPERTY "The dbus service prefix for the AM - only changable for legacy dbus")
+
+set(DBUS_SERVICE_OBJECT_PATH "/org/genivi/audiomanager\0"
+ CACHE PROPERTY "The service object path of the AM - only changable for legacy dbus")
+
+set(DEFAULT_TELNETPORT 6080
+ CACHE INTEGER "The telnet port that is offered by the AM, only valid if TELNET is ON")
+
+set(MAX_TELNETCONNECTIONS 3
+ CACHE INTEGER "The maximum of allowed telnet connections, only valid if TELNET is ON")
+
+set(NSM_BUS_INTERFACE "org.genivi.NodeStateManager"
+ CACHE PROPERTY "The Dbus interface of the NSM - only relevant for legacy dbus" )
+
+set(NSM_PATH "/org/genivi/NodeStateManager"
+ CACHE PROPERTY "The Dbus path of the NSM - only relevant for legacy dbus")
+
+set(NSM_INTERFACE "org.genivi.NodeStateManager.Consumer"
+ CACHE PROPERTY "The NSM interface - only relevant for legacy dbus")
+
+set(DYNAMIC_ID_BOUNDARY 100
+ CACHE INTEGER "The ID boundary between static and dynamic ID ranges")
+
+set(PLUGINS_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin/plugins
+ CACHE STRINGS "The output path of the plugins")
+
+set(LIB_INSTALL_SUFFIX "audiomanager"
+ CACHE STRINGS "The suffix used for installation of the plugins")
+
+set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/bin
+ CACHE STRINGS "The binary will be placed here")
+
+set(TEST_EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/bin/tests
+ CACHE STRINGS "The test binaries will be placed here")
- MACRO(INSERT_DBUS_CONF_IF_NEEDED IN_PLACEHOLDER IN_SRC_DBUS_CONF OUT_DST_DBUS_CONF)
- # Checks the variable in the template
- if(NOT EXISTS ${CMAKE_SOURCE_DIR}/AudioManagerDaemon/fidls/AudioManager_dbus.conf.in )
- FILE(WRITE ${CMAKE_SOURCE_DIR}/AudioManagerDaemon/fidls/AudioManager_dbus.conf.in
- "################################################ CMAKE GENERATED #################################################")
- endif( )
-
- FILE(READ ${CMAKE_SOURCE_DIR}/AudioManagerDaemon/fidls/AudioManager_dbus.conf.in DBUS_CONF_IN)
- if( NOT DBUS_CONF_IN MATCHES ${IN_PLACEHOLDER} )
- if( NOT DBUS_CONF_IN STREQUAL "" )
- FILE(APPEND ${CMAKE_SOURCE_DIR}/AudioManagerDaemon/fidls/AudioManager_dbus.conf.in "\r\n\r\n")
- endif( )
- FILE(APPEND ${CMAKE_SOURCE_DIR}/AudioManagerDaemon/fidls/AudioManager_dbus.conf.in ${IN_PLACEHOLDER})
- endif( )
- # Reads out the common-api dbus configuration for the node state manager.
- FILE(READ ${IN_SRC_DBUS_CONF} ${OUT_DST_DBUS_CONF})
- ENDMACRO(INSERT_DBUS_CONF_IF_NEEDED)
+set(TEST_EXECUTABLE_INSTALL_PATH "~/tests"
+ CACHE STRINGS "The test binaries will be installed here")
- ELSEIF(WITH_ENABLED_IPC STREQUAL "NONE")
- SET (WITH_CAPI_WRAPPER OFF CACHE INTERNAL "hide this!" FORCE)
- SET (WITH_DBUS_WRAPPER OFF CACHE INTERNAL "hide this!" FORCE)
-ENDIF ()
+set(DOC_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/doc
+ CACHE STRINGS "The doxygen documentation will be placed here")
-IF (NOT WITH_DBUS_WRAPPER AND NOT WITH_CAPI_WRAPPER)
- SET (WITH_NSM OFF)
-ENDIF (NOT WITH_DBUS_WRAPPER AND NOT WITH_CAPI_WRAPPER)
-
-#Can be changed via passing -DDBUS_SERVICE_PREFIX="XXX" to cmake
-IF(NOT DEFINED DBUS_SERVICE_PREFIX)
- SET( DBUS_SERVICE_PREFIX "org.genivi.audiomanager\0")
-ENDIF(NOT DEFINED DBUS_SERVICE_PREFIX)
-
-#Can be changed via passing -DDBUS_SERVICE_OBJECT_PATH="XXX" to cmake
-IF(NOT DEFINED DBUS_SERVICE_OBJECT_PATH)
- SET( DBUS_SERVICE_OBJECT_PATH "/org/genivi/audiomanager\0" )
-ENDIF(NOT DEFINED DBUS_SERVICE_OBJECT_PATH)
-
-#Can be changed via passing -DDEFAULT_TELNETPORT="XXX" to cmake
-IF(NOT DEFINED DEFAULT_TELNETPORT)
- SET( DEFAULT_TELNETPORT 6080 )
-ENDIF(NOT DEFINED DEFAULT_TELNETPORT)
-
-#Can be changed via passing -DMAX_TELNETCONNECTIONS="XXX" to cmake
-IF(NOT DEFINED MAX_TELNETCONNECTIONS)
- SET( MAX_TELNETCONNECTIONS 3 )
-ENDIF(NOT DEFINED MAX_TELNETCONNECTIONS)
-
-#Can be changed via passing -DNSM_BUS_INTERFACE="XXX" to cmake
-IF(NOT DEFINED NSM_BUS_INTERFACE)
- SET( NSM_BUS_INTERFACE "org.genivi.NodeStateManager")
-ENDIF(NOT DEFINED NSM_BUS_INTERFACE)
-
-#Can be changed via passing -DNSM_PATH="XXX" to cmake
-IF(NOT DEFINED NSM_PATH)
- SET( NSM_PATH "/org/genivi/NodeStateManager")
-ENDIF(NOT DEFINED NSM_PATH)
-
-#Can be changed via passing -DNSM_INTERFACE="XXX" to cmake
-IF(NOT DEFINED NSM_INTERFACE)
- SET( NSM_INTERFACE "org.genivi.NodeStateManager.Consumer")
-ENDIF(NOT DEFINED NSM_INTERFACE)
-
-SET(DYNAMIC_ID_BOUNDARY 100 CACHE INTEGER "The ID boundary between static and dynamic ID ranges")
-
-SET(PLUGINS_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/bin/plugins)
-SET(LIB_INSTALL_SUFFIX "audioManager")
+set(AM_SHARE_FOLDER ${CMAKE_INSTALL_PREFIX}/share
+ CACHE STRINGS "The share folder for the AM. Some DBus xmls will be placed here and so on")
+
+set(AUDIOMANAGER_INCLUDE_FOLDER ${CMAKE_BINARY_DIR}/include)
+set(AUDIO_INCLUDE_FOLDER ${CMAKE_SOURCE_DIR}/include)
+set(AUDIOMANAGER_UTILITIES ${CMAKE_SOURCE_DIR}/AudioManagerUtilities)
+set(AUDIOMANAGER_UTILITIES_INCLUDE ${AUDIOMANAGER_UTILITIES}/include)
+set(AUDIOMANAGER_UTILITIES_SRC ${AUDIOMANAGER_UTILITIES}/src)
+set(DOXY_PROTOTYPE ${CMAKE_SOURCE_DIR}/cmake/DoxyFile.in)
+set(DOXY_FILE ${CMAKE_CURRENT_BINARY_DIR}/DoxyFile)
+set(AUDIOMANAGER_DAEMON_FOLDER ${CMAKE_SOURCE_DIR}/AudioManagerDaemon)
+set(GOOGLE_MOCK_PROJECT_FOLDER ${CMAKE_SOURCE_DIR}/googleMock)
+
+GET_COMMAND_INTERFACE_VERSION(${AUDIO_INCLUDE_FOLDER})
+GET_ROUTING_INTERFACE_VERSION(${AUDIO_INCLUDE_FOLDER})
+GET_CONTROL_INTERFACE_VERSION(${AUDIO_INCLUDE_FOLDER})
+message( STATUS "CommandInterface version: ${LIB_COMMAND_INTERFACE_VERSION}")
+message( STATUS "ControlInterface version: ${LIB_CONTROL_INTERFACE_VERSION}")
+message( STATUS "RoutingInterface version: ${LIB_ROUTING_INTERFACE_VERSION}")
if(USE_BUILD_LIBS)
- IF(NOT DEFINED DEFAULT_PLUGIN_COMMAND_DIR)
- SET(DEFAULT_PLUGIN_COMMAND_DIR "${PLUGINS_OUTPUT_PATH}/command")
- ENDIF(NOT DEFINED DEFAULT_PLUGIN_COMMAND_DIR)
- IF(NOT DEFINED DEFAULT_PLUGIN_ROUTING_DIR)
- SET(DEFAULT_PLUGIN_ROUTING_DIR "${PLUGINS_OUTPUT_PATH}/routing")
- ENDIF(NOT DEFINED DEFAULT_PLUGIN_ROUTING_DIR)
- IF(NOT DEFINED CONTROLLER_PLUGIN)
- SET(CONTROLLER_PLUGIN "${PLUGINS_OUTPUT_PATH}/control/libPluginControlInterface.so")
- ENDIF(NOT DEFINED CONTROLLER_PLUGIN)
+ if(NOT DEFINED DEFAULT_PLUGIN_COMMAND_DIR)
+ set(DEFAULT_PLUGIN_COMMAND_DIR "${PLUGINS_OUTPUT_PATH}/command")
+ endif(NOT DEFINED DEFAULT_PLUGIN_COMMAND_DIR)
+ if(NOT DEFINED DEFAULT_PLUGIN_ROUTING_DIR)
+ set(DEFAULT_PLUGIN_ROUTING_DIR "${PLUGINS_OUTPUT_PATH}/routing")
+ endif(NOT DEFINED DEFAULT_PLUGIN_ROUTING_DIR)
+ if(NOT DEFINED CONTROLLER_PLUGIN)
+ set(CONTROLLER_PLUGIN "${PLUGINS_OUTPUT_PATH}/control/libPluginControlInterface.so")
+ endif(NOT DEFINED CONTROLLER_PLUGIN)
else(USE_BUILD_LIBS)
- IF(NOT DEFINED DEFAULT_PLUGIN_COMMAND_DIR)
- SET(DEFAULT_PLUGIN_COMMAND_DIR "${CMAKE_INSTALL_PREFIX}/lib/${LIB_INSTALL_SUFFIX}/command")
- ENDIF(NOT DEFINED DEFAULT_PLUGIN_COMMAND_DIR)
- IF(NOT DEFINED DEFAULT_PLUGIN_ROUTING_DIR)
- SET(DEFAULT_PLUGIN_ROUTING_DIR "${CMAKE_INSTALL_PREFIX}/lib/${LIB_INSTALL_SUFFIX}/routing")
- ENDIF(NOT DEFINED DEFAULT_PLUGIN_ROUTING_DIR)
- IF(NOT DEFINED CONTROLLER_PLUGIN)
- SET(CONTROLLER_PLUGIN "${CMAKE_INSTALL_PREFIX}/lib/${LIB_INSTALL_SUFFIX}/control/libPluginControlInterface.so")
- ENDIF(NOT DEFINED CONTROLLER_PLUGIN)
+ if(NOT DEFINED DEFAULT_PLUGIN_COMMAND_DIR)
+ set(DEFAULT_PLUGIN_COMMAND_DIR "${CMAKE_INSTALL_PREFIX}/lib/${LIB_INSTALL_SUFFIX}/command")
+ endif(NOT DEFINED DEFAULT_PLUGIN_COMMAND_DIR)
+ if(NOT DEFINED DEFAULT_PLUGIN_ROUTING_DIR)
+ set(DEFAULT_PLUGIN_ROUTING_DIR "${CMAKE_INSTALL_PREFIX}/lib/${LIB_INSTALL_SUFFIX}/routing")
+ endif(NOT DEFINED DEFAULT_PLUGIN_ROUTING_DIR)
+ if(NOT DEFINED CONTROLLER_PLUGIN)
+ set(CONTROLLER_PLUGIN "${CMAKE_INSTALL_PREFIX}/lib/${LIB_INSTALL_SUFFIX}/control/libPluginControlInterface.so")
+ endif(NOT DEFINED CONTROLLER_PLUGIN)
endif(USE_BUILD_LIBS)
-IF(EXISTS "ProjectSpecific/")
- SET(PROJECT_INCLUDE_FOLDER ${CMAKE_SOURCE_DIR}/ProjectSpecific/include)
-endif(EXISTS "ProjectSpecific/")
-
-SET(PROJECT_INCLUDE_FOLDER ${PROJECT_INCLUDE_FOLDER} ${CMAKE_BINARY_DIR}/include)
+configure_file( ${CMAKE_SOURCE_DIR}/AudioManagerDaemon/docx/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/DoxyFile )
+configure_file( ${CMAKE_SOURCE_DIR}/cmake/config.cmake.in ${CMAKE_BINARY_DIR}/include/config.h )
-SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
-SET(AUDIO_INCLUDE_FOLDER ${CMAKE_SOURCE_DIR}/include)
-SET(DOC_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/doc)
-SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/bin)
-SET(TEST_EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/bin/test)
-SET(DOXY_PROTOTYPE ${CMAKE_SOURCE_DIR}/cmake/DoxyFile.in)
-SET(DOXY_FILE ${CMAKE_CURRENT_BINARY_DIR}/DoxyFile)
-
-CONFIGURE_FILE( ${CMAKE_SOURCE_DIR}/AudioManagerDaemon/docx/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/DoxyFile )
-
-IF(WITH_DLT)
+if (WITH_ENABLED_IPC STREQUAL "NONE")
+ set (ENABLE_NSM OFF)
+else ()
+ set (ENABLE_NSM ON)
+endif ()
+
+if (NOT WITH_DBUS_WRAPPER AND NOT WITH_CAPI_WRAPPER)
+ set (WITH_NSM OFF)
+endif (NOT WITH_DBUS_WRAPPER AND NOT WITH_CAPI_WRAPPER)
+
+if(WITH_NSM AND WITH_DBUS_WRAPPER)
+ if(USE_BUILD_LIBS)
+ set(NSM_INTROSPECTION_FILE ${EXECUTABLE_OUTPUT_PATH}/bin/LifeCycleConsumer.xml)
+ execute_process(
+ COMMAND mkdir -p "${CMAKE_CURRENT_BINARY_DIR}/bin"
+ COMMAND cp "${CMAKE_SOURCE_DIR}/Foo/LifecycleConsumer.xml" ${NSM_INTROSPECTION_FILE})
+ else(USE_BUILD_LIBS)
+ set(NSM_INTROSPECTION_FILE ${AM_SHARE_FOLDER}/LifecycleConsumer.xml)
+ INSTALL(
+ FILES ${CMAKE_SOURCE_DIR}/Foo/LifecycleConsumer.xml
+ DESTINATION "${NSM_INTROSPECTION_FILE}"
+ COMPONENT bin)
+ endif(USE_BUILD_LIBS)
+endif(WITH_NSM AND WITH_DBUS_WRAPPER)
+
+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)
+endif(WITH_DLT)
-IF(WITH_TESTS)
+if(WITH_TESTS)
add_subdirectory(googleMock)
set(GMOCK_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/googleMock/include")
set(GOOGLE_TEST_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/googleMock/gtest/include")
-ENDIF(WITH_TESTS)
+endif(WITH_TESTS)
##global build flags set(CPACK_RPM_COMPONENT_INSTALL ON)
-set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -Wextra -std=gnu++0x -D_GNU_SOURCE -pedantic -Wno-variadic-macros -Wno-long-long -Wno-unused-parameter")
-#set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -Wextra -std=c++98 -D_GNU_SOURCE")
-
-SET(AM_SHARE_FOLDER ${CMAKE_INSTALL_PREFIX}/share/audiomanager)
-
-IF(EXISTS "${CMAKE_SOURCE_DIR}/ProjectSpecific/")
- add_subdirectory (ProjectSpecific)
-endif(EXISTS "${CMAKE_SOURCE_DIR}/ProjectSpecific/")
-
-if(WITH_PLUGIN_COMMAND)
- if(WITH_DBUS_WRAPPER)
- add_subdirectory (PluginCommandInterfaceDbus)
- elseif(WITH_CAPI_WRAPPER)
- add_subdirectory (PluginCommandInterfaceCAPI)
- endif()
-endif(WITH_PLUGIN_COMMAND)
-
-if(WITH_PLUGIN_ROUTING)
- add_subdirectory (PluginRoutingInterfaceAsync)
- if(WITH_DBUS_WRAPPER)
- add_subdirectory (PluginRoutingInterfaceDbus)
- elseif(WITH_CAPI_WRAPPER)
- add_subdirectory (PluginRoutingInterfaceCAPI)
- endif()
-endif(WITH_PLUGIN_ROUTING)
-
-if(WITH_PLUGIN_CONTROL)
- add_subdirectory (PluginControlInterface)
-endif(WITH_PLUGIN_CONTROL)
-
+set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x -D_GNU_SOURCE -pedantic -rdynamic -Wno-variadic-macros")
+set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -g -Wall -Wextra -std=gnu++0x -D_GNU_SOURCE -pedantic -rdynamic -Wno-long-long -Wno-unused-parameter")
+set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -O2 -fno-common -rdynamic -std=gnu++0x -fno-strict-aliasing -DNDEBUG")
+
+configure_package_config_file (
+ ${CMAKE_MODULE_PATH}/audiomanagerConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/audiomanagerConfig.cmake
+ INSTALL_DESTINATION lib/${LIB_INSTALL_SUFFIX}/cmake
+ PATH_VARS AUDIO_INCLUDE_FOLDER )
+
+write_basic_package_version_file(
+ ${CMAKE_CURRENT_BINARY_DIR}/AudioManagerVersion.cmake
+ VERSION ${DAEMONVERSION}
+ COMPATIBILITY SameMajorVersion )
+
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/audiomanagerConfig.cmake
+ DESTINATION lib/${LIB_INSTALL_SUFFIX}/cmake
+ COMPONENT dev)
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/include/config.h
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/${LIB_INSTALL_SUFFIX}
+ COMPONENT dev)
add_subdirectory (AudioManagerDaemon)
-# uninstall target
-configure_file(
- "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
- "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
- IMMEDIATE @ONLY)
+if(EXISTS "${CMAKE_SOURCE_DIR}/Plugins/")
+ add_subdirectory (${CMAKE_SOURCE_DIR}/Plugins)
+endif(EXISTS "${CMAKE_SOURCE_DIR}/Plugins/")
-add_custom_target(uninstall
- COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
-
- IF(WITH_DOCUMENTATION)
+
+if(WITH_DOCUMENTATION)
find_package(Doxygen)
configure_file(${DOXY_FILE} ${DOC_OUTPUT_PATH}/Doxyfile @ONLY IMMEDIATE)
configure_file("README.html" ${DOC_OUTPUT_PATH}/html/README.html)
@@ -273,106 +244,24 @@ add_custom_target(uninstall
COMMAND ${DOXYGEN_EXECUTABLE} ${DOC_OUTPUT_PATH}/Doxyfile WORKING_DIRECTORY ${DOC_OUTPUT_PATH}
SOURCES ${CMAKE_SOURCE_DIR} ${DOC_OUTPUT_PATH}/Doxyfile
)
-ENDIF(WITH_DOCUMENTATION)
-
-# Here starts package creation
-SET(CPACK_SET_DESTDIR ON)
-SET(CPACK_OUTPUT_FILE_PREFIX ${CMAKE_SOURCE_DIR}/packages)
-SET(CPACK_GENERATOR "DEB")
-SET(CPACK_PACKAGE_NAME "AudioManager")
-SET(CPACK_PACKAGE_VENDOR "GENIVI")
-SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "AudioManager: This component manages audio in the GENIVI context")
-SET(CPACK_PACKAGE_VERSION "${DAEMONVERSION}")
-SET(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/LICENCE)
-SET(CPACK_RESOURCE_FILE_README ${CMAKE_SOURCE_DIR}/README)
-SET(CPACK_PACKAGE_CONTACT "Christian Linke(BMW) christian.linke@bmw.de")
-SET(CPACK_PACKAGE_INSTALL_DIRECTORY "genivi")
-SET(CPACK_DEBIAN_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR})
-SET(CPACK_DEBIAN_PACKAGE_DEPENDS "*")
-SET(CPACK_STRIP_FILES TRUE)
-SET(CPACK_PACKAGE_DESCRIPTION_FILE ${CMAKE_SOURCE_DIR}/README)
-SET(CPACK_SOURCE_GENERATOR "TGZ")
-SET(CPACK_SOURCE_IGNORE_FILES ".settings*" ".cproject" "/\\\\.metadata" "\\\\.#" "/#" ".*~" "/\\\\.git" "${CMAKE_CURRENT_BINARY_DIR}" "bin/" "packages/" "config.h")
-
-IF(WITH_TESTS)
- get_property(ADD_DEPEND GLOBAL PROPERTY tests_prop)
- list(REMOVE_DUPLICATES ADD_DEPEND)
- list(APPEND ALL_DEPEND ${ADD_DEPEND})
- FOREACH (dep ${ADD_DEPEND})
- SET(tests_DEPENDENCIES "${dep} ,${tests_DEPENDENCIES}")
- ENDFOREACH(dep)
- STRING(REGEX REPLACE ".$" "" tests_DEPENDENCIES ${tests_DEPENDENCIES})
-ENDIF(WITH_TESTS)
-
-#evaluate the properties
-if(WITH_MAIN)
-get_property(ADD_DEPEND GLOBAL PROPERTY bin_prop)
-list(REMOVE_DUPLICATES ADD_DEPEND)
-set(ALL_DEPEND ${ADD_DEPEND})
-FOREACH (dep ${ADD_DEPEND})
- SET(bin_DEPENDENCIES "${dep} ,${bin_DEPENDENCIES}")
-ENDFOREACH(dep)
-STRING(REGEX REPLACE ".$" "" bin_DEPENDENCIES ${bin_DEPENDENCIES})
-endif(WITH_MAIN)
-
-if(WITH_PLUGIN_COMMAND OR WITH_PLUGIN_CONTROL OR WITH_PLUGIN_ROUTING)
-get_property(ADD_DEPEND GLOBAL PROPERTY sampleplugins_prop)
-list(REMOVE_DUPLICATES ADD_DEPEND)
-list(APPEND ALL_DEPEND ${ADD_DEPEND})
-FOREACH (dep ${ADD_DEPEND})
- SET(sampleplugins_DEPENDENCIES "${dep} ,${sampleplugins_DEPENDENCIES}")
-ENDFOREACH(dep)
-STRING(REGEX REPLACE ".$" "" sampleplugins_DEPENDENCIES ${sampleplugins_DEPENDENCIES})
-endif(WITH_PLUGIN_COMMAND OR WITH_PLUGIN_CONTROL OR WITH_PLUGIN_ROUTING)
-
-get_property(ADD_DEPEND GLOBAL PROPERTY dev_prop)
-list(REMOVE_DUPLICATES ADD_DEPEND)
-list(APPEND ALL_DEPEND ${ADD_DEPEND})
-FOREACH (dep ${ADD_DEPEND})
- SET(dev_DEPENDENCIES "${dep} ,${dev_DEPENDENCIES}")
-ENDFOREACH(dep)
-STRING(REGEX REPLACE ".$" "" dev_DEPENDENCIES ${dev_DEPENDENCIES})
-
-list(REMOVE_DUPLICATES ALL_DEPEND)
-list(REMOVE_ITEM ALL_DEPEND "audiomanager-bin")
-FOREACH (dep ${ALL_DEPEND})
- SET(all_DEPENDENCIES "${dep} ,${all_DEPENDENCIES}")
-ENDFOREACH(dep)
-STRING(REGEX REPLACE ".$" "" all_DEPENDENCIES ${all_DEPENDENCIES})
-execute_process(COMMAND cp ${CMAKE_MODULE_PATH}/add_package_dependencies.sh ${CMAKE_CURRENT_BINARY_DIR})
-
-#component based dep package generation is only supported above 2.8.5
-IF (${CMAKE_VERSION} VERSION_GREATER 2.8.5)
-
- SET(CPACK_COMPONENTS_ALL bin sampleplugins tests dev)
- SET(CPACK_COMPONENTS_IGNORE_GROUPS 1)
- SET(CPACK_DEB_COMPONENT_INSTALL ON)
- ADD_CUSTOM_TARGET(genivi_package
- COMMAND ${CMAKE_COMMAND} ${CMAKE_BINARY_DIR} -DUSE_BUILD_LIBS=OFF
- COMMAND make package
- COMMAND ${CMAKE_CURRENT_BINARY_DIR}/add_package_dependencies.sh ${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-Linux-bin.deb ${CPACK_OUTPUT_FILE_PREFIX} \"${bin_DEPENDENCIES}\"
- COMMAND ${CMAKE_CURRENT_BINARY_DIR}/add_package_dependencies.sh ${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-Linux-sampleplugins.deb ${CPACK_OUTPUT_FILE_PREFIX} \"${sampleplugins_DEPENDENCIES}\"
- COMMAND ${CMAKE_CURRENT_BINARY_DIR}/add_package_dependencies.sh ${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-Linux-tests.deb ${CPACK_OUTPUT_FILE_PREFIX} \"${tests_DEPENDENCIES}\"
- COMMAND ${CMAKE_CURRENT_BINARY_DIR}/add_package_dependencies.sh ${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-Linux-dev.deb ${CPACK_OUTPUT_FILE_PREFIX} \"${dev_DEPENDENCIES}\"
- )
-ELSE (${CMAKE_VERSION} VERSION_GREATER 2.8.5)
- IF(${CMAKE_VERSION} VERSION_GREATER 2.8.3)
- ADD_CUSTOM_TARGET(genivi_package
- COMMAND ${CMAKE_COMMAND} ${CMAKE_BINARY_DIR} -DUSE_BUILD_LIBS=OFF
- COMMAND make package
- COMMAND ${CMAKE_CURRENT_BINARY_DIR}A logical block opening on t/add_package_dependencies.sh ${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-Linux.deb ${CPACK_OUTPUT_FILE_PREFIX} \"${all_DEPENDENCIES}\"
- )
- ELSE(${CMAKE_VERSION} VERSION_GREATER 2.8.3)
- ADD_CUSTOM_TARGET(genivi_package
- COMMAND ${CMAKE_COMMAND} ${CMAKE_BINARY_DIR} -DUSE_BUILD_LIBS=OFF
- COMMAND make package
- COMMAND mkdir -p ../${CPACK_OUTPUT_FILE_PREFIX}
- COMMAND mv ${CMAKE_CURRENT_BINARY_DIR}/${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-Linux.deb ${CPACK_OUTPUT_FILE_PREFIX}
- COMMAND ${CMAKE_CURRENT_BINARY_DIR}/add_package_dependencies.sh ${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-Linux.deb ${CPACK_OUTPUT_FILE_PREFIX} \"${all_DEPENDENCIES}\"
- )
- ENDIF(${CMAKE_VERSION} VERSION_GREATER 2.8.3)
-ENDIF (${CMAKE_VERSION} VERSION_GREATER 2.8.5)
-
-INCLUDE(CPack)
-
-
+endif(WITH_DOCUMENTATION)
+
+SET(CMAKE_INSTALL_CONFIG_NAME "RelWithDebInfo")
+
+add_custom_target(bin-install
+ COMMAND
+ "${CMAKE_COMMAND}" -DCMAKE_INSTALL_COMPONENT=bin
+ -P "${CMAKE_BINARY_DIR}/cmake_install.cmake"
+)
+
+add_custom_target(dev-install
+ COMMAND
+ "${CMAKE_COMMAND}" -DCMAKE_INSTALL_COMPONENT=dev
+ -P "${CMAKE_BINARY_DIR}/cmake_install.cmake"
+)
+
+add_custom_target(test-install
+ COMMAND
+ "${CMAKE_COMMAND}" -DCMAKE_INSTALL_COMPONENT=tests
+ -P "${CMAKE_BINARY_DIR}/cmake_install.cmake"
+)
diff --git a/cmake/AudioManagerCodestyle.xml b/Foo/AudioManagerCodestyle.xml
index 0ecdb53..0ecdb53 100644
--- a/cmake/AudioManagerCodestyle.xml
+++ b/Foo/AudioManagerCodestyle.xml
diff --git a/cmake/EA_Code_GEN_templates_AM_v6.xml b/Foo/EA_Code_GEN_templates_AM_v6.xml
index 51d6b25..51d6b25 100755
--- a/cmake/EA_Code_GEN_templates_AM_v6.xml
+++ b/Foo/EA_Code_GEN_templates_AM_v6.xml
diff --git a/cmake/LifecycleConsumer.xml b/Foo/LifecycleConsumer.xml
index ec1162b..ec1162b 100644
--- a/cmake/LifecycleConsumer.xml
+++ b/Foo/LifecycleConsumer.xml
diff --git a/cmake/genivi.audiomanager.service b/Foo/genivi.audiomanager.service
index a543fe7..d280914 100644
--- a/cmake/genivi.audiomanager.service
+++ b/Foo/genivi.audiomanager.service
@@ -10,7 +10,7 @@
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
# this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
-# author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
+# author Christian Linke, christian.linke@bmw.de BMW 2011,2012
#
# For further information see http://www.genivi.org/.
#
diff --git a/PluginCommandInterfaceCAPI/CMakeLists.txt b/PluginCommandInterfaceCAPI/CMakeLists.txt
deleted file mode 100644
index 50224d4..0000000
--- a/PluginCommandInterfaceCAPI/CMakeLists.txt
+++ /dev/null
@@ -1,104 +0,0 @@
-# Copyright (c) 2012 GENIVI Alliance
-# Copyright (c) 2012 BMW
-#
-# 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/.
-#
-
-cmake_minimum_required(VERSION 2.6)
-include(CMakeDependentOption)
-
-PROJECT(PluginCommandInterfaceCAPI)
-
-OPTION (WITH_COMMAND_INTERFACE_COMMON_CAPI
- "build with commandinterface common-api plugin" ON )
-
-IF (WITH_COMMAND_INTERFACE_COMMON_CAPI AND WITH_CAPI_WRAPPER)
-
-set(LIBRARY_OUTPUT_PATH ${PLUGINS_OUTPUT_PATH}/command)
-
-set(DOC_OUTPUT_PATH ${DOC_OUTPUT_PATH}/CommandCAPIPlugin)
-set(INCLUDE_FOLDER "include")
-message(STATUS "prefix ${CMAKE_INSTALL_PREFIX}")
-SET(SHARED_FOLDER "${CMAKE_INSTALL_PREFIX}/share")
-
-FILE(READ "${AUDIO_INCLUDE_FOLDER}/command/IAmCommandSend.h" VERSION_BUFFER LIMIT 6000)
-STRING(REGEX MATCH "CommandSendVersion*.[^0-9]*[0-9].[0-9]*[0-9]" LIB_INTERFACE_VERSION_STRING ${VERSION_BUFFER})
-STRING(REGEX REPLACE "CommandSendVersion*.." "" LIB_INTERFACE_VERSION ${LIB_INTERFACE_VERSION_STRING})
-MESSAGE(STATUS "Building against command interface version ${LIB_INTERFACE_VERSION}")
-
-INSERT_DBUS_CONF_IF_NEEDED("@COMMAND_INTERFACE_DBUS_CONF@"
- "${CMAKE_CURRENT_SOURCE_DIR}/fidl/PluginCommandInterfaceCAPI_dbus.conf"
- COMMAND_INTERFACE_DBUS_CONF)
-set(COMMAND_INTERFACE_DBUS_CONF ${COMMAND_INTERFACE_DBUS_CONF} PARENT_SCOPE)
-
-CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/config.cmake ${CMAKE_CURRENT_SOURCE_DIR}/include/configCommandCAPI.h )
-
-FIND_PACKAGE(CommonAPI REQUIRED)
-
-# Find the common-api sources.
-# The sources can be placed in the build directory (DESTINATION) or in the source tree (ALT_DESTINATION).
-# The ALT_DESTINATION is used as fall back if the DESTINATION directory dosen't contain the sources or you just don't want to use the generator.
-INCLUDE(CommonAPIGenerator)
-COMMON_API_GENERATE_SOUCRES(TARGET COMMON_API_COMMAND_INTERFACE
- FIDLS fidl/CommandInterface.fidl # a list with fidls
- DESTINATION src-gen # a relative path to the build directory or an absolute path
- ALT_DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/src-gen # an alternative relative/absolute path with common-api sources, usually in the source tree
- DBUS)
-
-INCLUDE_DIRECTORIES(
- ${CMAKE_SOURCE_DIR}
- ${CMAKE_CURRENT_BINARY_DIR}
- ${AUDIO_INCLUDE_FOLDER}
- ${PROJECT_INCLUDE_FOLDER}
- ${DLT_INCLUDE_DIRS}
- ${COMMON_API_INCLUDE_DIRS}
- ${COMMON_API_DBUS_INCLUDE_DIRS}
- ${COMMON_API_COMMAND_INTERFACE_GEN_INCLUDE_DIR}
- ${INCLUDE_FOLDER}
-)
-
-# all source files go here
-file(GLOB PLUGINCAPI_SRCS_CXX "src/*.cpp" ${COMMON_API_COMMAND_INTERFACE_GEN_SOURCES})
-
-add_library(PluginCommandInterfaceCAPI MODULE ${PLUGINCAPI_SRCS_CXX})
-
-TARGET_LINK_LIBRARIES(PluginCommandInterfaceCAPI
- ${DLT_LIBRARIES}
- ${COMMON_API_LIBRARIES}
- ${COMMON_API_DBUS_LIBRARIES}
-)
-
-IF(WITH_TESTS)
- add_subdirectory (test)
-ENDIF(WITH_TESTS)
-
-#IF(WITH_DOCUMENTATION)
-# file(MAKE_DIRECTORY ${DOC_OUTPUT_PATH})
-# configure_file(${DOXY_FILE} ${DOC_OUTPUT_PATH}/Doxyfile @ONLY IMMEDIATE)
-# add_custom_target (PluginInterfaceDBusDocs ALL
-# COMMAND ${DOXYGEN_EXECUTABLE} ${DOC_OUTPUT_PATH}/Doxyfile WORKING_DIRECTORY ${DOC_OUTPUT_PATH}
-# SOURCES ${PROJECT_BINARY_DIR} ${DOC_OUTPUT_PATH}/Doxyfile
-# )
-#ENDIF(WITH_DOCUMENTATION)
-
-INSTALL(TARGETS PluginCommandInterfaceCAPI
- DESTINATION "lib/${LIB_INSTALL_SUFFIX}/command"
- PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
- COMPONENT sampleplugins
-)
-
-SET(ADD_DEPEND "audiomanager-bin" "dlt")
-set_property(GLOBAL APPEND PROPERTY sampleplugins_prop "${ADD_DEPEND}")
-
-ENDIF (WITH_COMMAND_INTERFACE_COMMON_CAPI AND WITH_CAPI_WRAPPER)
diff --git a/PluginCommandInterfaceCAPI/cmake/config.cmake b/PluginCommandInterfaceCAPI/cmake/config.cmake
deleted file mode 100644
index 8bd2faa..0000000
--- a/PluginCommandInterfaceCAPI/cmake/config.cmake
+++ /dev/null
@@ -1,4 +0,0 @@
-#ifndef _COMMANDCAPI_CONFIG_H
-#define _COMMANDCAPI_CONFIG_H
-
-#endif /* _COMMANDCAPI_CONFIG_H */
diff --git a/PluginCommandInterfaceCAPI/fidl/CommandInterface.fidl b/PluginCommandInterfaceCAPI/fidl/CommandInterface.fidl
deleted file mode 100755
index b956de9..0000000
--- a/PluginCommandInterfaceCAPI/fidl/CommandInterface.fidl
+++ /dev/null
@@ -1,607 +0,0 @@
-package org.genivi.am
-import org.genivi.am.* from "../../AudioManagerDaemon/fidls/AudioManagerTypes.fidl"
-
-
-<**
- @description : The interface towards the Controlling Instance (e.g HMI). It handles the communication towards the HMI and other system components who need to interact with the audiomanagement.
-There are two rules that have to be kept in mind when implementing against this interface:
- @author : Christian Mueller
-**>
-
-interface CommandControl {
- version {
- major 2
- minor 0
- }
-
- <**
- @description : connects a source to sink
-(at)return E_OK on success, E_NOT_POSSIBLE on failure, E_ALREADY_EXISTS if the connection does already exists
- **>
- method connect {
- in {
- am_sourceID_t sourceID
- am_sinkID_t sinkID
- }
- out {
- am_mainConnectionID_t mainConnectionID
- am_Error_e ^error
- }
- }
-
- <**
- @description : disconnects a mainConnection
-(at)return E_OK on successes, E_NON_EXISTENT if the connection does not exist, E_NOT_POSSIBLE on error.
- **>
- method disconnect {
- in {
- am_mainConnectionID_t mainConnectionID
- }
- out {
- am_Error_e ^error
- }
- }
-
- <**
- @description : sets the volume for a sink
-(at)return E_OK on success, E_UNKOWN on error, E_OUT_OF_RANGE in case the value is out of range
- **>
- method setVolume {
- in {
-
- <**
- @description : the sink
- **>
- am_sinkID_t sinkID
-
- <**
- @description : the volume
- **>
- am_mainVolume_t volume
- }
- out {
- am_Error_e ^error
- }
- }
-
- <**
- @description : This function is used to increment or decrement the current volume for a sink.
-(at)return E_OK on success, E_UNKNOWN on error and E_OUT_OF_RANGE if the value is not in the given volume range.
- **>
- method volumeStep {
- in {
- am_sinkID_t sinkID
-
- <**
- @description : indicated the number of steps that should be incremented or decremented. Positive values here inkrement, negative values decrement
- **>
- Int16 volStep
- }
- out {
- am_Error_e ^error
- }
- }
-
- <**
- @description : sets the mute state of a sink
-(at)return E_OK on success, E_UNKNOWN on error. If the mute state is already the desired one, the Daemon will return E_OK.
- **>
- method setSinkMuteState {
- in {
- am_sinkID_t sinkID
- am_MuteState_e muteState
- }
- out {
- am_Error_e ^error
- }
- }
-
- <**
- @description : This method is used to set sound properties, e.g. Equalizer Values. Since the capabilities of the system can differ, the exact key value pairs can be extended in each product
-(at)return E_OK on success, E_OUT_OF_RANGE if value exceeds range, E_UNKNOWN in case of an error
- **>
- method setMainSinkSoundProperty {
- in {
- am_sinkID_t sinkID
- am_MainSoundProperty_s soundProperty
- }
- out {
- am_Error_e ^error
- }
- }
-
- <**
- @description : This method is used to set sound properties, e.g. Equalizer Values. Since the capabilities of the system can differ, the exact key value pairs can be extended in each product
-(at)return E_OK on success, E_OUT_OF_RANGE if value exceeds range, E_UNKNOWN in case of an error
- **>
- method setMainSourceSoundProperty {
- in {
- am_sourceID_t sourceID
- am_MainSoundProperty_s soundProperty
- }
- out {
- am_Error_e ^error
- }
- }
-
- <**
- @description : is used to set a specific system property.
-(at)return E_OK on success, E_OUT_OF_RANGE if value exceeds range, E_UNKNOWN in case of an error
- **>
- method setSystemProperty {
- in {
-
- <**
- @description : the property that shall be set
- **>
- am_SystemProperty_s property
- }
- out {
- am_Error_e ^error
- }
- }
-
- <**
- @description : returns the actual list of MainConnections
-(at)return E_OK on success, E_DATABASE_ERROR on error
- **>
- method getListMainConnections {
- out {
-
- <**
- @description : returns a list of all connections
- **>
- am_MainConnection_L listConnections
- am_Error_e ^error
- }
- }
-
- <**
- @description : returns the actual list of Sinks
-(at)return E_OK on success, E_DATABASE_ERROR on error
- **>
- method getListMainSinks {
- out {
-
- <**
- @description : the list of the sinks
- **>
- am_SinkType_L listMainSinks
- am_Error_e ^error
- }
- }
-
- <**
- @description : returns the actual list of Sources
-(at)return E_OK on success, E_DATABASE_ERROR on error
- **>
- method getListMainSources {
- out {
-
- <**
- @description : the list of sources
- **>
- am_SourceType_L listMainSources
- am_Error_e ^error
- }
- }
-
- <**
- @description : This is used to retrieve all source sound properties related to a source. Returns a vector of the sound properties and values as pair
-(at)return E_OK on success, E_DATABASE_ERROR on error
- **>
- method getListMainSinkSoundProperties {
- in {
- am_sinkID_t sinkID
- }
- out {
- am_MainSoundProperty_L listSoundProperties
- am_Error_e ^error
- }
- }
-
- <**
- @description : This is used to retrieve all source sound properties related to a source.
-(at)return E_OK on success, E_DATABASE_ERROR on error
- **>
- method getListMainSourceSoundProperties {
- in {
- am_sourceID_t sourceID
- }
- out {
- am_MainSoundProperty_L listSourceProperties
- am_Error_e ^error
- }
- }
-
- <**
- @description : This is used to retrieve SourceClass Information of all source classes
-(at)return E_OK on success, E_DATABASE_ERROR on error
- **>
- method getListSourceClasses {
- out {
- am_SourceClass_L listSourceClasses
- am_Error_e ^error
- }
- }
-
- <**
- @description : This is used to retrieve SinkClass Information of all sink classes
-(at)return E_OK on success, E_DATABASE_ERROR on error
- **>
- method getListSinkClasses {
- out {
- am_SinkClass_L listSinkClasses
- am_Error_e ^error
- }
- }
-
- <**
- @description : Retrieves a complete list of all systemProperties.
-(at)return E_OK on success, E_DATABASE_ERROR on error
- **>
- method getListSystemProperties {
- out {
- am_SystemProperty_L listSystemProperties
- am_Error_e ^error
- }
- }
-
- <**
- @description : returns the delay in ms that the audiopath for the given mainConnection has
-(at)return E_OK on success, E_NOT_POSSIBLE if timing information is not yet retrieved, E_DATABASE_ERROR on read error on the database
- **>
- method getTimingInformation {
- in {
- am_mainConnectionID_t mainConnectionID
- }
- out {
- am_timeSync_t delay
- am_Error_e ^error
- }
- }
-
- <**
- @description : Retrieves the list of MainNotifications for a sink. Does not return the possible ones.
- **>
- method getListMainSinkNotificationConfigurations {
- in {
-
- <**
- @description : The sinkID
- **>
- am_sinkID_t sinkID
- }
- out {
- am_NotificationConfiguration_L listMainNotificationConfigurations
- am_Error_e ^error
- }
- }
-
- <**
- @description : Retrieves the list of MainNotifications for a source. Does not return the possible ones.
- **>
- method getListMainSourceNotificationConfigurations {
- in {
-
- <**
- @description : The sourceID
- **>
- am_sourceID_t sourceID
- }
- out {
- am_NotificationConfiguration_L listMainNotificationConfigurations
- am_Error_e ^error
- }
- }
-
- <**
- @description : sets a MainNotificationConfiuration. This can be used to turn on an off notifications an to change the mode of the configuration.
-(at)return E_OK on success, E_NON_EXISTENT if sinkID does not exists, E_DATABASE_ERROR on error
- **>
- method setMainSinkNotificationConfiguration {
- in {
-
- <**
- @description : The sinkID of the MainNotification to be changed
- **>
- am_sinkID_t sinkID
-
- <**
- @description : The MainNotifiication that needs to be set
- **>
- am_NotificationConfiguration_s mainNotificationConfiguration
- }
- out {
- am_Error_e ^error
- }
- }
-
- <**
- @description : sets a MainNotificationConfiuration. This can be used to turn on an off notifications an to change the mode of the configuration.
-(at)return E_OK on success, E_NON_EXISTENT if sourceID does not exists, E_DATABASE_ERROR on error
- **>
- method setMainSourceNotificationConfiguration {
- in {
-
- <**
- @description : The sourceID of the MainNotification to be changed
- **>
- am_sourceID_t sourceID
-
- <**
- @description : The MainNotifiication that needs to be set
- **>
- am_NotificationConfiguration_s mainNotificationConfiguration
- }
- out {
- am_Error_e ^error
- }
- }
-
- <**
- @description : Callback that is called when the number of connections change
- **>
- broadcast newMainConnection {
- out {
- am_MainConnectionType_s mainConnection
- }
- }
-
- <**
- @description : Callback that is called when the number of connections change
- **>
- broadcast removedMainConnection {
- out {
- am_mainConnectionID_t mainConnection
- }
- }
-
- <**
- @description : Callback that is called when the number of sinks change
- **>
- broadcast newSink {
- out {
- am_SinkType_s sink
- }
- }
-
- <**
- @description : Callback that is called when the number of sinks change
- **>
- broadcast removedSink {
- out {
- am_sinkID_t sinkID
- }
- }
-
- <**
- @description : Callback that is called when the number of sources change
- **>
- broadcast newSource {
- out {
- am_SourceType_s source
- }
- }
-
- <**
- @description : Callback that is called when the number of sources change
- **>
- broadcast removedSource {
- out {
- am_sourceID_t source
- }
- }
-
- <**
- @description : this callback is fired if the number of sink classes changed
- **>
- broadcast numberOfSinkClassesChanged {
- }
-
- <**
- @description : this callback is fired if the number of source classes changed
- **>
- broadcast numberOfSourceClassesChanged {
- }
-
- <**
- @description : This callback is called when the ConnectionState of a connection changed.
- **>
- broadcast mainConnectionStateChanged {
- out {
- am_mainConnectionID_t connectionID
- am_ConnectionState_e connectionState
- }
- }
-
- <**
- @description : this callback indicates that a sinkSoundProperty has changed.
- **>
- broadcast mainSinkSoundPropertyChanged {
- out {
- am_sinkID_t sinkID
- am_MainSoundProperty_s soundProperty
- }
- }
-
- <**
- @description : this callback indicates that a sourceSoundProperty has changed.
- **>
- broadcast mainSourceSoundPropertyChanged {
- out {
- am_sourceID_t sourceID
- am_MainSoundProperty_s soundProperty
- }
- }
-
- <**
- @description : this callback is called when the availability of a sink has changed
- **>
- broadcast sinkAvailabilityChanged {
- out {
- am_sinkID_t sinkID
- am_Availability_s availability
- }
- }
-
- <**
- @description : this callback is called when the availability of source has changed.
- **>
- broadcast sourceAvailabilityChanged {
- out {
- am_sourceID_t sourceID
- am_Availability_s availability
- }
- }
-
- <**
- @description : this callback indicates a volume change on the indicated sink
- **>
- broadcast volumeChanged {
- out {
- am_sinkID_t sinkID
- am_mainVolume_t volume
- }
- }
-
- <**
- @description : this callback indicates a mute state change on a sink.
- **>
- broadcast sinkMuteStateChanged {
- out {
- am_sinkID_t sinkID
- am_MuteState_e muteState
- }
- }
-
- <**
- @description : is fired if a systemProperty changed
- **>
- broadcast systemPropertyChanged {
- out {
- am_SystemProperty_s systemProperty
- }
- }
-
- <**
- @description : This callback is fired if the timinginformation for a mainConnectionID changed
- **>
- broadcast timingInformationChanged {
- out {
- am_mainConnectionID_t mainConnectionID
- am_timeSync_t time
- }
- }
-
- <**
- @description : This callback is called when a sink is updated.
- **>
- broadcast sinkUpdated {
- out {
-
- <**
- @description : The sinkID that is updated
- **>
- am_sinkID_t sinkID
-
- <**
- @description : The sinkClassID of the updated sink. gives the current value even if not updated
- **>
- am_sinkClass_t sinkClassID
-
- <**
- @description : The list of mainSoundProperties. Gives the actual list of MainSoundProperties even if not changed
- **>
- am_MainSoundProperty_L listMainSoundProperties
- }
- }
-
- <**
- @description : This callback is called when a source is updated.
- **>
- broadcast sourceUpdated {
- out {
-
- <**
- @description : The sourceID that is updated
- **>
- am_sourceID_t sourceID
-
- <**
- @description : The sourceClassID of the updated source. Gives the current value even if not updated
- **>
- am_sourceClass_t sourceClassID
-
- <**
- @description : The list of mainSoundProperties. Gives the actual list of MainSoundProperties even if not changed
- **>
- am_MainSoundProperty_L listMainSoundProperties
- }
- }
-
- <**
- @description : This callback is called when a notificated value of a sink changes.
- **>
- broadcast sinkNotification {
- out {
-
- <**
- @description : The sinkID
- **>
- am_sinkID_t sinkID
-
- <**
- @description : The payload of the notification
- **>
- am_NotificationPayload_s notification
- }
- }
-
- <**
- @description : This callback is called when a notifcated value of a source changes.
- **>
- broadcast sourceNotification {
- out {
-
- <**
- @description : The sourceID
- **>
- am_sourceID_t sourceID
-
- <**
- @description : The payload of the notification
- **>
- am_NotificationPayload_s notification
- }
- }
-
- <**
- @description : This callback is triggered when a mainNotificationConfiguration is changed.
- **>
- broadcast mainSinkNotificationConfigurationChanged {
- out {
- am_sinkID_t sinkID
-
- <**
- @description : The MainNotificationConfiguration that changed
- **>
- am_NotificationConfiguration_s mainNotificationConfiguration
- }
- }
-
- <**
- @description : This callback is triggered when a mainNotificationConfiguration is changed.
- **>
- broadcast mainSourceNotificationConfigurationChanged {
- out {
- am_sourceID_t sourceID
-
- <**
- @description : The MainNotificationConfiguration that changed
- **>
- am_NotificationConfiguration_s mainNotificationConfiguration
- }
- }
-
-}
diff --git a/PluginCommandInterfaceCAPI/fidl/PluginCommandInterfaceCAPI_dbus.conf b/PluginCommandInterfaceCAPI/fidl/PluginCommandInterfaceCAPI_dbus.conf
deleted file mode 100644
index 00885f4..0000000
--- a/PluginCommandInterfaceCAPI/fidl/PluginCommandInterfaceCAPI_dbus.conf
+++ /dev/null
@@ -1,8 +0,0 @@
-######################################## Command interface configuration #########################################
-# PluginCommandInterfaceCAPI_dbus.conf #
-# If you change something make sure you re-configure with 'ccmake..' which generates the *_dbus.conf file again. #
-##################################################################################################################
-[local:org.genivi.audiomanager.commandinterface:org.genivi.audiomanager]
-dbus_connection=org.genivi.audiomanager
-dbus_object=/org/genivi/audiomanager/CommandControl
-dbus_interface=org.genivi.audiomanager.CommandControl \ No newline at end of file
diff --git a/PluginCommandInterfaceCAPI/include/CAmCommandSenderCAPI.h b/PluginCommandInterfaceCAPI/include/CAmCommandSenderCAPI.h
deleted file mode 100644
index 64aba38..0000000
--- a/PluginCommandInterfaceCAPI/include/CAmCommandSenderCAPI.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/**
- * Copyright (c) 2012 BMW
- *
- * \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 CAPICOMMANDSENDER_H_
-#define CAPICOMMANDSENDER_H_
-
-#include <map>
-#include "shared/CAmCommonAPIWrapper.h"
-#include "command/IAmCommandSend.h"
-#include "command/IAmCommandReceive.h"
-#include "CAmCommandSenderService.h"
-
-
-
-namespace am
-{
-using namespace CommonAPI;
-
-
-/**
- * Common-api implementation of CommandSendInterface.
- * This class publish a service
- */
-class CAmCommandSenderCAPI: public IAmCommandSend
-{
- CAmCommandSenderCAPI();
-public:
- CAmCommandSenderCAPI(CAmCommonAPIWrapper *aWrapper);
- virtual ~CAmCommandSenderCAPI();
- am_Error_e startService(IAmCommandReceive* commandreceiveinterface);
- am_Error_e startupInterface(IAmCommandReceive* commandreceiveinterface);
- am_Error_e tearDownInterface(IAmCommandReceive* commandreceiveinterface = NULL);
- void setCommandReady(const uint16_t handle);
- void setCommandRundown(const uint16_t handle);
- void cbNewMainConnection(const am_MainConnectionType_s& mainConnection);
- void cbRemovedMainConnection(const am_mainConnectionID_t mainConnection);
- void cbNewSink(const am_SinkType_s& sink);
- void cbRemovedSink(const am_sinkID_t sinkID);
- void cbNewSource(const am_SourceType_s& source);
- void cbRemovedSource(const am_sourceID_t source);
- void cbNumberOfSinkClassesChanged();
- void cbNumberOfSourceClassesChanged();
- void cbMainConnectionStateChanged(const am_mainConnectionID_t connectionID, const am_ConnectionState_e connectionState);
- void cbMainSinkSoundPropertyChanged(const am_sinkID_t sinkID, const am_MainSoundProperty_s& soundProperty);
- void cbMainSourceSoundPropertyChanged(const am_sourceID_t sourceID, const am_MainSoundProperty_s& soundProperty);
- void cbSinkAvailabilityChanged(const am_sinkID_t sinkID, const am_Availability_s& availability);
- void cbSourceAvailabilityChanged(const am_sourceID_t sourceID, const am_Availability_s& availability);
- void cbVolumeChanged(const am_sinkID_t sinkID, const am_mainVolume_t volume);
- void cbSinkMuteStateChanged(const am_sinkID_t sinkID, const am_MuteState_e muteState);
- void cbSystemPropertyChanged(const am_SystemProperty_s& systemProperty);
- void cbTimingInformationChanged(const am_mainConnectionID_t mainConnectionID, const am_timeSync_t time);
- void getInterfaceVersion(std::string& version) const;
- void cbSinkUpdated(const am_sinkID_t sinkID, const am_sinkClass_t sinkClassID, const std::vector<am_MainSoundProperty_s>& listMainSoundProperties);
- void cbSourceUpdated(const am_sourceID_t sourceID, const am_sourceClass_t sourceClassID, const std::vector<am_MainSoundProperty_s>& listMainSoundProperties);
- void cbSinkNotification(const am_sinkID_t sinkID, const am_NotificationPayload_s& notification) ;
- void cbSourceNotification(const am_sourceID_t sourceID, const am_NotificationPayload_s& notification) ;
- void cbMainSinkNotificationConfigurationChanged(const am_sinkID_t sinkID, const am_NotificationConfiguration_s& mainNotificationConfiguration) ;
- void cbMainSourceNotificationConfigurationChanged(const am_sourceID_t sourceID, const am_NotificationConfiguration_s& mainNotificationConfiguration) ;
-
- static const char * COMMAND_SENDER_SERVICE;
-
-private:
- std::shared_ptr<CAmCommandSenderService> mService;
- CAmCommonAPIWrapper* mpCAmCAPIWrapper; ///< ! pointer to dbus wrapper
- IAmCommandReceive* mpIAmCommandReceive; ///< ! pointer to commandReceive Interface
- bool mReady; ///< ! if false, calls shall be ignored.
- bool mIsServiceStarted;
-
- /**
- * list of sinks, needed to send out only deltas
- */
- std::vector<am_SinkType_s> mlistSinks;
-
- /**
- * list of sources, needed to send out only deltas
- */
- std::vector<am_SourceType_s> mlistSources;
-
- /**
- * used as comparison function for am_SinkType_s
- */
- struct sortBySinkID
- {
- bool operator()(const am_SinkType_s & a, const am_SinkType_s & b)
- {
- return (a.sinkID < b.sinkID);
- }
- };
-
- /**
- * used as comparison function for am_SourceType_s
- */
- struct sortBySourceID
- {
- bool operator()(const am_SourceType_s & a, const am_SourceType_s & b)
- {
- return (a.sourceID < b.sourceID);
- }
- };
-
-};
-
-}
-
-#endif /* CAPICOMMANDSENDER_H_ */
diff --git a/PluginCommandInterfaceCAPI/include/CAmCommandSenderCommon.h b/PluginCommandInterfaceCAPI/include/CAmCommandSenderCommon.h
deleted file mode 100644
index caeb455..0000000
--- a/PluginCommandInterfaceCAPI/include/CAmCommandSenderCommon.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * Copyright (c) 2012 BMW
- *
- * \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 CAMCOMMANDSENDERCOMMON_H_
-#define CAMCOMMANDSENDERCOMMON_H_
-
-#include <memory>
-#include "audiomanagertypes.h"
-#include <org/genivi/am.h>
-
-using namespace am;
-
-/**
- * The following functions convert the basics AudiomManager types from/to CommonAPI types.
- */
-
-extern void CAmConvertAvailablility(const am_Availability_s & , org::genivi::am::am_Availability_s & );
-extern void CAmConvertMainSoundProperty(const am_MainSoundProperty_s & , org::genivi::am::am_MainSoundProperty_s & );
-extern void CAmConvertSystemProperty(const am_SystemProperty_s &, org::genivi::am::am_SystemProperty_s &);
-
-extern org::genivi::am::am_Availability_e CAmConvert2CAPIType(const am_Availability_e &);
-
-extern org::genivi::am::am_MuteState_e CAmConvert2CAPIType(const am_MuteState_e &);
-extern am_MuteState_e CAmConvertFromCAPIType(const org::genivi::am::am_MuteState_e &);
-
-extern org::genivi::am::am_ConnectionState_e CAmConvert2CAPIType(const am_ConnectionState_e &);
-extern am_ConnectionState_e CAmConvertFromCAPIType(const org::genivi::am::am_ConnectionState_e &);
-
-extern am_NotificationStatus_e CAmConvert2CAPIType(const org::genivi::am::am_NotificationStatus_e &);
-extern org::genivi::am::am_NotificationStatus_e CAmConvertFromCAPIType(const am_NotificationStatus_e &);
-
-extern org::genivi::am::am_Error_e CAmConvert2CAPIType(const am_Error_e &);
-extern am_Error_e CAmConvertFromCAPIType(const org::genivi::am::am_Error_e & error);
-
-#endif /* CAMCOMMANDSENDERCOMMON_H_ */
diff --git a/PluginCommandInterfaceCAPI/include/CAmCommandSenderService.h b/PluginCommandInterfaceCAPI/include/CAmCommandSenderService.h
deleted file mode 100644
index 654436f..0000000
--- a/PluginCommandInterfaceCAPI/include/CAmCommandSenderService.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/**
- * Copyright (c) 2012 BMW
- *
- * \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 CAMCOMMANDSENDERSERVICE_H_
-#define CAMCOMMANDSENDERSERVICE_H_
-
-#include <org/genivi/am/CommandControlStubDefault.h>
-#include "../../include/command/IAmCommandReceive.h"
-
-namespace am {
-
-/**
- * A concrete stub implementation used by the command sender plug-in.
- */
-class CAmCommandSenderService: public org::genivi::am::CommandControlStubDefault {
- IAmCommandReceive* mpIAmCommandReceive;
-public:
- CAmCommandSenderService();
- CAmCommandSenderService(IAmCommandReceive *aReceiver);
- virtual ~CAmCommandSenderService();
-
- virtual void connect(org::genivi::am::am_sourceID_t sourceID, org::genivi::am::am_sinkID_t sinkID, org::genivi::am::am_mainConnectionID_t& mainConnectionID, org::genivi::am::am_Error_e& result);
-
- virtual void disconnect(org::genivi::am::am_mainConnectionID_t mainConnectionID, org::genivi::am::am_Error_e& result);
-
- virtual void setVolume(org::genivi::am::am_sinkID_t sinkID, org::genivi::am::am_mainVolume_t volume, org::genivi::am::am_Error_e& result);
-
- virtual void volumeStep(org::genivi::am::am_sinkID_t sinkID, org::genivi::am::am_mainVolume_t volumeStep, org::genivi::am::am_Error_e& result);
-
- virtual void setSinkMuteState(org::genivi::am::am_sinkID_t sinkID, org::genivi::am::am_MuteState_e muteState, org::genivi::am::am_Error_e& result);
-
- virtual void setMainSinkSoundProperty(org::genivi::am::am_sinkID_t sinkID, org::genivi::am::am_MainSoundProperty_s soundProperty, org::genivi::am::am_Error_e& result);
-
- virtual void setMainSourceSoundProperty(org::genivi::am::am_sourceID_t sourceID, org::genivi::am::am_MainSoundProperty_s soundProperty, org::genivi::am::am_Error_e& result);
-
- virtual void setSystemProperty(org::genivi::am::am_SystemProperty_s soundProperty, org::genivi::am::am_Error_e& result);
-
- virtual void getListMainConnections(org::genivi::am::am_MainConnection_L& listConnections,org::genivi::am::am_Error_e& result);
-
- virtual void getListMainSinks(org::genivi::am::am_SinkType_L& listMainSinks, org::genivi::am::am_Error_e& result);
-
- virtual void getListMainSources(org::genivi::am::am_SourceType_L& listMainSources, org::genivi::am::am_Error_e& result);
-
- virtual void getListMainSinkSoundProperties(org::genivi::am::am_sinkID_t sinkID, org::genivi::am::am_MainSoundProperty_L& listSoundProperties, org::genivi::am::am_Error_e& result);
-
- virtual void getListMainSourceSoundProperties(org::genivi::am::am_sourceID_t sourceID, org::genivi::am::am_MainSoundProperty_L& listSourceProperties, org::genivi::am::am_Error_e& result);
-
- virtual void getListSourceClasses( org::genivi::am::am_SourceClass_L& listSourceClasses,org::genivi::am::am_Error_e& result);
-
- virtual void getListSinkClasses( org::genivi::am::am_SinkClass_L& listSinkClasses,org::genivi::am::am_Error_e& result);
-
- virtual void getListSystemProperties(org::genivi::am::am_SystemProperty_L& listSystemProperties,org::genivi::am::am_Error_e& result);
-
- virtual void getTimingInformation(org::genivi::am::am_mainConnectionID_t mainConnectionID, org::genivi::am::am_timeSync_t& delay,org::genivi::am::am_Error_e& result);
-};
-
-} /* namespace am */
-#endif /* CAMCOMMANDSENDERSERVICE_H_ */
diff --git a/PluginCommandInterfaceCAPI/include/configCommandCAPI.h b/PluginCommandInterfaceCAPI/include/configCommandCAPI.h
deleted file mode 100644
index 8bd2faa..0000000
--- a/PluginCommandInterfaceCAPI/include/configCommandCAPI.h
+++ /dev/null
@@ -1,4 +0,0 @@
-#ifndef _COMMANDCAPI_CONFIG_H
-#define _COMMANDCAPI_CONFIG_H
-
-#endif /* _COMMANDCAPI_CONFIG_H */
diff --git a/PluginCommandInterfaceCAPI/src/CAmCommandSenderCAPI.cpp b/PluginCommandInterfaceCAPI/src/CAmCommandSenderCAPI.cpp
deleted file mode 100644
index 81e8799..0000000
--- a/PluginCommandInterfaceCAPI/src/CAmCommandSenderCAPI.cpp
+++ /dev/null
@@ -1,364 +0,0 @@
-/**
- * Copyright (c) 2012 BMW
- *
- * \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 "CAmCommandSenderCAPI.h"
-#include <algorithm>
-#include <string>
-#include <vector>
-#include <cassert>
-#include <set>
-#include "shared/CAmDltWrapper.h"
-#include "CAmCommandSenderCommon.h"
-
-
-DLT_DECLARE_CONTEXT(ctxCommandCAPI)
-
-/**
- * factory for plugin loading
- */
-extern "C" IAmCommandSend* PluginCommandInterfaceCAPIFactory()
-{
- CAmDltWrapper::instance()->registerContext(ctxCommandCAPI, "CAPIP", "Common-API Plugin");
- return (new CAmCommandSenderCAPI(Am_CAPI));
-}
-
-/**
- * destroy instance of commandSendInterface
- */
-extern "C" void destroyPluginCommandInterfaceCAPIFactory(IAmCommandSend* commandSendInterface)
-{
- delete commandSendInterface;
-}
-
-
-const char * CAmCommandSenderCAPI::COMMAND_SENDER_SERVICE = "local:org.genivi.audiomanager.commandinterface:org.genivi.audiomanager";
-
-#define RETURN_IF_NOT_READY() if(!mReady) return;
-
-CAmCommandSenderCAPI::CAmCommandSenderCAPI() :
- mService(), //
- mpCAmCAPIWrapper(NULL), //
- mpIAmCommandReceive(NULL), //
- mReady(false),
- mIsServiceStarted(false)
-{
- log(&ctxCommandCAPI, DLT_LOG_INFO, "CommandSenderCAPI constructor called");
-}
-
-CAmCommandSenderCAPI::CAmCommandSenderCAPI(CAmCommonAPIWrapper *aWrapper) :
- mService(), //
- mpCAmCAPIWrapper(aWrapper), //
- mpIAmCommandReceive(NULL), //
- mReady(false),
- mIsServiceStarted(false)
-{
- log(&ctxCommandCAPI, DLT_LOG_INFO, "CommandSenderCAPI constructor called");
- assert(mpCAmCAPIWrapper!=NULL);
-}
-
-CAmCommandSenderCAPI::~CAmCommandSenderCAPI()
-{
- log(&ctxCommandCAPI, DLT_LOG_INFO, "CAPICommandSender destructed");
- CAmDltWrapper::instance()->unregisterContext(ctxCommandCAPI);
- tearDownInterface(mpIAmCommandReceive);
-}
-
-/**
- * registers a service
- */
-am_Error_e CAmCommandSenderCAPI::startService(IAmCommandReceive* commandreceiveinterface)
-{
- if(!mIsServiceStarted)
- {
- assert(commandreceiveinterface);
- mService = std::make_shared<CAmCommandSenderService>(commandreceiveinterface);
- //Registers the service
- if( false == mpCAmCAPIWrapper->registerStub(mService, CAmCommandSenderCAPI::COMMAND_SENDER_SERVICE) )
- {
- return (E_NOT_POSSIBLE);
- }
- mIsServiceStarted = true;
- }
- return (E_OK);
-}
-
-/**
- * sets a command receiver object and registers a service
- */
-am_Error_e CAmCommandSenderCAPI::startupInterface(IAmCommandReceive* commandreceiveinterface)
-{
- log(&ctxCommandCAPI, DLT_LOG_INFO, "startupInterface called");
- mpIAmCommandReceive = commandreceiveinterface;
- return startService(commandreceiveinterface);
-}
-
-/**
- * stops the service
- */
-am_Error_e CAmCommandSenderCAPI::tearDownInterface(IAmCommandReceive*)
-{
- if(mpCAmCAPIWrapper)
- {
- if(mIsServiceStarted)
- {
- mIsServiceStarted = false;
- mpCAmCAPIWrapper->unregisterStub(CAmCommandSenderCAPI::COMMAND_SENDER_SERVICE);
- mService.reset();
- }
- return (E_OK);
- }
- return (E_NOT_POSSIBLE);
-}
-
-void CAmCommandSenderCAPI::setCommandReady(const uint16_t handle)
-{
- log(&ctxCommandCAPI, DLT_LOG_INFO, "cbCommunicationReady called");
- mReady = true;
- mpIAmCommandReceive->confirmCommandReady(handle,E_OK);
-}
-
-void CAmCommandSenderCAPI::setCommandRundown(const uint16_t handle)
-{
- log(&ctxCommandCAPI, DLT_LOG_INFO, "cbCommunicationRundown called");
- mReady = false;
- mpIAmCommandReceive->confirmCommandRundown(handle,E_OK);
-}
-
-void CAmCommandSenderCAPI::cbNewMainConnection(const am_MainConnectionType_s& mainConnectionType)
-{
- RETURN_IF_NOT_READY()
- assert((bool)mService);
- log(&ctxCommandCAPI, DLT_LOG_INFO, "cbNumberOfMainConnectionsChanged called");
- org::genivi::am::am_MainConnectionType_s mainConnection(mainConnectionType.mainConnectionID,mainConnectionType.sourceID,mainConnectionType.sinkID,mainConnectionType.delay,CAmConvert2CAPIType(mainConnectionType.connectionState));
- mService->fireNewMainConnectionEvent(mainConnection);
-}
-
-void CAmCommandSenderCAPI::cbRemovedMainConnection(const am_mainConnectionID_t mainConnection)
-{
- RETURN_IF_NOT_READY()
- assert((bool)mService);
- log(&ctxCommandCAPI, DLT_LOG_INFO, "cbNumberOfMainConnectionsChanged called");
- mService->fireRemovedMainConnectionEvent(mainConnection);
-}
-
-void CAmCommandSenderCAPI::cbNewSink(const am_SinkType_s& sink)
-{
- RETURN_IF_NOT_READY()
- assert((bool)mService);
- log(&ctxCommandCAPI, DLT_LOG_INFO, "cbNewSink called");
- org::genivi::am::am_Availability_s convAvailability;
- CAmConvertAvailablility(sink.availability, convAvailability);
- org::genivi::am::am_SinkType_s ciSink(sink.sinkID, sink.name, convAvailability, sink.volume, CAmConvert2CAPIType(sink.muteState), sink.sinkClassID);
- mService->fireNewSinkEvent(ciSink);
-}
-
-void CAmCommandSenderCAPI::cbRemovedSink(const am_sinkID_t sinkID)
-{
- RETURN_IF_NOT_READY()
- assert((bool)mService);
- log(&ctxCommandCAPI, DLT_LOG_INFO, "cbRemovedSink called");
- mService->fireRemovedSinkEvent(sinkID);
-}
-
-void CAmCommandSenderCAPI::cbNewSource(const am_SourceType_s& source)
-{
- RETURN_IF_NOT_READY()
- assert((bool)mService);
- log(&ctxCommandCAPI, DLT_LOG_INFO, "cbNewSource called");
- org::genivi::am::am_Availability_s convAvailability;
- CAmConvertAvailablility(source.availability, convAvailability);
- org::genivi::am::am_SourceType_s ciSource(source.sourceID, source.name, convAvailability, source.sourceClassID);
- mService->fireNewSourceEvent(ciSource);
-}
-
-void CAmCommandSenderCAPI::cbRemovedSource(const am_sourceID_t source)
-{
- RETURN_IF_NOT_READY()
- assert((bool)mService);
- log(&ctxCommandCAPI, DLT_LOG_INFO, "cbRemovedSource called");
- mService->fireRemovedSourceEvent(source);
-}
-
-void CAmCommandSenderCAPI::cbNumberOfSinkClassesChanged()
-{
- RETURN_IF_NOT_READY()
- assert((bool)mService);
- log(&ctxCommandCAPI, DLT_LOG_INFO, "cbNumberOfSinkClassesChanged called");
- mService->fireNumberOfSinkClassesChangedEvent();
-}
-
-void CAmCommandSenderCAPI::cbNumberOfSourceClassesChanged()
-{
- RETURN_IF_NOT_READY()
- assert((bool)mService);
- log(&ctxCommandCAPI, DLT_LOG_INFO, "cbNumberOfSourceClassesChanged called");
- mService->fireNumberOfSourceClassesChangedEvent();
-}
-
-void CAmCommandSenderCAPI::cbMainConnectionStateChanged(const am_mainConnectionID_t connectionID, const am_ConnectionState_e connectionState)
-{
- RETURN_IF_NOT_READY()
- assert((bool)mService);
- log(&ctxCommandCAPI, DLT_LOG_INFO, "cbMainConnectionStateChanged called, connectionID=", connectionID, "connectionState=", connectionState);
- mService->fireMainConnectionStateChangedEvent(connectionID, CAmConvert2CAPIType(connectionState));
-}
-
-void CAmCommandSenderCAPI::cbMainSinkSoundPropertyChanged(const am_sinkID_t sinkID, const am_MainSoundProperty_s & soundProperty)
-{
- RETURN_IF_NOT_READY()
- assert((bool)mService);
- log(&ctxCommandCAPI, DLT_LOG_INFO, "cbMainSinkSoundPropertyChanged called, sinkID", sinkID, "SoundProperty.type", soundProperty.type, "SoundProperty.value", soundProperty.value);
- org::genivi::am::am_MainSoundProperty_s mainSoundProp(soundProperty.type, soundProperty.value);
- mService->fireMainSinkSoundPropertyChangedEvent(sinkID, mainSoundProp);
-}
-
-void CAmCommandSenderCAPI::cbMainSourceSoundPropertyChanged(const am_sourceID_t sourceID, const am_MainSoundProperty_s & SoundProperty)
-{
- RETURN_IF_NOT_READY()
- assert((bool)mService);
- log(&ctxCommandCAPI, DLT_LOG_INFO, "cbMainSourceSoundPropertyChanged called, sourceID", sourceID, "SoundProperty.type", SoundProperty.type, "SoundProperty.value", SoundProperty.value);
- org::genivi::am::am_MainSoundProperty_s convValue;
- CAmConvertMainSoundProperty(SoundProperty, convValue);
- mService->fireMainSourceSoundPropertyChangedEvent(sourceID, convValue);
-}
-
-void CAmCommandSenderCAPI::cbSinkAvailabilityChanged(const am_sinkID_t sinkID, const am_Availability_s & availability)
-{
- RETURN_IF_NOT_READY()
- assert((bool)mService);
- log(&ctxCommandCAPI, DLT_LOG_INFO, "cbSinkAvailabilityChanged called, sinkID", sinkID, "availability.availability", availability.availability, "SoundProperty.reason", availability.availabilityReason);
- org::genivi::am::am_Availability_s convAvailability;
- CAmConvertAvailablility(availability, convAvailability);
- mService->fireSinkAvailabilityChangedEvent(sinkID, convAvailability);
-}
-
-void CAmCommandSenderCAPI::cbSourceAvailabilityChanged(const am_sourceID_t sourceID, const am_Availability_s & availability)
-{
- RETURN_IF_NOT_READY()
- assert((bool)mService);
- log(&ctxCommandCAPI, DLT_LOG_INFO, "cbSourceAvailabilityChanged called, sourceID", sourceID, "availability.availability", availability.availability, "SoundProperty.reason", availability.availabilityReason);
- org::genivi::am::am_Availability_s convAvailability;
- CAmConvertAvailablility(availability, convAvailability);
- mService->fireSourceAvailabilityChangedEvent(sourceID, convAvailability);
-}
-
-void CAmCommandSenderCAPI::cbVolumeChanged(const am_sinkID_t sinkID, const am_mainVolume_t volume)
-{
- RETURN_IF_NOT_READY()
- assert((bool)mService);
- log(&ctxCommandCAPI, DLT_LOG_INFO, "cbVolumeChanged called, sinkID", sinkID, "volume", volume);
- mService->fireVolumeChangedEvent(sinkID, volume);
-}
-
-void CAmCommandSenderCAPI::cbSinkMuteStateChanged(const am_sinkID_t sinkID, const am_MuteState_e muteState)
-{
- RETURN_IF_NOT_READY()
- assert((bool)mService);
- log(&ctxCommandCAPI, DLT_LOG_INFO, "cbSinkMuteStateChanged called, sinkID", sinkID, "muteState", muteState);
- org::genivi::am::am_MuteState_e ciMuteState = CAmConvert2CAPIType(muteState);
- mService->fireSinkMuteStateChangedEvent(sinkID, ciMuteState);
-}
-
-void CAmCommandSenderCAPI::cbSystemPropertyChanged(const am_SystemProperty_s & SystemProperty)
-{
- RETURN_IF_NOT_READY()
- assert((bool)mService);
- log(&ctxCommandCAPI, DLT_LOG_INFO, "cbSystemPropertyChanged called, SystemProperty.type", SystemProperty.type, "SystemProperty.value", SystemProperty.value);
- org::genivi::am::am_SystemProperty_s convValue;
- CAmConvertSystemProperty(SystemProperty, convValue);
- mService->fireSystemPropertyChangedEvent(convValue);
-}
-
-void CAmCommandSenderCAPI::cbTimingInformationChanged(const am_mainConnectionID_t mainConnectionID, const am_timeSync_t time)
-{
- RETURN_IF_NOT_READY()
- assert((bool)mService);
- log(&ctxCommandCAPI, DLT_LOG_INFO, "cbTimingInformationChanged called, mainConnectionID=", mainConnectionID, "time=", time);
- org::genivi::am::am_mainConnectionID_t ciMainConnection = mainConnectionID;
- mService->fireTimingInformationChangedEvent(ciMainConnection, time);
-}
-
-void CAmCommandSenderCAPI::getInterfaceVersion(std::string & version) const
-{
- version = CommandSendVersion;
-}
-
-void CAmCommandSenderCAPI::cbSinkUpdated(const am_sinkID_t sinkID, const am_sinkClass_t sinkClassID, const std::vector<am_MainSoundProperty_s>& listMainSoundProperties)
-{
- RETURN_IF_NOT_READY()
- assert((bool)mService);
- log(&ctxCommandCAPI, DLT_LOG_INFO, "cbSinkUpdated called, sinkID", sinkID);
- org::genivi::am::am_MainSoundProperty_L list;
- std::for_each(listMainSoundProperties.begin(), listMainSoundProperties.end(), [&](const am_MainSoundProperty_s & ref) {
- org::genivi::am::am_MainSoundProperty_s prop(ref.type, ref.value);
- list.push_back(prop);
- });
- mService->fireSinkUpdatedEvent(sinkID, sinkClassID, list);
-}
-
-void CAmCommandSenderCAPI::cbSourceUpdated(const am_sourceID_t sourceID, const am_sourceClass_t sourceClassID, const std::vector<am_MainSoundProperty_s>& listMainSoundProperties)
-{
- RETURN_IF_NOT_READY()
- assert((bool)mService);
- log(&ctxCommandCAPI, DLT_LOG_INFO, "cbSourceUpdated called, sourceID", sourceID);
- org::genivi::am::am_MainSoundProperty_L list;
- std::for_each(listMainSoundProperties.begin(), listMainSoundProperties.end(), [&](const am_MainSoundProperty_s & ref) {
- org::genivi::am::am_MainSoundProperty_s prop(ref.type, ref.value);
- list.push_back(prop);
- });
- mService->fireSourceUpdatedEvent(sourceID, sourceClassID, list);
-}
-
-void CAmCommandSenderCAPI::cbSinkNotification(const am_sinkID_t sinkID, const am_NotificationPayload_s& notification)
-{
- RETURN_IF_NOT_READY()
- assert((bool)mService);
- log(&ctxCommandCAPI, DLT_LOG_INFO, "cbSinkNotification called, sinkID", sinkID);
- org::genivi::am::am_NotificationPayload_s ciNnotif(notification.type, notification.value);
- mService->fireSinkNotificationEvent(sinkID, ciNnotif);
-}
-
-void CAmCommandSenderCAPI::cbSourceNotification(const am_sourceID_t sourceID, const am_NotificationPayload_s& notification)
-{
- RETURN_IF_NOT_READY()
- assert((bool)mService);
- log(&ctxCommandCAPI, DLT_LOG_INFO, "cbSourceNotification called, sourceID", sourceID);
- org::genivi::am::am_NotificationPayload_s ciNnotif(notification.type, notification.value);
- mService->fireSourceNotificationEvent(sourceID, ciNnotif);
-}
-
-void CAmCommandSenderCAPI::cbMainSinkNotificationConfigurationChanged(const am_sinkID_t sinkID, const am_NotificationConfiguration_s& mainNotificationConfiguration)
-{
- RETURN_IF_NOT_READY()
- assert((bool)mService);
- log(&ctxCommandCAPI, DLT_LOG_INFO, "cbSinkMainNotificationConfigurationChanged called, sinkID", sinkID);
- org::genivi::am::am_NotificationConfiguration_s ciNotifConfig(mainNotificationConfiguration.type,
- static_cast<org::genivi::am::am_NotificationStatus_e>(mainNotificationConfiguration.status),
- mainNotificationConfiguration.parameter);
- mService->fireMainSinkNotificationConfigurationChangedEvent(sinkID, ciNotifConfig);
-}
-
-void CAmCommandSenderCAPI::cbMainSourceNotificationConfigurationChanged(const am_sourceID_t sourceID, const am_NotificationConfiguration_s& mainNotificationConfiguration)
-{
- RETURN_IF_NOT_READY()
- assert((bool)mService);
- log(&ctxCommandCAPI, DLT_LOG_INFO, "cbSourceMainNotificationConfigurationChanged called, sourceID", sourceID);
- org::genivi::am::am_NotificationConfiguration_s ciNotifConfig(mainNotificationConfiguration.type,
- static_cast<org::genivi::am::am_NotificationStatus_e>(mainNotificationConfiguration.status),
- mainNotificationConfiguration.parameter);
- mService->fireMainSourceNotificationConfigurationChangedEvent(sourceID, ciNotifConfig);
-}
diff --git a/PluginCommandInterfaceCAPI/src/CAmCommandSenderCommon.cpp b/PluginCommandInterfaceCAPI/src/CAmCommandSenderCommon.cpp
deleted file mode 100644
index 06383ad..0000000
--- a/PluginCommandInterfaceCAPI/src/CAmCommandSenderCommon.cpp
+++ /dev/null
@@ -1,101 +0,0 @@
-/**
- * Copyright (c) 2012 BMW
- *
- * \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 "CAmCommandSenderCommon.h"
-
-/**
- * Utility functions
- */
-void CAmConvertAvailablility(const am_Availability_s & amAvailability, org::genivi::am::am_Availability_s & result)
-{
- result.availability = CAmConvert2CAPIType(amAvailability.availability);
- result.availabilityReason = amAvailability.availabilityReason;
-}
-
-void CAmConvertMainSoundProperty(const am_MainSoundProperty_s & amMainSoundProperty, org::genivi::am::am_MainSoundProperty_s & result)
-{
- result.type = amMainSoundProperty.type;
- result.value = amMainSoundProperty.value;
-}
-
-void CAmConvertSystemProperty(const am_SystemProperty_s & amSystemProperty, org::genivi::am::am_SystemProperty_s & result)
-{
- result.type = amSystemProperty.type;
- result.value = amSystemProperty.value;
-}
-
-org::genivi::am::am_Availability_e CAmConvert2CAPIType(const am_Availability_e & availability)
-{
- return (A_MAX==availability)?org::genivi::am::am_Availability_e::A_MAX
- :
- static_cast<org::genivi::am::am_Availability_e>(availability);
-}
-
-org::genivi::am::am_MuteState_e CAmConvert2CAPIType(const am_MuteState_e & muteState)
-{
- return MS_MAX==muteState?
- org::genivi::am::am_MuteState_e::MS_MAX
- :
- static_cast<org::genivi::am::am_MuteState_e>(muteState);
-}
-
-am_MuteState_e CAmConvertFromCAPIType(const org::genivi::am::am_MuteState_e & muteState)
-{
- return org::genivi::am::am_MuteState_e::MS_MAX==muteState?
- MS_MAX:static_cast<am_MuteState_e>(muteState);
-}
-
-org::genivi::am::am_ConnectionState_e CAmConvert2CAPIType(const am_ConnectionState_e & connectionState)
-{
- return CS_MAX==connectionState?
- org::genivi::am::am_ConnectionState_e::CS_MAX
- :
- static_cast<org::genivi::am::am_ConnectionState_e>(connectionState);
-}
-am_ConnectionState_e CAmConvertFromCAPIType(const org::genivi::am::am_ConnectionState_e & connectionState)
-{
- return org::genivi::am::am_ConnectionState_e::CS_MAX==connectionState?
- CS_MAX:static_cast<am_ConnectionState_e>(connectionState);
-}
-
-org::genivi::am::am_NotificationStatus_e CAmConvert2CAPIType(const am_NotificationStatus_e & notificationStatus)
-{
- return NS_MAX==notificationStatus?
- org::genivi::am::am_NotificationStatus_e::NS_MAX
- :
- static_cast<org::genivi::am::am_NotificationStatus_e>(notificationStatus);
-}
-am_NotificationStatus_e CAmConvertFromCAPIType(const org::genivi::am::am_NotificationStatus_e & notificationStatus)
-{
- return org::genivi::am::am_NotificationStatus_e::NS_MAX==notificationStatus?
- NS_MAX:static_cast<am_NotificationStatus_e>(notificationStatus);
-}
-
-org::genivi::am::am_Error_e CAmConvert2CAPIType(const am_Error_e & error)
-{
- return E_MAX==error?
- org::genivi::am::am_Error_e::E_MAX
- :
- static_cast<org::genivi::am::am_Error_e>(error);
-}
-am_Error_e CAmConvertFromCAPIType(const org::genivi::am::am_Error_e & error)
-{
- return org::genivi::am::am_Error_e::E_MAX==error?
- E_MAX:static_cast<am_Error_e>(error);
-}
-
diff --git a/PluginCommandInterfaceCAPI/src/CAmCommandSenderService.cpp b/PluginCommandInterfaceCAPI/src/CAmCommandSenderService.cpp
deleted file mode 100644
index d2d59f1..0000000
--- a/PluginCommandInterfaceCAPI/src/CAmCommandSenderService.cpp
+++ /dev/null
@@ -1,236 +0,0 @@
-/**
- * Copyright (c) 2012 BMW
- *
- * \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 "CAmCommandSenderService.h"
-#include <assert.h>
-#include <algorithm>
-#include "CAmCommandSenderCommon.h"
-
-
-namespace am {
-
-CAmCommandSenderService::CAmCommandSenderService():mpIAmCommandReceive(NULL) {
- // TODO Auto-generated constructor stub
-
-}
-
-CAmCommandSenderService::CAmCommandSenderService(IAmCommandReceive *aReceiver):mpIAmCommandReceive(aReceiver) {
- // TODO Auto-generated constructor stub
-
-}
-
-CAmCommandSenderService::~CAmCommandSenderService() {
- // TODO Auto-generated destructor stub
-}
-
-void CAmCommandSenderService::connect(org::genivi::am::am_sourceID_t sourceID, org::genivi::am::am_sinkID_t sinkID, org::genivi::am::am_mainConnectionID_t& mainConnectionID,org::genivi::am::am_Error_e& result) {
- assert(mpIAmCommandReceive);
- result = CAmConvert2CAPIType(mpIAmCommandReceive->connect(sourceID, sinkID, mainConnectionID));
-}
-
-void CAmCommandSenderService::disconnect(org::genivi::am::am_mainConnectionID_t mainConnectionID, org::genivi::am::am_Error_e& result) {
- assert(mpIAmCommandReceive);
- result = CAmConvert2CAPIType(mpIAmCommandReceive->disconnect(mainConnectionID));
-}
-
-void CAmCommandSenderService::setVolume(org::genivi::am::am_sinkID_t sinkID, org::genivi::am::am_mainVolume_t volume, org::genivi::am::am_Error_e& result) {
-
- assert(mpIAmCommandReceive);
- result = CAmConvert2CAPIType(mpIAmCommandReceive->setVolume(sinkID, volume));
-}
-
-void CAmCommandSenderService::volumeStep(org::genivi::am::am_sinkID_t sinkID, org::genivi::am::am_mainVolume_t volumeStep, org::genivi::am::am_Error_e& result) {
- assert(mpIAmCommandReceive);
- result = CAmConvert2CAPIType(mpIAmCommandReceive->volumeStep(sinkID, volumeStep));
-}
-
-void CAmCommandSenderService::setSinkMuteState(org::genivi::am::am_sinkID_t sinkID, org::genivi::am::am_MuteState_e muteState, org::genivi::am::am_Error_e& result) {
- assert(mpIAmCommandReceive);
- result = CAmConvert2CAPIType(mpIAmCommandReceive->setSinkMuteState(sinkID, CAmConvertFromCAPIType(muteState)));
-}
-
-void CAmCommandSenderService::setMainSinkSoundProperty(org::genivi::am::am_sinkID_t sinkID, org::genivi::am::am_MainSoundProperty_s soundProperty, org::genivi::am::am_Error_e& result) {
- assert(mpIAmCommandReceive);
- am_MainSoundProperty_s property = {static_cast<am_CustomMainSoundPropertyType_t>(soundProperty.type), soundProperty.value};
- result = CAmConvert2CAPIType(mpIAmCommandReceive->setMainSinkSoundProperty(property, sinkID));
-}
-
-void CAmCommandSenderService::setMainSourceSoundProperty(org::genivi::am::am_sourceID_t sourceID, org::genivi::am::am_MainSoundProperty_s soundProperty, org::genivi::am::am_Error_e& result) {
- assert(mpIAmCommandReceive);
- am_MainSoundProperty_s property = {static_cast<am_CustomMainSoundPropertyType_t>(soundProperty.type), soundProperty.value};
- result = CAmConvert2CAPIType(mpIAmCommandReceive->setMainSourceSoundProperty(property, sourceID));
-}
-
-void CAmCommandSenderService::setSystemProperty(org::genivi::am::am_SystemProperty_s soundProperty, org::genivi::am::am_Error_e& result) {
- assert(mpIAmCommandReceive);
- am_SystemProperty_s property = {static_cast<am_CustomSystemPropertyType_t>(soundProperty.type), soundProperty.value};
- result = CAmConvert2CAPIType(mpIAmCommandReceive->setSystemProperty(property));
-}
-
-void CAmCommandSenderService::getListMainConnections(org::genivi::am::am_MainConnection_L& listConnections,org::genivi::am::am_Error_e& result) {
- assert(mpIAmCommandReceive);
- std::vector<am_MainConnectionType_s> list;
- result = CAmConvert2CAPIType(mpIAmCommandReceive->getListMainConnections(list));
- if(result==org::genivi::am::am_Error_e::E_OK)
- {
- org::genivi::am::am_MainConnectionType_s item;
- for(std::vector<am_MainConnectionType_s>::const_iterator iter = list.begin(); iter!=list.end(); iter++)
- {
- item.mainConnectionID = iter->mainConnectionID;
- item.sourceID = iter->sourceID;
- item.sinkID = iter->sinkID;
- item.delay = iter->delay;
- item.connectionState = CAmConvert2CAPIType(iter->connectionState);
- listConnections.push_back (item);
- }
- }
-}
-
-void CAmCommandSenderService::getListMainSinks(org::genivi::am::am_SinkType_L& listMainSinks,org::genivi::am::am_Error_e& result) {
- assert(mpIAmCommandReceive);
- std::vector<am_SinkType_s> list;
- result = CAmConvert2CAPIType(mpIAmCommandReceive->getListMainSinks(list));
- if(result==org::genivi::am::am_Error_e::E_OK)
- {
- org::genivi::am::am_SinkType_s item;
- for(std::vector<am_SinkType_s>::const_iterator iter = list.begin(); iter!=list.end(); iter++)
- {
- item.sinkID = iter->sinkID;
- item.name = iter->name;
- item.sinkClassID = iter->sinkClassID;
- item.volume = iter->volume;
- item.muteState = CAmConvert2CAPIType(iter->muteState);
- CAmConvertAvailablility(iter->availability, item.availability);
- listMainSinks.push_back (item);
- }
- }
-}
-
-void CAmCommandSenderService::getListMainSources(org::genivi::am::am_SourceType_L& listMainSources,org::genivi::am::am_Error_e& result) {
- assert(mpIAmCommandReceive);
- std::vector<am_SourceType_s> list;
- result = CAmConvert2CAPIType(mpIAmCommandReceive->getListMainSources(list));
- if(result==org::genivi::am::am_Error_e::E_OK)
- {
- org::genivi::am::am_SourceType_s item;
- for(std::vector<am_SourceType_s>::const_iterator iter = list.begin(); iter!=list.end(); iter++)
- {
- item.sourceID = iter->sourceID;
- item.name = iter->name;
- item.sourceClassID = iter->sourceClassID;
- CAmConvertAvailablility(iter->availability, item.availability);
- listMainSources.push_back (item);
- }
- }
-}
-
-void CAmCommandSenderService::getListMainSinkSoundProperties(org::genivi::am::am_sinkID_t sinkID, org::genivi::am::am_MainSoundProperty_L& listSoundProperties,org::genivi::am::am_Error_e& result) {
- assert(mpIAmCommandReceive);
- std::vector<am_MainSoundProperty_s> list;
- result = CAmConvert2CAPIType(mpIAmCommandReceive->getListMainSinkSoundProperties(sinkID, list));
- if(result==org::genivi::am::am_Error_e::E_OK)
- {
- org::genivi::am::am_MainSoundProperty_s item;
- for(std::vector<am_MainSoundProperty_s>::const_iterator iter = list.begin(); iter!=list.end(); iter++)
- {
- item.type = iter->type;
- item.value = iter->value;
- listSoundProperties.push_back (item);
- }
- }
-}
-
-void CAmCommandSenderService::getListMainSourceSoundProperties(org::genivi::am::am_sourceID_t sourceID, org::genivi::am::am_MainSoundProperty_L& listSourceProperties,org::genivi::am::am_Error_e& result) {
- assert(mpIAmCommandReceive);
- std::vector<am_MainSoundProperty_s> list;
- result = CAmConvert2CAPIType(mpIAmCommandReceive->getListMainSourceSoundProperties(sourceID, list));
- if(result==org::genivi::am::am_Error_e::E_OK)
- {
- org::genivi::am::am_MainSoundProperty_s item;
- for(std::vector<am_MainSoundProperty_s>::const_iterator iter = list.begin(); iter!=list.end(); iter++)
- {
- item.type = iter->type;
- item.value = iter->value;
- listSourceProperties.push_back (item);
- }
- }
-}
-
-void CAmCommandSenderService::getListSourceClasses(org::genivi::am::am_SourceClass_L& listSourceClasses,org::genivi::am::am_Error_e& result) {
- assert(mpIAmCommandReceive);
- std::vector<am_SourceClass_s> list;
- result = CAmConvert2CAPIType(mpIAmCommandReceive->getListSourceClasses(list));
- if(result==org::genivi::am::am_Error_e::E_OK)
- {
- org::genivi::am::am_SourceClass_s item;
- for(std::vector<am_SourceClass_s>::const_iterator iter = list.begin(); iter!=list.end(); iter++)
- {
- item.sourceClassID = iter->sourceClassID;
- item.name = iter->name;
- item.listClassProperties.clear();
- std::for_each(iter->listClassProperties.begin(), iter->listClassProperties.end(), [&](const am_ClassProperty_s & ref) {
- org::genivi::am::am_ClassProperty_s classProp(ref.classProperty, ref.value);
- item.listClassProperties.push_back(classProp);
- });
- listSourceClasses.push_back (item);
- }
- }
-}
-
-void CAmCommandSenderService::getListSinkClasses(org::genivi::am::am_SinkClass_L& listSinkClasses,org::genivi::am::am_Error_e& result) {
- assert(mpIAmCommandReceive);
- std::vector<am_SinkClass_s> list;
- result = CAmConvert2CAPIType(mpIAmCommandReceive->getListSinkClasses(list));
- if(result==org::genivi::am::am_Error_e::E_OK)
- {
- org::genivi::am::am_SinkClass_s item;
- for(std::vector<am_SinkClass_s>::const_iterator iter = list.begin(); iter!=list.end(); iter++)
- {
- item.sinkClassID = iter->sinkClassID;
- item.name = iter->name;
- item.listClassProperties.clear();
- std::for_each(iter->listClassProperties.begin(), iter->listClassProperties.end(), [&](const am_ClassProperty_s & ref) {
- org::genivi::am::am_ClassProperty_s classProp(ref.classProperty, ref.value);
- item.listClassProperties.push_back(classProp);
- });
- listSinkClasses.push_back (item);
- }
- }
-}
-
-void CAmCommandSenderService::getListSystemProperties(org::genivi::am::am_SystemProperty_L& listSystemProperties,org::genivi::am::am_Error_e& result) {
- assert(mpIAmCommandReceive);
- std::vector<am_SystemProperty_s> list;
- result = CAmConvert2CAPIType(mpIAmCommandReceive->getListSystemProperties(list));
- if(result==org::genivi::am::am_Error_e::E_OK)
- {
- org::genivi::am::am_SystemProperty_s item;
- for(std::vector<am_SystemProperty_s>::const_iterator iter = list.begin(); iter!=list.end(); iter++)
- {
- item.type = iter->type;
- item.value = iter->value;
- listSystemProperties.push_back (item);
- }
- }
-}
-
-void CAmCommandSenderService::getTimingInformation(org::genivi::am::am_mainConnectionID_t mainConnectionID, org::genivi::am::am_timeSync_t& delay,org::genivi::am::am_Error_e& result) {
- assert(mpIAmCommandReceive);
- result = CAmConvert2CAPIType(mpIAmCommandReceive->getTimingInformation(mainConnectionID, delay));
-}
-
-} /* namespace am */
diff --git a/PluginCommandInterfaceCAPI/test/CAmCommandSenderCAPITest.cpp b/PluginCommandInterfaceCAPI/test/CAmCommandSenderCAPITest.cpp
deleted file mode 100644
index f7abcbc..0000000
--- a/PluginCommandInterfaceCAPI/test/CAmCommandSenderCAPITest.cpp
+++ /dev/null
@@ -1,1138 +0,0 @@
-/**
- * Copyright (c) 2012 BMW
- *
- * \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 "CAmCommandSenderCAPITest.h"
-#include <iostream>
-#include <fstream>
-#include <sstream>
-#include <algorithm>
-#include <string>
-#include <vector>
-#include <set>
-#include "TAmPluginTemplate.h"
-#include "MockIAmCommandReceive.h"
-#include "shared/CAmDltWrapper.h"
-#include "../include/CAmCommandSenderCAPI.h"
-#include "../include/CAmCommandSenderCommon.h"
-#include "MockNotificationsClient.h"
-#include <CommonAPI/CommonAPI.h>
-#include <sys/time.h>
-
-
-
-using namespace am;
-using namespace testing;
-using namespace CommonAPI;
-
-static CAmTestsEnvironment* env;
-
-pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
-pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
-pthread_cond_t condPxy = PTHREAD_COND_INITIALIZER;
-pthread_mutex_t mutexPxy = PTHREAD_MUTEX_INITIALIZER;
-pthread_cond_t condSer = PTHREAD_COND_INITIALIZER;
-pthread_mutex_t mutexSer = PTHREAD_MUTEX_INITIALIZER;
-
-void* run_client(void*)
-{
- CAmSocketHandler socketHandler;
- CAmTestCAPIWrapper wrapper(&socketHandler);
- env->mSocketHandlerClient = &socketHandler;
- std::shared_ptr<CommonAPI::Factory> factory = wrapper.factory();
- env->mProxy = factory->buildProxy<org::genivi::am::CommandControlProxy>(CAmCommandSenderCAPI::COMMAND_SENDER_SERVICE);
- env->mProxy->getProxyStatusEvent().subscribe(std::bind(&CAmTestsEnvironment::onServiceStatusEvent,env,std::placeholders::_1));
-
- pthread_mutex_lock(&mutexSer);
- env->mIsProxyInitilized = true;
- pthread_mutex_unlock(&mutexSer);
- pthread_cond_signal(&condSer);
-
- socketHandler.start_listenting();
-
-//Cleanup
- env->mProxy.reset();
- env->mSocketHandlerClient = NULL;
-
- return (NULL);
-}
-
-void* run_service(void*)
-{
- CAmSocketHandler socketHandler;
- CAmTestCAPIWrapper wrapper(&socketHandler);
- CAmCommandSenderCAPI plugin(&wrapper);
- env->mpPlugin = &plugin;
- env->mSocketHandlerService = &socketHandler;
- MockIAmCommandReceive mock;
- env->mpCommandReceive = &mock;
- if(plugin.startupInterface(env->mpCommandReceive)!=E_OK)
- {
- logError("CommandSendInterface can't start!");
- }
- else
- {
- ON_CALL(*env->mpCommandReceive, getListMainSources(_)).WillByDefault(Return(E_OK));
- ON_CALL(*env->mpCommandReceive, getListMainSinks(_)).WillByDefault(Return(E_OK));
- ON_CALL(*env->mpCommandReceive, getListMainSourceSoundProperties(_,_)).WillByDefault(Return(E_OK));
-
- EXPECT_CALL(*env->mpCommandReceive,confirmCommandReady(10,_));
- plugin.setCommandReady(10);
- socketHandler.start_listenting();
-
- EXPECT_CALL(*env->mpCommandReceive,confirmCommandRundown(10,_));
- plugin.setCommandRundown(10);
- plugin.tearDownInterface(env->mpCommandReceive);
- }
-
-//Cleanup
- env->mpPlugin = NULL;
- env->mpCommandReceive = NULL;
- env->mSocketHandlerClient = NULL;
-
- return (NULL);
-}
-
-void* run_listener(void*)
-{
- pthread_mutex_lock(&mutexSer);
- while (env->mIsProxyInitilized==false)
- {
- std::cout << "\n\r Intialize proxy..\n\r" ;
- pthread_cond_wait(&condSer, &mutexSer);
- }
- pthread_mutex_unlock(&mutexSer);
-
- time_t start = time(0);
- time_t now = start;
- pthread_mutex_lock(&mutexPxy);
- while ( env->mIsServiceAvailable==false && now-start <= 15 )
- {
- std::cout << " Waiting for proxy..\n\r" ;
- struct timespec ts = { 0, 0 };
- clock_gettime(CLOCK_REALTIME, &ts);
- ts.tv_sec += 5;
- pthread_cond_timedwait(&condPxy, &mutexPxy, &ts);
- now = time(0);
- }
- pthread_mutex_unlock(&mutexPxy);
- pthread_cond_signal(&cond);
-
- return NULL;
-}
-
-CAmTestsEnvironment::CAmTestsEnvironment() :
- mListenerThread(0),
- mServicePThread(0),
- mClientPThread(0),
- mSocketHandlerService(NULL),
- mSocketHandlerClient(NULL),
- mIsProxyInitilized(false),
- mIsServiceAvailable(false),
- mpCommandReceive(NULL),
- mpPlugin(NULL)
-{
- env=this;
-
- CAmDltWrapper::instance()->registerApp("capiTest", "capiTest");
- pthread_create(&mListenerThread, NULL, run_listener, NULL);
- pthread_create(&mServicePThread, NULL, run_service, NULL);
- pthread_create(&mClientPThread, NULL, run_client, NULL);
-}
-
-CAmTestsEnvironment::~CAmTestsEnvironment()
-{
-
-}
-
-void CAmTestsEnvironment::SetUp()
-{
- pthread_cond_wait(&cond, &mutex);
-}
-
-void CAmTestsEnvironment::TearDown()
-{
-// mWrapperClient.factory().reset();
-
- mSocketHandlerClient->exit_mainloop();
- pthread_join(mClientPThread, NULL);
- mSocketHandlerService->exit_mainloop();
- pthread_join(mServicePThread, NULL);
- sleep(1);
-}
-
-void CAmTestsEnvironment::onServiceStatusEvent(const CommonAPI::AvailabilityStatus& serviceStatus)
-{
- std::stringstream avail;
- avail << "(" << static_cast<int>(serviceStatus) << ")";
-
- logInfo("Service Status changed to ", avail.str());
- std::cout << std::endl << "Service Status changed to " << avail.str() << std::endl;
- pthread_mutex_lock(&mutexPxy);
- mIsServiceAvailable = (serviceStatus==CommonAPI::AvailabilityStatus::AVAILABLE);
- pthread_mutex_unlock(&mutexPxy);
- pthread_cond_signal(&condPxy);
-}
-
-int main(int argc, char **argv)
-{
- ::testing::InitGoogleTest(&argc, argv);
- ::testing::AddGlobalTestEnvironment(new CAmTestsEnvironment);
- return RUN_ALL_TESTS();
-}
-
-CAmCommandSenderCAPITest::CAmCommandSenderCAPITest()
-{
-
-}
-
-CAmCommandSenderCAPITest::~CAmCommandSenderCAPITest()
-{
-
-}
-
-void CAmCommandSenderCAPITest::SetUp()
-{
- ::testing::GTEST_FLAG(throw_on_failure) = false;
- ::testing::FLAGS_gmock_verbose = "error";
-// ::testing::DefaultValue<am_Error_e>::Set(am_Error_e(E_OK));
-}
-
-void CAmCommandSenderCAPITest::TearDown()
-{
- ::testing::GTEST_FLAG(throw_on_failure) = true;
-}
-
-TEST_F(CAmCommandSenderCAPITest, ClientStartupTest)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive));
-}
-
-ACTION(returnClientConnect)
-{
-arg2=101;
-}
-
-TEST_F(CAmCommandSenderCAPITest, ConnectTest)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- org::genivi::am::am_sourceID_t sourceID = 500;
- org::genivi::am::am_sinkID_t sinkID = 400;
- CommonAPI::CallStatus callStatus = CommonAPI::CallStatus::NOT_AVAILABLE;
- org::genivi::am::am_Error_e result = org::genivi::am::am_Error_e::E_OK;
- org::genivi::am::am_mainConnectionID_t mainConnectionID = 0;
-
- EXPECT_CALL(*env->mpCommandReceive, connect(_, _, _)).WillOnce(DoAll(returnClientConnect(), Return(E_OK)));
- env->mProxy->connect(sourceID, sinkID, callStatus, mainConnectionID, result);
- ASSERT_EQ(mainConnectionID, 101);
- ASSERT_EQ(result, org::genivi::am::am_Error_e::E_OK);
- EXPECT_CALL(*env->mpCommandReceive, disconnect(mainConnectionID)).WillOnce(Return(am_Error_e::E_OK));
- ASSERT_EQ(result, org::genivi::am::am_Error_e::E_OK);
- env->mProxy->disconnect(mainConnectionID, callStatus, result);
- }
- EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive));
-}
-
-TEST_F(CAmCommandSenderCAPITest, SetVolumeTest)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- org::genivi::am::am_mainVolume_t volume = 100;
- org::genivi::am::am_sinkID_t sinkID = 400;
- CommonAPI::CallStatus callStatus = CommonAPI::CallStatus::NOT_AVAILABLE;
- org::genivi::am::am_Error_e result = org::genivi::am::am_Error_e::E_OK;
-
- EXPECT_CALL(*env->mpCommandReceive, setVolume(sinkID,volume)).WillOnce(Return(E_OK));
- env->mProxy->setVolume(sinkID, volume, callStatus, result);
- ASSERT_EQ(result, org::genivi::am::am_Error_e::E_OK);
- }
- EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive));
-}
-
-TEST_F(CAmCommandSenderCAPITest, VolumeStepTest)
-{
-
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- org::genivi::am::am_mainVolume_t volume = 100;
- org::genivi::am::am_sinkID_t sinkID = 400;
- CommonAPI::CallStatus callStatus = CommonAPI::CallStatus::NOT_AVAILABLE;
- org::genivi::am::am_Error_e result = org::genivi::am::am_Error_e::E_OK;
-
- EXPECT_CALL(*env->mpCommandReceive, volumeStep(sinkID,volume)).WillOnce(Return(E_OK));
- env->mProxy->volumeStep(sinkID, volume, callStatus, result);
- ASSERT_EQ(result, org::genivi::am::am_Error_e::E_OK);
- }
- EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive));
-}
-
-TEST_F(CAmCommandSenderCAPITest, SetSinkMuteStateTest)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- org::genivi::am::am_MuteState_e value = org::genivi::am::am_MuteState_e::MS_UNKNOWN;
- org::genivi::am::am_sinkID_t sinkID = 400;
- CommonAPI::CallStatus callStatus = CommonAPI::CallStatus::NOT_AVAILABLE;
- org::genivi::am::am_Error_e result = org::genivi::am::am_Error_e::E_OK;
-
- EXPECT_CALL(*env->mpCommandReceive, setSinkMuteState(sinkID, am_MuteState_e::MS_UNKNOWN)).WillOnce(Return(E_OK));
- env->mProxy->setSinkMuteState(sinkID, value, callStatus, result);
- ASSERT_EQ(result, org::genivi::am::am_Error_e::E_OK);
- }
- EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive));
-}
-
-TEST_F(CAmCommandSenderCAPITest, SetMainSinkSoundPropertyTest)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- org::genivi::am::am_sinkID_t sinkID = 400;
- CommonAPI::CallStatus callStatus = CommonAPI::CallStatus::NOT_AVAILABLE;
- org::genivi::am::am_Error_e result = org::genivi::am::am_Error_e::E_OK;
-
- EXPECT_CALL(*env->mpCommandReceive, setMainSinkSoundProperty(AllOf(
- Field(&am_MainSoundProperty_s::value, 3),
- Field(&am_MainSoundProperty_s::type, MSP_UNKNOWN)), sinkID)).WillOnce(Return(E_OK));
- org::genivi::am::am_MainSoundProperty_s value(MSP_UNKNOWN, (const int16_t)3);
- env->mProxy->setMainSinkSoundProperty(sinkID, value, callStatus, result);
- ASSERT_EQ(result, org::genivi::am::am_Error_e::E_OK);
- }
- EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive));
-}
-
-TEST_F(CAmCommandSenderCAPITest, SetMainSourceSoundPropertyTest)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- org::genivi::am::am_sourceID_t sID = 400;
- CommonAPI::CallStatus callStatus = CommonAPI::CallStatus::NOT_AVAILABLE;
- org::genivi::am::am_Error_e result = org::genivi::am::am_Error_e::E_OK;
-
- EXPECT_CALL(*env->mpCommandReceive, setMainSourceSoundProperty(AllOf(
- Field(&am_MainSoundProperty_s::value, 3),
- Field(&am_MainSoundProperty_s::type, MSP_UNKNOWN)), sID)).WillOnce(Return(E_OK));
- org::genivi::am::am_MainSoundProperty_s value(MSP_UNKNOWN, (const int16_t)3);
- env->mProxy->setMainSourceSoundProperty(sID, value, callStatus, result);
- ASSERT_EQ(result, org::genivi::am::am_Error_e::E_OK);
- }
- EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive));
-}
-
-TEST_F(CAmCommandSenderCAPITest, SetSystemPropertyTest)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- CommonAPI::CallStatus callStatus = CommonAPI::CallStatus::NOT_AVAILABLE;
- org::genivi::am::am_Error_e result = org::genivi::am::am_Error_e::E_OK;
-
- EXPECT_CALL(*env->mpCommandReceive, setSystemProperty(Field(&am_SystemProperty_s::value, 2))).WillOnce(Return(E_OK));
-
- org::genivi::am::am_SystemProperty_s value(SYP_UNKNOWN, (const int16_t)2);
- env->mProxy->setSystemProperty(value, callStatus, result);
- ASSERT_EQ(result, org::genivi::am::am_Error_e::E_OK);
- }
- EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive));
-}
-
-ACTION(returnListConnections){
- std::vector<am_MainConnectionType_s> list;
- am_MainConnectionType_s listItem;
- listItem.mainConnectionID=15;
- listItem.sinkID=4;
- listItem.sourceID=3;
- listItem.connectionState=CS_UNKNOWN;
- listItem.delay=34;
- list.push_back(listItem);
- arg0=list;
-}
-
-TEST_F(CAmCommandSenderCAPITest, GetListMainConnectionsTest)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- CommonAPI::CallStatus callStatus = CommonAPI::CallStatus::NOT_AVAILABLE;
- org::genivi::am::am_Error_e result = org::genivi::am::am_Error_e::E_OK;
-
- EXPECT_CALL(*env->mpCommandReceive, getListMainConnections(_)).WillOnce(DoAll(returnListConnections(), Return(E_OK)));
- org::genivi::am::am_MainConnection_L listConnections;
- env->mProxy->getListMainConnections(callStatus, listConnections, result);
- ASSERT_EQ(result, org::genivi::am::am_Error_e::E_OK);
- ASSERT_EQ(1, listConnections.size());
- ASSERT_EQ(15, listConnections.at(0).mainConnectionID);
- ASSERT_EQ(4, listConnections.at(0).sinkID);
- }
- EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive));
-}
-
-ACTION(returnListSinks){
- std::vector<am_SinkType_s> list;
- am_SinkType_s listItem;
- listItem.availability.availability=A_UNAVAILABLE;
- listItem.availability.availabilityReason=AR_GENIVI_NOMEDIA;
- listItem.muteState=MS_UNMUTED;
- listItem.name="mySink";
- listItem.sinkClassID=34;
- listItem.sinkID=24;
- listItem.volume=124;
- list.push_back(listItem);
- arg0=list;
-}
-
-TEST_F(CAmCommandSenderCAPITest, GetListMainSinksTest)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- CommonAPI::CallStatus callStatus = CommonAPI::CallStatus::NOT_AVAILABLE;
- org::genivi::am::am_Error_e result = org::genivi::am::am_Error_e::E_OK;
-
- EXPECT_CALL(*env->mpCommandReceive, getListMainSinks(_)).WillOnce(DoAll(returnListSinks(), Return(E_OK)));
- org::genivi::am::am_SinkType_L listMainSinks;
- env->mProxy->getListMainSinks(callStatus, listMainSinks,result);
- ASSERT_EQ(result, org::genivi::am::am_Error_e::E_OK);
- ASSERT_EQ(1, listMainSinks.size());
- ASSERT_EQ(34, listMainSinks.at(0).sinkClassID);
- ASSERT_EQ(24, listMainSinks.at(0).sinkID);
- ASSERT_EQ(org::genivi::am::am_Availability_e::A_UNAVAILABLE, listMainSinks.at(0).availability.availability);
- ASSERT_EQ(AR_GENIVI_NOMEDIA, listMainSinks.at(0).availability.availabilityReason);
- }
- EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive));
-}
-
-ACTION(returnListSources){
- std::vector<am_SourceType_s> list;
- am_SourceType_s listItem;
- listItem.availability.availability=A_MAX;
- listItem.availability.availabilityReason=AR_GENIVI_SAMEMEDIA;
- listItem.name="MySource";
- listItem.sourceClassID=12;
- listItem.sourceID=224;
- list.push_back(listItem);
- listItem.name="NextSource";
- listItem.sourceID=22;
- list.push_back(listItem);
- arg0=list;
-}
-TEST_F(CAmCommandSenderCAPITest, GetListMainSourcesTest)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- CommonAPI::CallStatus callStatus = CommonAPI::CallStatus::NOT_AVAILABLE;
- org::genivi::am::am_Error_e result = org::genivi::am::am_Error_e::E_OK;
-
- EXPECT_CALL(*env->mpCommandReceive, getListMainSources(_)).WillOnce(DoAll(returnListSources(), Return(E_OK)));
- org::genivi::am::am_SourceType_L list;
- env->mProxy->getListMainSources(callStatus, list, result);
- ASSERT_EQ(result, org::genivi::am::am_Error_e::E_OK);
- ASSERT_EQ(2, list.size());
- ASSERT_EQ(12, list.at(0).sourceClassID);
- ASSERT_EQ(224, list.at(0).sourceID);
- ASSERT_EQ(org::genivi::am::am_Availability_e::A_MAX, list.at(0).availability.availability);
- ASSERT_EQ(AR_GENIVI_SAMEMEDIA, list.at(0).availability.availabilityReason);
- ASSERT_EQ(22, list.at(1).sourceID);
- }
- EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive));
-}
-
-ACTION(returnListMainSinkSoundProperties){
- std::vector<am_MainSoundProperty_s> list;
- am_MainSoundProperty_s listItem;
- listItem.type=MSP_UNKNOWN;
- listItem.value=223;
- list.push_back(listItem);
- listItem.type=MSP_GENIVI_BASS;
- listItem.value=2;
- list.push_back(listItem);
- arg1=list;
-}
-
-TEST_F(CAmCommandSenderCAPITest, GetListMainSinkSoundPropertiesTest)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- org::genivi::am::am_sinkID_t sID = 400;
- CommonAPI::CallStatus callStatus = CommonAPI::CallStatus::NOT_AVAILABLE;
- org::genivi::am::am_Error_e result = org::genivi::am::am_Error_e::E_OK;
-
- EXPECT_CALL(*env->mpCommandReceive, getListMainSinkSoundProperties(sID,_)).WillOnce(DoAll(returnListMainSinkSoundProperties(), Return(E_OK)));
- org::genivi::am::am_MainSoundProperty_L list;
- env->mProxy->getListMainSinkSoundProperties(sID, callStatus, list, result);
- ASSERT_EQ(result, org::genivi::am::am_Error_e::E_OK);
- ASSERT_EQ(2, list.size());
- ASSERT_EQ(223, list.at(0).value);
- ASSERT_EQ(MSP_UNKNOWN, list.at(0).type);
- ASSERT_EQ(2, list.at(1).value);
- ASSERT_EQ(MSP_GENIVI_BASS, list.at(1).type);
- }
- EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive));
-}
-
-ACTION(returnListMainSourceSoundProperties){
- std::vector<am_MainSoundProperty_s> list;
- am_MainSoundProperty_s listItem;
- listItem.type=MSP_GENIVI_MID;
- listItem.value=223;
- list.push_back(listItem);
- listItem.type=MSP_GENIVI_BASS;
- listItem.value=2;
- list.push_back(listItem);
- arg1=list;
-}
-
-TEST_F(CAmCommandSenderCAPITest, GetListMainSourceSoundPropertiesTest)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- org::genivi::am::am_sourceID_t sID = 400;
- CommonAPI::CallStatus callStatus = CommonAPI::CallStatus::NOT_AVAILABLE;
- org::genivi::am::am_Error_e result = org::genivi::am::am_Error_e::E_OK;
-
- EXPECT_CALL(*env->mpCommandReceive, getListMainSourceSoundProperties(sID,_)).WillOnce(DoAll(returnListMainSourceSoundProperties(), Return(E_OK)));
- org::genivi::am::am_MainSoundProperty_L list;
- env->mProxy->getListMainSourceSoundProperties(sID, callStatus, list, result);
- ASSERT_EQ(result, org::genivi::am::am_Error_e::E_OK);
- ASSERT_EQ(2, list.size());
- ASSERT_EQ(223, list.at(0).value);
- ASSERT_EQ(MSP_GENIVI_MID, list.at(0).type);
- ASSERT_EQ(2, list.at(1).value);
- ASSERT_EQ(MSP_GENIVI_BASS, list.at(1).type);
- }
- EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive));
-}
-
-ACTION(returnListSourceClasses){
- std::vector<am_SourceClass_s> list;
- am_SourceClass_s listItem;
- am_ClassProperty_s property;
- property.classProperty=CP_UNKNOWN;
- property.value=12;
- listItem.name="FirstCLass";
- listItem.sourceClassID=23;
- listItem.listClassProperties.push_back(property);
- list.push_back(listItem);
- listItem.name="SecondCLass";
- listItem.sourceClassID=2;
- listItem.listClassProperties.push_back(property);
- list.push_back(listItem);
- arg0=list;
-}
-
-TEST_F(CAmCommandSenderCAPITest, GetListSourceClassesTest)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- CommonAPI::CallStatus callStatus = CommonAPI::CallStatus::NOT_AVAILABLE;
- org::genivi::am::am_Error_e result = org::genivi::am::am_Error_e::E_OK;
-
- EXPECT_CALL(*env->mpCommandReceive, getListSourceClasses(_)).WillOnce(DoAll(returnListSourceClasses(), Return(E_OK)));
- org::genivi::am::am_SourceClass_L list;
- env->mProxy->getListSourceClasses(callStatus, list, result);
- ASSERT_EQ(result, org::genivi::am::am_Error_e::E_OK);
- ASSERT_EQ(2, list.size());
-
- ASSERT_EQ(23, list.at(0).sourceClassID);
- ASSERT_EQ(1, list.at(0).listClassProperties.size());
- ASSERT_EQ(CP_UNKNOWN, list.at(0).listClassProperties.at(0).classProperty);
-
- ASSERT_EQ(2, list.at(1).sourceClassID);
- ASSERT_EQ(2, list.at(1).listClassProperties.size());
- ASSERT_EQ(CP_UNKNOWN, list.at(1).listClassProperties.at(0).classProperty);
- }
- EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive));
-}
-
-ACTION(returnListSinkClasses){
- std::vector<am_SinkClass_s> list;
- am_SinkClass_s listItem;
- am_ClassProperty_s property;
- property.classProperty=CP_UNKNOWN;
- property.value=122;
- listItem.name="FirstCLass";
- listItem.sinkClassID=23;
- listItem.listClassProperties.push_back(property);
- list.push_back(listItem);
- listItem.name="SecondCLass";
- listItem.sinkClassID=2;
- listItem.listClassProperties.push_back(property);
- list.push_back(listItem);
- arg0=list;
-}
-
-TEST_F(CAmCommandSenderCAPITest, GetListSinkClassesTest)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- CommonAPI::CallStatus callStatus = CommonAPI::CallStatus::NOT_AVAILABLE;
- org::genivi::am::am_Error_e result = org::genivi::am::am_Error_e::E_OK;
-
- EXPECT_CALL(*env->mpCommandReceive, getListSinkClasses(_)).WillOnce(DoAll(returnListSinkClasses(), Return(E_OK)));
- org::genivi::am::am_SinkClass_L list;
- env->mProxy->getListSinkClasses(callStatus, list,result);
- ASSERT_EQ(result, org::genivi::am::am_Error_e::E_OK);
- ASSERT_EQ(2, list.size());
-
- ASSERT_EQ(0, list.at(0).name.compare("FirstCLass"));
- ASSERT_EQ(23, list.at(0).sinkClassID);
- ASSERT_EQ(1, list.at(0).listClassProperties.size());
- ASSERT_EQ(CP_UNKNOWN, list.at(0).listClassProperties.at(0).classProperty);
-
- ASSERT_EQ(0, list.at(1).name.compare("SecondCLass"));
- ASSERT_EQ(2, list.at(1).sinkClassID);
- ASSERT_EQ(2, list.at(1).listClassProperties.size());
- ASSERT_EQ(CP_UNKNOWN, list.at(1).listClassProperties.at(0).classProperty);
- }
- EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive));
-}
-
-ACTION(returnListSystemProperties){
- std::vector<am_SystemProperty_s> list;
- am_SystemProperty_s listItem;
- listItem.type=SYP_UNKNOWN;
- listItem.value=-2245;
- list.push_back(listItem);
- arg0=list;
-}
-
-TEST_F(CAmCommandSenderCAPITest, GetListSystemPropertiesTest)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- CommonAPI::CallStatus callStatus = CommonAPI::CallStatus::NOT_AVAILABLE;
- org::genivi::am::am_Error_e result = org::genivi::am::am_Error_e::E_OK;
-
- EXPECT_CALL(*env->mpCommandReceive, getListSystemProperties(_)).WillOnce(DoAll(returnListSystemProperties(), Return(E_OK)));
- org::genivi::am::am_SystemProperty_L list;
- env->mProxy->getListSystemProperties(callStatus, list,result);
- ASSERT_EQ(result, org::genivi::am::am_Error_e::E_OK);
- ASSERT_EQ(1, list.size());
-
- ASSERT_EQ(-2245, list.at(0).value);
- ASSERT_EQ(SYP_UNKNOWN, list.at(0).type);
- }
- EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive));
-}
-
-
-/**
- * Signal tests
- */
-
-#define SIMPLE_THREADS_SYNC_MICROSEC() usleep(50000)
-
-TEST_F(CAmCommandSenderCAPITest, onNewMainConnection)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- MockNotificationsClient mock;
- auto subscription = env->mProxy->getNewMainConnectionEvent().subscribe(std::bind(&MockNotificationsClient::onNewMainConnection, std::ref(mock), std::placeholders::_1));
- am_MainConnectionType_s mainConnection;
- mainConnection.connectionState=am_ConnectionState_e::CS_CONNECTING;
- mainConnection.delay=400;
- mainConnection.mainConnectionID=3;
- mainConnection.sinkID=4;
- mainConnection.sourceID=5;
- org::genivi::am::am_MainConnectionType_s mainConnectionCAPI;
- mainConnectionCAPI.connectionState=CAmConvert2CAPIType(mainConnection.connectionState);
- mainConnectionCAPI.delay=mainConnection.delay;
- mainConnectionCAPI.mainConnectionID=mainConnection.mainConnectionID;
- mainConnectionCAPI.sinkID=mainConnection.sinkID;
- mainConnectionCAPI.sourceID=mainConnection.sourceID;
- EXPECT_CALL(mock, onNewMainConnection(mainConnectionCAPI));
- env->mpPlugin->cbNewMainConnection(mainConnection);
- SIMPLE_THREADS_SYNC_MICROSEC();
- env->mProxy->getNewMainConnectionEvent().unsubscribe(subscription);
- }
- EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive));
-}
-
-TEST_F(CAmCommandSenderCAPITest, removedMainConnection)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- MockNotificationsClient mock;
- auto subscription = env->mProxy->getRemovedMainConnectionEvent().subscribe(std::bind(&MockNotificationsClient::removedMainConnection, std::ref(mock), std::placeholders::_1));
- am_mainConnectionID_t mainConnectionID(3);
- org::genivi::am::am_mainConnectionID_t mainConnectionIDCAPI(mainConnectionID);
- EXPECT_CALL(mock, removedMainConnection(mainConnectionIDCAPI));
- env->mpPlugin->cbRemovedMainConnection(mainConnectionID);
- SIMPLE_THREADS_SYNC_MICROSEC();
- env->mProxy->getRemovedMainConnectionEvent().unsubscribe(subscription);
- }
- EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive));
-}
-
-TEST_F(CAmCommandSenderCAPITest, onNumberOfSourceClassesChangedEventTest)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- MockNotificationsClient mock;
- auto subscription = env->mProxy->getNumberOfSourceClassesChangedEvent().subscribe(
- std::bind(&MockNotificationsClient::onNumberOfSourceClassesChangedEvent, std::ref(mock)));
- EXPECT_CALL(mock, onNumberOfSourceClassesChangedEvent());
- env->mpPlugin->cbNumberOfSourceClassesChanged();
- SIMPLE_THREADS_SYNC_MICROSEC();
- env->mProxy->getNumberOfSourceClassesChangedEvent().unsubscribe(subscription);
- }
- EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive));
-}
-
-TEST_F(CAmCommandSenderCAPITest, onMainConnectionStateChangedEventTest)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- MockNotificationsClient mock;
- auto subscription = env->mProxy->getMainConnectionStateChangedEvent().subscribe(std::bind(&MockNotificationsClient::onMainConnectionStateChangedEvent, std::ref(mock),
- std::placeholders::_1, std::placeholders::_2));
- EXPECT_CALL(mock, onMainConnectionStateChangedEvent(101, org::genivi::am::am_ConnectionState_e::CS_SUSPENDED));
- env->mpPlugin->cbMainConnectionStateChanged(101, CS_SUSPENDED);
- SIMPLE_THREADS_SYNC_MICROSEC();
- env->mProxy->getMainConnectionStateChangedEvent().unsubscribe(subscription);
- }
- EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive));
-}
-
-TEST_F(CAmCommandSenderCAPITest, onSourceAddedEventTest)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- MockNotificationsClient mock;
- auto subscription = env->mProxy->getNewSourceEvent().subscribe(std::bind(&MockNotificationsClient::onSourceAddedEvent, std::ref(mock),std::placeholders::_1));
- org::genivi::am::am_SourceType_s destination;
- destination.sourceID = 100;
- destination.name = "Name";
- destination.availability.availability = org::genivi::am::am_Availability_e::A_MAX;
- destination.availability.availabilityReason = AR_UNKNOWN;
- destination.sourceClassID = 200;
-
- am_SourceType_s origin;
- origin.sourceID = 100;
- origin.name = "Name";
- origin.availability.availability = A_MAX;
- origin.availability.availabilityReason = AR_UNKNOWN;
- origin.sourceClassID = 200;
- EXPECT_CALL(mock, onSourceAddedEvent(destination));
- env->mpPlugin->cbNewSource(origin);
- SIMPLE_THREADS_SYNC_MICROSEC();
- env->mProxy->getNewSourceEvent().unsubscribe(subscription);
- }
- EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive));
-}
-
-TEST_F(CAmCommandSenderCAPITest, onSourceRemovedEventTest)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- MockNotificationsClient mock;
- auto subscription = env->mProxy->getRemovedSourceEvent().subscribe(std::bind(&MockNotificationsClient::onSourceRemovedEvent, std::ref(mock),
- std::placeholders::_1));
- am_sourceID_t source = 101;
- EXPECT_CALL(mock, onSourceRemovedEvent(source));
- env->mpPlugin->cbRemovedSource(source);
- SIMPLE_THREADS_SYNC_MICROSEC();
- env->mProxy->getRemovedSourceEvent().unsubscribe(subscription);
- }
- EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive));
-}
-
-TEST_F(CAmCommandSenderCAPITest, onMainSourceSoundPropertyChangedEventTest)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- MockNotificationsClient mock;
- auto subscription = env->mProxy->getMainSourceSoundPropertyChangedEvent().subscribe(std::bind(&MockNotificationsClient::onMainSourceSoundPropertyChangedEvent, std::ref(mock),
- std::placeholders::_1, std::placeholders::_2));
-
- am_MainSoundProperty_s soundProperty;
- soundProperty.value = 10;
- soundProperty.type = MSP_UNKNOWN;
-
- org::genivi::am::am_MainSoundProperty_s destination(MSP_UNKNOWN, 10);
-
- EXPECT_CALL(mock, onMainSourceSoundPropertyChangedEvent(101, destination));
- env->mpPlugin->cbMainSourceSoundPropertyChanged(101, soundProperty);
- SIMPLE_THREADS_SYNC_MICROSEC();
- env->mProxy->getMainSourceSoundPropertyChangedEvent().unsubscribe(subscription);
- }
- EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive));
-}
-
-TEST_F(CAmCommandSenderCAPITest, onSourceAvailabilityChangedEventTest)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- MockNotificationsClient mock;
- auto subscription = env->mProxy->getSourceAvailabilityChangedEvent().subscribe(std::bind(&MockNotificationsClient::onSourceAvailabilityChangedEvent, std::ref(mock),
- std::placeholders::_1, std::placeholders::_2));
-
- am_Availability_s availability;
- availability.availability = A_MAX;
- availability.availabilityReason = AR_UNKNOWN;
-
- org::genivi::am::am_Availability_s destination(org::genivi::am::am_Availability_e::A_MAX, AR_UNKNOWN);
-
- EXPECT_CALL(mock, onSourceAvailabilityChangedEvent(101, destination));
- env->mpPlugin->cbSourceAvailabilityChanged(101, availability);
- SIMPLE_THREADS_SYNC_MICROSEC();
- env->mProxy->getSourceAvailabilityChangedEvent().unsubscribe(subscription);
- }
- EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive));
-}
-
-TEST_F(CAmCommandSenderCAPITest, onNumberOfSinkClassesChangedEventTest)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- MockNotificationsClient mock;
- auto subscription = env->mProxy->getNumberOfSinkClassesChangedEvent().subscribe(std::bind(&MockNotificationsClient::onNumberOfSinkClassesChangedEvent, std::ref(mock)));
- EXPECT_CALL(mock, onNumberOfSinkClassesChangedEvent());
- env->mpPlugin->cbNumberOfSinkClassesChanged();
- SIMPLE_THREADS_SYNC_MICROSEC();
- env->mProxy->getNumberOfSinkClassesChangedEvent().unsubscribe(subscription);
- }
- EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive));
-}
-
-TEST_F(CAmCommandSenderCAPITest, onSinkAddedEventTest)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- MockNotificationsClient mock;
- auto subscription = env->mProxy->getNewSinkEvent().subscribe(std::bind(&MockNotificationsClient::onSinkAddedEvent, std::ref(mock),
- std::placeholders::_1));
- org::genivi::am::am_SinkType_s destination;
- destination.sinkID = 100;
- destination.name = "Name";
- destination.availability.availability = org::genivi::am::am_Availability_e::A_MAX;
- destination.availability.availabilityReason = AR_UNKNOWN;
- destination.muteState = org::genivi::am::am_MuteState_e::MS_MAX;
- destination.volume = 1;
- destination.sinkClassID = 100;
-
- am_SinkType_s origin;
- origin.sinkID = 100;
- origin.name = "Name";
- origin.availability.availability = A_MAX;
- origin.availability.availabilityReason = AR_UNKNOWN;
- origin.muteState = am_MuteState_e::MS_MAX;
- origin.volume = 1;
- origin.sinkClassID = 100;
-
- EXPECT_CALL(mock, onSinkAddedEvent(destination));
- env->mpPlugin->cbNewSink(origin);
- SIMPLE_THREADS_SYNC_MICROSEC();
- env->mProxy->getNewSinkEvent().unsubscribe(subscription);
- }
- EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive));
-}
-
-TEST_F(CAmCommandSenderCAPITest, onSinkRemovedEventTest)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- MockNotificationsClient mock;
- auto subscription = env->mProxy->getRemovedSinkEvent().subscribe(std::bind(&MockNotificationsClient::onSinkRemovedEvent, std::ref(mock),
- std::placeholders::_1));
- EXPECT_CALL(mock, onSinkRemovedEvent(101));
- env->mpPlugin->cbRemovedSink(101);
- SIMPLE_THREADS_SYNC_MICROSEC();
- env->mProxy->getRemovedSinkEvent().unsubscribe(subscription);
- }
- EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive));
-}
-
-TEST_F(CAmCommandSenderCAPITest, onMainSinkSoundPropertyChangedEventTest)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- MockNotificationsClient mock;
- auto subscription = env->mProxy->getMainSinkSoundPropertyChangedEvent().subscribe(std::bind(&MockNotificationsClient::onMainSinkSoundPropertyChangedEvent, std::ref(mock),
- std::placeholders::_1, std::placeholders::_2));
-
- am_MainSoundProperty_s soundProperty;
- soundProperty.value = 10;
- soundProperty.type = MSP_UNKNOWN;
-
- org::genivi::am::am_MainSoundProperty_s destination(MSP_UNKNOWN, 10);
-
- EXPECT_CALL(mock, onMainSinkSoundPropertyChangedEvent(101, destination));
- env->mpPlugin->cbMainSinkSoundPropertyChanged(101, soundProperty);
- SIMPLE_THREADS_SYNC_MICROSEC();
- env->mProxy->getMainSinkSoundPropertyChangedEvent().unsubscribe(subscription);
- }
- EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive));
-}
-
-TEST_F(CAmCommandSenderCAPITest, onSinkAvailabilityChangedEventTest)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- MockNotificationsClient mock;
- auto subscription = env->mProxy->getSinkAvailabilityChangedEvent().subscribe(std::bind(&MockNotificationsClient::onSinkAvailabilityChangedEvent, std::ref(mock),
- std::placeholders::_1, std::placeholders::_2));
-
- am_Availability_s availability;
- availability.availability = A_MAX;
- availability.availabilityReason = AR_UNKNOWN;
-
- org::genivi::am::am_Availability_s destination(org::genivi::am::am_Availability_e::A_MAX, AR_UNKNOWN);
-
- EXPECT_CALL(mock, onSinkAvailabilityChangedEvent(101, destination));
- env->mpPlugin->cbSinkAvailabilityChanged(101, availability);
- SIMPLE_THREADS_SYNC_MICROSEC();
- env->mProxy->getSinkAvailabilityChangedEvent().unsubscribe(subscription);
- }
- EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive));
-}
-
-TEST_F(CAmCommandSenderCAPITest, onVolumeChangedEventTest)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- MockNotificationsClient mock;
- auto subscription = env->mProxy->getVolumeChangedEvent().subscribe(std::bind(&MockNotificationsClient::onVolumeChangedEvent, std::ref(mock),
- std::placeholders::_1, std::placeholders::_2));
- EXPECT_CALL(mock, onVolumeChangedEvent(101, 4));
- env->mpPlugin->cbVolumeChanged(101, 4);
- SIMPLE_THREADS_SYNC_MICROSEC();
- env->mProxy->getVolumeChangedEvent().unsubscribe(subscription);
- }
- EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive));
-}
-
-TEST_F(CAmCommandSenderCAPITest, onSinkMuteStateChangedEventTest)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- MockNotificationsClient mock;
- auto subscription = env->mProxy->getSinkMuteStateChangedEvent().subscribe(std::bind(&MockNotificationsClient::onSinkMuteStateChangedEvent, std::ref(mock),
- std::placeholders::_1, std::placeholders::_2));
- EXPECT_CALL(mock, onSinkMuteStateChangedEvent(101, org::genivi::am::am_MuteState_e::MS_MAX));
- env->mpPlugin->cbSinkMuteStateChanged(101, am_MuteState_e::MS_MAX);
- SIMPLE_THREADS_SYNC_MICROSEC();
- env->mProxy->getSinkMuteStateChangedEvent().unsubscribe(subscription);
- }
- EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive));
-}
-
-TEST_F(CAmCommandSenderCAPITest, onSystemPropertyChangedEventTest)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- MockNotificationsClient mock;
- auto subscription = env->mProxy->getSystemPropertyChangedEvent().subscribe(std::bind(&MockNotificationsClient::onSystemPropertyChangedEvent, std::ref(mock),
- std::placeholders::_1));
-
- org::genivi::am::am_SystemProperty_s value(static_cast<org::genivi::am::am_CustomSystemPropertyType_t>(SYP_UNKNOWN), (const int16_t)2);
- am_SystemProperty_s systemProperty;
- systemProperty.value = 2;
- systemProperty.type = SYP_UNKNOWN;
-
- EXPECT_CALL(mock, onSystemPropertyChangedEvent(value));
- env->mpPlugin->cbSystemPropertyChanged(systemProperty);
- SIMPLE_THREADS_SYNC_MICROSEC();
- env->mProxy->getSystemPropertyChangedEvent().unsubscribe(subscription);
- }
- EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive));
-}
-
-TEST_F(CAmCommandSenderCAPITest, onTimingInformationChangedEventTest)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- MockNotificationsClient mock;
- auto subscription = env->mProxy->getTimingInformationChangedEvent().subscribe(std::bind(&MockNotificationsClient::onTimingInformationChangedEvent, std::ref(mock),
- std::placeholders::_1, std::placeholders::_2));
-
- EXPECT_CALL(mock, onTimingInformationChangedEvent(1, 2));
- env->mpPlugin->cbTimingInformationChanged(1, 2);
- SIMPLE_THREADS_SYNC_MICROSEC();
- env->mProxy->getTimingInformationChangedEvent().unsubscribe(subscription);
- }
- EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive));
-}
-
-TEST_F(CAmCommandSenderCAPITest, onSinkUpdatedEventTest)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- MockNotificationsClient mock;
- auto subscription = env->mProxy->getSinkUpdatedEvent().subscribe(std::bind(&MockNotificationsClient::onSinkUpdatedEvent, std::ref(mock),
- std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
- std::vector<am_MainSoundProperty_s> listMainSoundProperties;
- am_MainSoundProperty_s prop;
- prop.value = 1;
- prop.type = MSP_UNKNOWN;
- listMainSoundProperties.push_back(prop);
- EXPECT_CALL(mock, onSinkUpdatedEvent(1, 2, _));
- env->mpPlugin->cbSinkUpdated(1, 2, listMainSoundProperties);
- SIMPLE_THREADS_SYNC_MICROSEC();
- env->mProxy->getSinkUpdatedEvent().unsubscribe(subscription);
- }
- EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive));
-}
-
-TEST_F(CAmCommandSenderCAPITest, onSourceUpdatedTest)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- MockNotificationsClient mock;
- auto subscription = env->mProxy->getSourceUpdatedEvent().subscribe(std::bind(&MockNotificationsClient::onSourceUpdatedEvent, std::ref(mock),
- std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
- std::vector<am_MainSoundProperty_s> listMainSoundProperties;
- am_MainSoundProperty_s prop;
- prop.value = 1;
- prop.type = MSP_UNKNOWN;
- listMainSoundProperties.push_back(prop);
- EXPECT_CALL(mock, onSourceUpdatedEvent(1, 2, _));
- env->mpPlugin->cbSourceUpdated(1, 2, listMainSoundProperties);
- SIMPLE_THREADS_SYNC_MICROSEC();
- env->mProxy->getSourceUpdatedEvent().unsubscribe(subscription);
- }
- EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive));
-}
-
-TEST_F(CAmCommandSenderCAPITest, onSinkNotificationEventTest)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- MockNotificationsClient mock;
- auto subscription = env->mProxy->getSinkNotificationEvent().subscribe(std::bind(&MockNotificationsClient::onSinkNotificationEvent, std::ref(mock),
- std::placeholders::_1, std::placeholders::_2));
- am_NotificationPayload_s orig;
- orig.type = NT_UNKNOWN;
- orig.value = 1;
- org::genivi::am::am_NotificationPayload_s dest;
- dest.type = NT_UNKNOWN;
- dest.value = 1;
-
- EXPECT_CALL(mock, onSinkNotificationEvent(1, dest));
- env->mpPlugin->cbSinkNotification(1, orig);
- SIMPLE_THREADS_SYNC_MICROSEC();
- env->mProxy->getSinkNotificationEvent().unsubscribe(subscription);
- }
- EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive));
-}
-
-
-TEST_F(CAmCommandSenderCAPITest, onSourceNotificationEventTest)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- MockNotificationsClient mock;
- auto subscription = env->mProxy->getSourceNotificationEvent().subscribe(std::bind(&MockNotificationsClient::onSourceNotificationEvent, std::ref(mock),
- std::placeholders::_1, std::placeholders::_2));
- am_NotificationPayload_s orig;
- orig.type = NT_UNKNOWN;
- orig.value = 1;
- org::genivi::am::am_NotificationPayload_s dest;
- dest.type = NT_UNKNOWN;
- dest.value = 1;
-
- EXPECT_CALL(mock, onSourceNotificationEvent(1, dest));
- env->mpPlugin->cbSourceNotification(1, orig);
- SIMPLE_THREADS_SYNC_MICROSEC();
- env->mProxy->getSourceNotificationEvent().unsubscribe(subscription);
- }
- EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive));
-}
-
-TEST_F(CAmCommandSenderCAPITest, onMainSinkNotificationConfigurationChangedEventTest)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- MockNotificationsClient mock;
- auto subscription = env->mProxy->getMainSinkNotificationConfigurationChangedEvent().subscribe(std::bind(&MockNotificationsClient::onMainSinkNotificationConfigurationChangedEvent, std::ref(mock),
- std::placeholders::_1, std::placeholders::_2));
- am_NotificationConfiguration_s orig;
- orig.type = NT_UNKNOWN;
- orig.parameter = 1;
- orig.status = am_NotificationStatus_e::NS_MAX;
- org::genivi::am::am_NotificationConfiguration_s dest;
- dest.type = NT_UNKNOWN;
- dest.parameter = 1;
- dest.status = org::genivi::am::am_NotificationStatus_e::NS_MAX;
-
- EXPECT_CALL(mock, onMainSinkNotificationConfigurationChangedEvent(1, dest));
- env->mpPlugin->cbMainSinkNotificationConfigurationChanged(1, orig);
- SIMPLE_THREADS_SYNC_MICROSEC();
- env->mProxy->getMainSinkNotificationConfigurationChangedEvent().unsubscribe(subscription);
- }
- EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive));
-}
-
-TEST_F(CAmCommandSenderCAPITest, onMainSourceNotificationConfigurationChangedEventTest)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- MockNotificationsClient mock;
- auto subscription = env->mProxy->getMainSourceNotificationConfigurationChangedEvent().subscribe(std::bind(&MockNotificationsClient::onMainSourceNotificationConfigurationChangedEvent, std::ref(mock),
- std::placeholders::_1, std::placeholders::_2));
- am_NotificationConfiguration_s orig;
- orig.type = NT_UNKNOWN;
- orig.parameter = 1;
- orig.status = am_NotificationStatus_e::NS_MAX;
- org::genivi::am::am_NotificationConfiguration_s dest;
- dest.type = NT_UNKNOWN;
- dest.parameter = 1;
- dest.status = org::genivi::am::am_NotificationStatus_e::NS_MAX;
-
- EXPECT_CALL(mock, onMainSourceNotificationConfigurationChangedEvent(1, dest));
- env->mpPlugin->cbMainSourceNotificationConfigurationChanged(1, orig);
- SIMPLE_THREADS_SYNC_MICROSEC();
- env->mProxy->getMainSourceNotificationConfigurationChangedEvent().unsubscribe(subscription);
- }
- EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive));
-}
-
diff --git a/PluginCommandInterfaceCAPI/test/CAmCommandSenderCAPITest.h b/PluginCommandInterfaceCAPI/test/CAmCommandSenderCAPITest.h
deleted file mode 100644
index cc5bf0c..0000000
--- a/PluginCommandInterfaceCAPI/test/CAmCommandSenderCAPITest.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/**
- * Copyright (c) 2012 BMW
- *
- * \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 COMMANDPLUGININTERFACETEST_H_
-#define COMMANDPLUGININTERFACETEST_H_
-
-#include "gtest/gtest.h"
-#include "gmock/gmock.h"
-#include "shared/CAmSocketHandler.h"
-#include "CAmTestCAPIWrapper.h"
-#include "../include/CAmCommandSenderCAPI.h"
-#include "MockIAmCommandReceive.h"
-#include <../src-gen/org/genivi/am/CommandControlProxy.h>
-
-#define UNIT_TEST 1
-
-using namespace testing;
-using namespace CommonAPI;
-namespace am {
-
-class CAmCommandSenderDbusBackdoor;
-class IAmCommandSend;
-
-class CAmTestsEnvironment : public ::testing::Environment
-{
- pthread_t mListenerThread;
- pthread_t mServicePThread;
- pthread_t mClientPThread;
-
-public:
- CAmSocketHandler *mSocketHandlerService;
- CAmSocketHandler *mSocketHandlerClient;
- bool mIsProxyInitilized;
- bool mIsServiceAvailable;
- MockIAmCommandReceive *mpCommandReceive;
- CAmCommandSenderCAPI *mpPlugin;
-
- std::shared_ptr<org::genivi::am::CommandControlProxy<> > mProxy;
-
- CAmTestsEnvironment();
- ~CAmTestsEnvironment();
- void SetUp();
- // Override this to define how to tear down the environment.
- void TearDown();
- void onServiceStatusEvent(const CommonAPI::AvailabilityStatus& serviceStatus);
-};
-
-
-class CAmCommandSenderCAPITest :public ::testing::Test
-{
-
-public:
- CAmCommandSenderCAPITest();
- ~CAmCommandSenderCAPITest();
-
- void SetUp();
- void TearDown();
-
-};
-
-}
-
-#endif /* COMMANDPLUGININTERFACETEST_H_ */
diff --git a/PluginCommandInterfaceCAPI/test/CAmTestCAPIWrapper.cpp b/PluginCommandInterfaceCAPI/test/CAmTestCAPIWrapper.cpp
deleted file mode 100644
index 6134d62..0000000
--- a/PluginCommandInterfaceCAPI/test/CAmTestCAPIWrapper.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * Copyright (c) 2012 BMW
- *
- * \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 "CAmTestCAPIWrapper.h"
-
-namespace am {
-
-CAmTestCAPIWrapper::CAmTestCAPIWrapper(CAmSocketHandler* socketHandler):CAmCommonAPIWrapper(socketHandler)
-{
-
-}
-
-CAmTestCAPIWrapper::~CAmTestCAPIWrapper() {
- // TODO Auto-generated destructor stub
-}
-
-} /* namespace am */
diff --git a/PluginCommandInterfaceCAPI/test/CAmTestCAPIWrapper.h b/PluginCommandInterfaceCAPI/test/CAmTestCAPIWrapper.h
deleted file mode 100644
index 90499f9..0000000
--- a/PluginCommandInterfaceCAPI/test/CAmTestCAPIWrapper.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- * Copyright (c) 2012 BMW
- *
- * \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 CAMTESTCAPIWRAPPER_H_
-#define CAMTESTCAPIWRAPPER_H_
-
-#include "shared/CAmCommonAPIWrapper.h"
-
-namespace am {
-
-class CAmTestCAPIWrapper: public am::CAmCommonAPIWrapper {
-public:
- CAmTestCAPIWrapper(CAmSocketHandler* socketHandler);
- virtual ~CAmTestCAPIWrapper();
-};
-
-} /* namespace am */
-#endif /* CAMTESTCAPIWRAPPER_H_ */
diff --git a/PluginCommandInterfaceCAPI/test/CMakeLists.txt b/PluginCommandInterfaceCAPI/test/CMakeLists.txt
deleted file mode 100644
index 79d0c53..0000000
--- a/PluginCommandInterfaceCAPI/test/CMakeLists.txt
+++ /dev/null
@@ -1,101 +0,0 @@
-# Copyright (c) 2012 GENIVI Alliance
-# Copyright (c) 2012 BMW
-#
-# 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/.
-#
-
-cmake_minimum_required(VERSION 2.6)
-
-PROJECT(CAmCommandSenderCAPITests)
-
-set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w -g -DUNIT_TEST=1 -DDLT_CONTEXT=AudioManager")
-
-string (REPLACE "-g -Wall -Wextra" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
-string (REPLACE "-pedantic" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
-
-set(STD_INCLUDE_DIRS "/usr/include")
-set(EXECUTABLE_OUTPUT_PATH ${TEST_EXECUTABLE_OUTPUT_PATH})
-
-FIND_PACKAGE(Threads)
-FIND_PACKAGE(PkgConfig)
-FIND_PACKAGE(PythonLibs REQUIRED)
-FIND_PACKAGE(CommonAPI REQUIRED)
-
-IF(WITH_DLT)
- pkg_check_modules(DLT REQUIRED automotive-dlt>=2.2.0)
-ENDIF(WITH_DLT)
-
-INCLUDE_DIRECTORIES(
- ${STD_INCLUDE_DIRS}
- ${CMAKE_SOURCE_DIR}
- ${CMAKE_CURRENT_BINARY_DIR}
- ${AUDIO_INCLUDE_FOLDER}
- ${CMAKE_SOURCE_DIR}
- ${DLT_INCLUDE_DIRS}
- ${COMMON_API_INCLUDE_DIRS}
- ${COMMON_API_DBUS_INCLUDE_DIRS}
- ${COMMON_API_COMMAND_INTERFACE_GEN_INCLUDE_DIR}
- ${INCLUDE_FOLDER}
- ${PYTHON_INCLUDE_DIRS}
- ${GOOGLE_TEST_INCLUDE_DIR}
- ${GMOCK_INCLUDE_DIR}
- "../../AudioManagerDaemon/include"
- "../include"
-)
-
-link_directories(
- ${LINK_DIRECTORIES}
- ${COMMON_API_LIBRARY_DIRS}
- ${COMMON_API_DBUS_LIBRARY_DIRS}
-)
-
-file(GLOB CAPI_PLUGIN_INTERFACE_SRCS_CXX
- "../../AudioManagerDaemon/src/CAmCommonAPIWrapper.cpp"
- "../../AudioManagerDaemon/src/CAmSocketHandler.cpp"
- "../../AudioManagerDaemon/src/CAmDltWrapper.cpp"
- "CAmCommandSenderCAPITest.cpp"
- "CAmTestCAPIWrapper.cpp"
- "CAmCommandSenderCommon.cpp"
- "../src/*.cpp"
- ${COMMON_API_COMMAND_INTERFACE_GEN_SOURCES}
-)
-
-ADD_EXECUTABLE(AmCommandSenderCAPITest ${CAPI_PLUGIN_INTERFACE_SRCS_CXX})
-
-TARGET_LINK_LIBRARIES(AmCommandSenderCAPITest
- ${DLT_LIBRARIES}
- ${CMAKE_DL_LIBS}
- ${CMAKE_THREAD_LIBS_INIT}
- ${PYTHON_LIBRARY}
- ${PC_GSTREAMER_LIBRARIES}
- ${COMMON_API_LIBRARIES}
- ${COMMON_API_DBUS_LIBRARIES}
- gtest
- gmock
-)
-
-CONFIGURE_FILE( ${CMAKE_SOURCE_DIR}/PluginCommandInterfaceCAPI/fidl/PluginCommandInterfaceCAPI_dbus.conf ${EXECUTABLE_OUTPUT_PATH}/AmCommandSenderCAPITest_dbus.conf)
-
-INSTALL(TARGETS AmCommandSenderCAPITest
- DESTINATION "~/AudioManagerTest/"
- PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
- COMPONENT tests
-)
-
-#execute_process(
-# COMMAND cp "${CMAKE_SOURCE_DIR}/PluginCommandInterfaceCAPI/fidls/PluginCommandInterfaceCAPI_dbus.conf" ${EXECUTABLE_OUTPUT_PATH})
-
-SET(ADD_DEPEND "audiomanager-bin" "sqlite3(>=3.6.22)" "dlt" "gtest" "libpthread-stubs0")
-set_property(GLOBAL APPEND PROPERTY tests_prop "${ADD_DEPEND}")
-
diff --git a/PluginCommandInterfaceCAPI/test/MockIAmCommandReceive.h b/PluginCommandInterfaceCAPI/test/MockIAmCommandReceive.h
deleted file mode 100644
index 23524e1..0000000
--- a/PluginCommandInterfaceCAPI/test/MockIAmCommandReceive.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/**
- * Copyright (c) 2012 BMW
- *
- * \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 MOCKCOMMANDRECEIVENTERFACE_H_
-#define MOCKCOMMANDRECEIVENTERFACE_H_
-
-#include "command/IAmCommandReceive.h"
-#include "gtest/gtest.h"
-#include "gmock/gmock.h"
-
-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));
-
-
-};
-
-} // namespace am
-#endif /* MOCKCOMMANDRECEIVENTERFACE_H_ */
diff --git a/PluginCommandInterfaceCAPI/test/MockNotificationsClient.h b/PluginCommandInterfaceCAPI/test/MockNotificationsClient.h
deleted file mode 100644
index 45e692e..0000000
--- a/PluginCommandInterfaceCAPI/test/MockNotificationsClient.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/**
- * Copyright (c) 2012 BMW
- *
- * \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 MOCKNOTIFICATIONSCLIENT_H_
-#define MOCKNOTIFICATIONSCLIENT_H_
-
-#include "gtest/gtest.h"
-#include "gmock/gmock.h"
-#include <org/genivi/am/CommandControlProxy.h>
-
-
-namespace am {
-using namespace testing;
-using namespace CommonAPI;
-
-class IAmNotificationsClient
-{
-public:
- IAmNotificationsClient() {}
- virtual ~IAmNotificationsClient() {}
- virtual void onNewMainConnection(const org::genivi::am::am_MainConnectionType_s &) = 0 ;
- virtual void removedMainConnection(org::genivi::am::am_mainConnectionID_t) = 0 ;
- virtual void onNumberOfSourceClassesChangedEvent() = 0 ;
- virtual void onMainConnectionStateChangedEvent(org::genivi::am::am_mainConnectionID_t, org::genivi::am::am_ConnectionState_e) = 0 ;
- virtual void onSourceAddedEvent(const org::genivi::am::am_SourceType_s &) = 0 ;
- virtual void onSourceRemovedEvent(org::genivi::am::am_sourceID_t) = 0 ;
- virtual void onMainSourceSoundPropertyChangedEvent(org::genivi::am::am_sourceID_t, const org::genivi::am::am_MainSoundProperty_s & ) = 0 ;
- virtual void onSourceAvailabilityChangedEvent(org::genivi::am::am_sourceID_t, const org::genivi::am::am_Availability_s &) = 0 ;
- virtual void onNumberOfSinkClassesChangedEvent() = 0 ;
- virtual void onSinkAddedEvent(const org::genivi::am::am_SinkType_s &)= 0 ;
- virtual void onSinkRemovedEvent(org::genivi::am::am_sinkID_t) = 0 ;
- virtual void onMainSinkSoundPropertyChangedEvent(org::genivi::am::am_sinkID_t, const org::genivi::am::am_MainSoundProperty_s &) = 0 ;
- virtual void onSinkAvailabilityChangedEvent(org::genivi::am::am_sinkID_t, const org::genivi::am::am_Availability_s &) = 0 ;
- virtual void onVolumeChangedEvent(org::genivi::am::am_sinkID_t, org::genivi::am::am_mainVolume_t) = 0 ;
- virtual void onSinkMuteStateChangedEvent(org::genivi::am::am_sinkID_t, org::genivi::am::am_MuteState_e) = 0 ;
- virtual void onSystemPropertyChangedEvent(const org::genivi::am::am_SystemProperty_s &) = 0 ;
- virtual void onTimingInformationChangedEvent(org::genivi::am::am_mainConnectionID_t, org::genivi::am::am_timeSync_t) = 0 ;
- virtual void onSinkUpdatedEvent(org::genivi::am::am_sinkID_t, org::genivi::am::am_sinkClass_t, const org::genivi::am::am_MainSoundProperty_L &) = 0 ;
- virtual void onSourceUpdatedEvent(org::genivi::am::am_sourceID_t, org::genivi::am::am_sourceClass_t, const org::genivi::am::am_MainSoundProperty_L &) = 0 ;
- virtual void onSinkNotificationEvent(org::genivi::am::am_sinkID_t, const org::genivi::am::am_NotificationPayload_s & ) = 0 ;
- virtual void onSourceNotificationEvent(org::genivi::am::am_sourceID_t, const org::genivi::am::am_NotificationPayload_s &) = 0 ;
- virtual void onMainSinkNotificationConfigurationChangedEvent(org::genivi::am::am_sinkID_t, const org::genivi::am::am_NotificationConfiguration_s &) = 0 ;
- virtual void onMainSourceNotificationConfigurationChangedEvent(org::genivi::am::am_sourceID_t, const org::genivi::am::am_NotificationConfiguration_s &) = 0 ;
-};
-
-class MockNotificationsClient : public IAmNotificationsClient {
-public:
- MOCK_METHOD1(onNewMainConnection,
- void(const org::genivi::am::am_MainConnectionType_s&));
- MOCK_METHOD1(removedMainConnection,
- void(org::genivi::am::am_mainConnectionID_t));
- MOCK_METHOD0(onNumberOfSourceClassesChangedEvent,
- void());
- MOCK_METHOD2(onMainConnectionStateChangedEvent,
- void(org::genivi::am::am_mainConnectionID_t, org::genivi::am::am_ConnectionState_e));
- MOCK_METHOD1(onSourceAddedEvent,
- void(const org::genivi::am::am_SourceType_s &));
- MOCK_METHOD1(onSourceRemovedEvent,
- void(org::genivi::am::am_sourceID_t));
- MOCK_METHOD2(onMainSourceSoundPropertyChangedEvent,
- void(org::genivi::am::am_sourceID_t, const org::genivi::am::am_MainSoundProperty_s&));
- MOCK_METHOD2(onSourceAvailabilityChangedEvent,
- void(org::genivi::am::am_sourceID_t, const org::genivi::am::am_Availability_s&));
- MOCK_METHOD0(onNumberOfSinkClassesChangedEvent,
- void());
- MOCK_METHOD1(onSinkAddedEvent,
- void(const org::genivi::am::am_SinkType_s&));
- MOCK_METHOD1(onSinkRemovedEvent,
- void(org::genivi::am::am_sinkID_t));
- MOCK_METHOD2(onMainSinkSoundPropertyChangedEvent,
- void(org::genivi::am::am_sinkID_t, const org::genivi::am::am_MainSoundProperty_s&));
- MOCK_METHOD2(onSinkAvailabilityChangedEvent,
- void(org::genivi::am::am_sinkID_t, const org::genivi::am::am_Availability_s&));
- MOCK_METHOD2(onVolumeChangedEvent,
- void(org::genivi::am::am_sinkID_t, org::genivi::am::am_mainVolume_t));
- MOCK_METHOD2(onSinkMuteStateChangedEvent,
- void(org::genivi::am::am_sinkID_t, org::genivi::am::am_MuteState_e));
- MOCK_METHOD1(onSystemPropertyChangedEvent,
- void(const org::genivi::am::am_SystemProperty_s&));
- MOCK_METHOD2(onTimingInformationChangedEvent,
- void(org::genivi::am::am_mainConnectionID_t, org::genivi::am::am_timeSync_t));
- MOCK_METHOD3(onSinkUpdatedEvent,
- void(org::genivi::am::am_sinkID_t, org::genivi::am::am_sinkClass_t, const org::genivi::am::am_MainSoundProperty_L&));
- MOCK_METHOD3(onSourceUpdatedEvent,
- void(org::genivi::am::am_sourceID_t, org::genivi::am::am_sourceClass_t, const org::genivi::am::am_MainSoundProperty_L&));
- MOCK_METHOD2(onSinkNotificationEvent,
- void(org::genivi::am::am_sinkID_t, const org::genivi::am::am_NotificationPayload_s&));
- MOCK_METHOD2(onSourceNotificationEvent,
- void(org::genivi::am::am_sourceID_t, const org::genivi::am::am_NotificationPayload_s&));
- MOCK_METHOD2(onMainSinkNotificationConfigurationChangedEvent,
- void(org::genivi::am::am_sinkID_t, const org::genivi::am::am_NotificationConfiguration_s&));
- MOCK_METHOD2(onMainSourceNotificationConfigurationChangedEvent,
- void(org::genivi::am::am_sourceID_t, const org::genivi::am::am_NotificationConfiguration_s&));
- };
-
-
-
-} // namespace am
-#endif /* MOCKCOMMANDRECEIVENTERFACE_H_ */
diff --git a/PluginCommandInterfaceDbus/CMakeLists.txt b/PluginCommandInterfaceDbus/CMakeLists.txt
deleted file mode 100644
index faf7947..0000000
--- a/PluginCommandInterfaceDbus/CMakeLists.txt
+++ /dev/null
@@ -1,103 +0,0 @@
-# Copyright (c) 2012 BMW
-#
-# author Christian Mueller, christian.ei.mueller@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.6)
-
-PROJECT(PluginCommandInterfaceDbus)
-
-OPTION (WITH_COMMAND_INTERFACE_DBUS
- "build with commandinterface dbus plugin" ON )
-
-IF (WITH_COMMAND_INTERFACE_DBUS)
-
-set(LIBRARY_OUTPUT_PATH ${PLUGINS_OUTPUT_PATH}/command)
-set(DOC_OUTPUT_PATH ${DOC_OUTPUT_PATH}/CommandDBusPlugin)
-set(INCLUDE_FOLDER "include")
-message(STATUS "prefix ${CMAKE_INSTALL_PREFIX}")
-SET(SHARED_FOLDER "${CMAKE_INSTALL_PREFIX}/share")
-
-FILE(READ "${AUDIO_INCLUDE_FOLDER}/command/IAmCommandSend.h" VERSION_BUFFER LIMIT 6000)
-STRING(REGEX MATCH "CommandSendVersion*.[^0-9]*[0-9].[0-9]*[0-9]" LIB_INTERFACE_VERSION_STRING ${VERSION_BUFFER})
-STRING(REGEX REPLACE "CommandSendVersion*.." "" LIB_INTERFACE_VERSION ${LIB_INTERFACE_VERSION_STRING})
-MESSAGE(STATUS "Building against command interface version ${LIB_INTERFACE_VERSION}")
-
-IF(USE_BUILD_LIBS)
- SET(COMMAND_DBUS_INTROSPECTION_FOLDER ${EXECUTABLE_OUTPUT_PATH})
- SET(COMMAND_DBUS_INTROSPECTION_FILE ${EXECUTABLE_OUTPUT_PATH}/CommandInterface.xml)
-ELSE(USE_BUILD_LIBS)
- SET(COMMAND_DBUS_INTROSPECTION_FOLDER ${SHARED_FOLDER}/audiomanager)
- SET(COMMAND_DBUS_INTROSPECTION_FILE ${SHARED_FOLDER}/audiomanager/CommandInterface.xml)
-ENDIF(USE_BUILD_LIBS)
-
-CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/config.cmake ${CMAKE_CURRENT_SOURCE_DIR}/include/configCommandDbus.h )
-
-FIND_PACKAGE(DBUS REQUIRED)
-
-INCLUDE_DIRECTORIES(
- ${CMAKE_SOURCE_DIR}
- ${CMAKE_CURRENT_BINARY_DIR}
- ${DBUS_INCLUDE_DIR}
- ${DBUS_ARCH_INCLUDE_DIR}
- ${AUDIO_INCLUDE_FOLDER}
- ${PROJECT_INCLUDE_FOLDER}
- ${DLT_INCLUDE_DIRS}
- ${INCLUDE_FOLDER}
-)
-
-# all source files go here
-file(GLOB PLUGINDBUS_SRCS_CXX "src/*.cpp")
-
-add_library(PluginCommandInterfaceDbus MODULE ${PLUGINDBUS_SRCS_CXX})
-
-TARGET_LINK_LIBRARIES(PluginCommandInterfaceDbus
- ${DLT_LIBRARIES}
- ${DBUS_LIBRARY}
-)
-
-IF(WITH_TESTS)
- add_subdirectory (test)
-ENDIF(WITH_TESTS)
-
-#IF(WITH_DOCUMENTATION)
-# file(MAKE_DIRECTORY ${DOC_OUTPUT_PATH})
-# configure_file(${DOXY_FILE} ${DOC_OUTPUT_PATH}/Doxyfile @ONLY IMMEDIATE)
-# add_custom_target (PluginInterfaceDBusDocs ALL
-# COMMAND ${DOXYGEN_EXECUTABLE} ${DOC_OUTPUT_PATH}/Doxyfile WORKING_DIRECTORY ${DOC_OUTPUT_PATH}
-# SOURCES ${PROJECT_BINARY_DIR} ${DOC_OUTPUT_PATH}/Doxyfile
-# )
-#ENDIF(WITH_DOCUMENTATION)
-
-INSTALL(TARGETS PluginCommandInterfaceDbus
- DESTINATION "lib/${LIB_INSTALL_SUFFIX}/command"
- PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
- COMPONENT sampleplugins
-)
-
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/CommandInterface.xml
- DESTINATION "${COMMAND_DBUS_INTROSPECTION_FOLDER}"
- COMPONENT sampleplugins
-)
-
-IF(USE_BUILD_LIBS)
- execute_process(
- COMMAND mkdir -p "${CMAKE_SOURCE_DIR}/bin"
- COMMAND cp "${CMAKE_SOURCE_DIR}/PluginCommandInterfaceDbus/${INCLUDE_FOLDER}/CommandInterface.xml" ${EXECUTABLE_OUTPUT_PATH}/CommandInterface.xml)
-ENDIF(USE_BUILD_LIBS)
-
-SET(ADD_DEPEND "audiomanager-bin" "dlt" "libdbus-1-3(>=1.2.16)")
-set_property(GLOBAL APPEND PROPERTY sampleplugins_prop "${ADD_DEPEND}")
-
-ENDIF (WITH_COMMAND_INTERFACE_DBUS)
diff --git a/PluginCommandInterfaceDbus/cmake/config.cmake b/PluginCommandInterfaceDbus/cmake/config.cmake
deleted file mode 100644
index 6b8c553..0000000
--- a/PluginCommandInterfaceDbus/cmake/config.cmake
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef _COMMANDDBUS_CONFIG_H
-#define _COMMANDDBUS_CONFIG_H
-
-#cmakedefine COMMAND_DBUS_INTROSPECTION_FILE "@COMMAND_DBUS_INTROSPECTION_FILE@"
-#cmakedefine LIBRARY_OUTPUT_PATH "@LIBRARY_OUTPUT_PATH@"
-
-#endif /* _COMMANDDBUS_CONFIG_H */
diff --git a/PluginCommandInterfaceDbus/include/CAmCommandSenderDbus.h b/PluginCommandInterfaceDbus/include/CAmCommandSenderDbus.h
deleted file mode 100644
index dbcee7c..0000000
--- a/PluginCommandInterfaceDbus/include/CAmCommandSenderDbus.h
+++ /dev/null
@@ -1,121 +0,0 @@
-/**
- * Copyright (c) 2012 BMW
- *
- * \author Christian Mueller, christian.ei.mueller@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 DBUSCOMMANDSENDER_H_
-#define DBUSCOMMANDSENDER_H_
-
-#include <dbus/dbus.h>
-#include <map>
-#include "shared/CAmDbusWrapper.h"
-#include "CAmDbusMessageHandler.h"
-#include "IAmCommandReceiverShadow.h"
-#include "command/IAmCommandSend.h"
-
-#ifdef UNIT_TEST
-#include "../test/CAmCommandSenderDbusBackdoor.h"
-#endif
-
-
-
-namespace am
-{
-
-const char MY_NODE[] = "commandinterface";
-
-/**
- * Dbus Implementation of CommandSendInterface
- */
-class CAmCommandSenderDbus: public IAmCommandSend
-{
-public:
- CAmCommandSenderDbus();
- virtual ~CAmCommandSenderDbus();
- am_Error_e startupInterface(IAmCommandReceive* commandreceiveinterface);
- void setCommandReady(const uint16_t handle);
- void setCommandRundown(const uint16_t handle);
- void cbNewMainConnection(const am_MainConnectionType_s& mainConnection);
- void cbRemovedMainConnection(const am_mainConnectionID_t mainConnection);
- void cbNewSink(const am_SinkType_s& sink);
- void cbRemovedSink(const am_sinkID_t sinkID);
- void cbNewSource(const am_SourceType_s& source);
- void cbRemovedSource(const am_sourceID_t source);
- void cbNumberOfSinkClassesChanged();
- void cbNumberOfSourceClassesChanged();
- void cbMainConnectionStateChanged(const am_mainConnectionID_t connectionID, const am_ConnectionState_e connectionState);
- void cbMainSinkSoundPropertyChanged(const am_sinkID_t sinkID, const am_MainSoundProperty_s& soundProperty);
- void cbMainSourceSoundPropertyChanged(const am_sourceID_t sourceID, const am_MainSoundProperty_s& soundProperty);
- void cbSinkAvailabilityChanged(const am_sinkID_t sinkID, const am_Availability_s& availability);
- void cbSourceAvailabilityChanged(const am_sourceID_t sourceID, const am_Availability_s& availability);
- void cbVolumeChanged(const am_sinkID_t sinkID, const am_mainVolume_t volume);
- void cbSinkMuteStateChanged(const am_sinkID_t sinkID, const am_MuteState_e muteState);
- void cbSystemPropertyChanged(const am_SystemProperty_s& systemProperty);
- void cbTimingInformationChanged(const am_mainConnectionID_t mainConnectionID, const am_timeSync_t time);
- void getInterfaceVersion(std::string& version) const;
- void cbSinkUpdated(const am_sinkID_t sinkID, const am_sinkClass_t sinkClassID, const std::vector<am_MainSoundProperty_s>& listMainSoundProperties);
- void cbSourceUpdated(const am_sourceID_t sourceID, const am_sourceClass_t sourceClassID, const std::vector<am_MainSoundProperty_s>& listMainSoundProperties);
- void cbSinkNotification(const am_sinkID_t sinkID, const am_NotificationPayload_s& notification) ;
- void cbSourceNotification(const am_sourceID_t sourceID, const am_NotificationPayload_s& notification) ;
- void cbMainSinkNotificationConfigurationChanged(const am_sinkID_t sinkID, const am_NotificationConfiguration_s& mainNotificationConfiguration) ;
- void cbMainSourceNotificationConfigurationChanged(const am_sourceID_t sourceID, const am_NotificationConfiguration_s& mainNotificationConfiguration) ;
-
-#ifdef UNIT_TEST
- friend class CAmCommandSenderDbusBackdoor;
-#endif
-private:
- CAmDbusMessageHandler mCAmDbusMessageHandler; ///< ! instance of message handler
- IAmCommandReceiverShadow mIAmCommandReceiverShadow; ///< ! instance of shadow
- CAmDbusWrapper* mpCAmDbusWrapper; ///< ! pointer to dbus wrapper
- IAmCommandReceive* mpIAmCommandReceive; ///< ! pointer to commandReceive Interface
- bool mReady; ///< ! if false, calls shall be ignored.
-
- /**
- * list of sinks, needed to send out only deltas
- */
- std::vector<am_SinkType_s> mlistSinks;
-
- /**
- * list of sources, needed to send out only deltas
- */
- std::vector<am_SourceType_s> mlistSources;
-
- /**
- * used as comparison function for am_SinkType_s
- */
- struct sortBySinkID
- {
- bool operator()(const am_SinkType_s & a, const am_SinkType_s & b)
- {
- return (a.sinkID < b.sinkID);
- }
- };
-
- /**
- * used as comparison function for am_SourceType_s
- */
- struct sortBySourceID
- {
- bool operator()(const am_SourceType_s & a, const am_SourceType_s & b)
- {
- return (a.sourceID < b.sourceID);
- }
- };
-
-};
-
-}
-
-#endif /* DBUSCOMMANDSENDER_H_ */
diff --git a/PluginCommandInterfaceDbus/include/CAmDbusMessageHandler.h b/PluginCommandInterfaceDbus/include/CAmDbusMessageHandler.h
deleted file mode 100644
index 8360bff..0000000
--- a/PluginCommandInterfaceDbus/include/CAmDbusMessageHandler.h
+++ /dev/null
@@ -1,123 +0,0 @@
-/**
- * Copyright (c) 2012 BMW
- *
- * \author Christian Mueller, christian.ei.mueller@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 _DBUSMESSAGEHANDLER_H_
-#define _DBUSMESSAGEHANDLER_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 CAmDbusMessageHandler
-{
-public:
- CAmDbusMessageHandler();
- ~CAmDbusMessageHandler();
-
- /**
- * 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_int16_t getInt();
- dbus_bool_t getBool();
- char getByte();
- double getDouble();
- char* getString();
- void getProperty(dbus_int16_t& type, dbus_int16_t& value);
- void getNotificationConfiguration(dbus_int16_t& type, dbus_int16_t& status, dbus_int16_t& parameter);
-
- /**
- * the overloaded append function appends different datatypes to the dbusmessage
- */
- void append(dbus_int16_t toAppend);
- void append(dbus_uint16_t toAppend);
- void append(char toAppend);
- void append(bool toAppend);
- void append(double toAppend);
- 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);
- void append(const std::vector<am::am_NotificationConfiguration_s>& listNotifications);
- void append(const am::am_NotificationPayload_s& notificationPayload);
- void append(const am::am_NotificationConfiguration_s& notificationConfiguration);
-
-private:
-
- DBusMessageIter mDBusMessageIter;
- DBusError mDBusError;
- dbus_uint32_t mSerial;
- std::string mErrorName;
- std::string mErrorMsg;
- DBusMessage* mpDBusMessage;
- DBusMessage* mpReveiveMessage;
- DBusConnection* mpDBusConnection;
-};
-
-}
-
-#endif // _DBUSMESSAGEWRAPPER_H_
diff --git a/PluginCommandInterfaceDbus/include/CommandInterface.xml b/PluginCommandInterfaceDbus/include/CommandInterface.xml
deleted file mode 100644
index bab2604..0000000
--- a/PluginCommandInterfaceDbus/include/CommandInterface.xml
+++ /dev/null
@@ -1,226 +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.commandinterface">
- <method name="Connect">
- <arg type="q" name="sourceID" direction="in"/>
- <arg type="q" name="sinkID" direction="in"/>
- <arg type="n" name="result" direction="out"/> <!-- method return code (am_Error_e) -->
- <arg type="q" name="mainConnectionID" direction="out"/>
- </method>
-
- <method name="Disconnect">
- <arg type="q" name="mainConnectionID" direction="in"/>
- <arg type="n" name="result" direction="out"/> <!-- method return code (am_Error_e) -->
- </method>
-
- <method name="SetVolume">
- <arg type="q" name="sinkID" direction="in"/>
- <arg type="n" name="volume" direction="in"/>
- <arg type="n" name="result" direction="out"/> <!-- method return code (am_Error_e) -->
- </method>
-
- <method name="VolumeStep">
- <arg type="q" name="sinkID" direction="in"/>
- <arg type="n" name="volumeStep" direction="in"/>
- <arg type="n" name="result" direction="out"/> <!-- method return code (am_Error_e) -->
- </method>
-
- <method name="SetSinkMuteState">
- <arg type="q" name="sinkID" direction="in"/>
- <arg type="n" name="muteState" direction="in"/>
- <arg type="n" name="result" direction="out"/> <!-- method return code (am_Error_e) -->
- </method>
-
- <method name="SetMainSinkSoundProperty">
- <arg type="q" name="sinkID" direction="in"/>
- <arg type="(nn)" name="soundProperty" direction="in"/>
- <arg type="n" name="result" direction="out"/> <!-- method return code (am_Error_e) -->
- </method>
-
- <method name="SetMainSourceSoundProperty">
- <arg type="q" name="sourceID" direction="in"/>
- <arg type="(nn)" name="soundProperty" direction="in"/>
- <arg type="n" name="result" direction="out"/> <!-- method return code (am_Error_e) -->
- </method>
-
- <method name="SetSystemProperty">
- <arg type="(nn)" name="property" direction="in"/>
- <arg type="n" name="result" direction="out"/> <!-- method return code (am_Error_e) -->
- </method>
-
- <method name="GetListMainConnections">
- <arg type="n" name="result" direction="out"/> <!-- method return code (am_Error_e) -->
- <arg type="a(qqqnn)" name="listConnections" direction="out"/> <!-- am_mainConnectionID_t mainConnectionID; am_sourceID_t sourceID; am_sinkID_t sinkID; am_timeSync_t delay; am_ConnectionState_e connectionState; -->
- </method>
-
- <method name="GetListMainSinks">
- <arg type="n" name="result" direction="out"/> <!-- method return code (am_Error_e) -->
- <arg type="a(qs(nn)nnq)" name="listMainSinks" direction="out"/> <!-- am_sinkID_t sinkID; std::string name; am_Availability_s availability; am_mainVolume_t volume; am_MuteState_e muteState; am_sinkClass_t sinkClassID; -->
- </method>
-
- <method name="GetListMainSources">
- <arg type="n" name="result" direction="out"/> <!-- method return code (am_Error_e) -->
- <arg type="a(qs(nn)q)" name="listMainSources" direction="out"/> <!-- am_sourceID_t sourceID; std::string name; am_Availability_s availability; am_sourceClass_t sourceClassID; -->
- </method>
-
- <method name="GetListMainSinkSoundProperties">
- <arg type="q" name="sinkID" direction="in"/>
- <arg type="n" name="result" direction="out"/> <!-- method return code (am_Error_e) -->
- <arg type="a(nn)" name="listSoundProperties" direction="out"/> <!-- am_CustomMainSoundPropertyType_t type; int16_t value; -->
- </method>
-
- <method name="GetListMainSourceSoundProperties">
- <arg type="q" name="sourceID" direction="in"/>
- <arg type="n" name="result" direction="out"/> <!-- method return code (am_Error_e) -->
- <arg type="a(nn)" name="listSourceProperties" direction="out"/> <!-- am_CustomMainSoundPropertyType_t type; int16_t value; -->
- </method>
-
- <method name="GetListSourceClasses">
- <arg type="n" name="result" direction="out"/> <!-- method return code (am_Error_e) -->
- <arg type="a(qsa(nn))" name="listSourceClasses" direction="out"/> <!-- am_sourceClass_t SourceClassID; std::string name; std::vector<am_ClassProperty_s> listClassProperties; -->
- </method>
-
- <method name="GetListSinkClasses">
- <arg type="n" name="result" direction="out"/> <!-- method return code (am_Error_e) -->
- <arg type="a(qsa(nn))" name="listSinkClasses" direction="out"/> <!-- am_sourceClass_t SinkClassID; std::string name; std::vector<am_ClassProperty_s> listClassProperties; -->
- </method>
-
- <method name="GetListSystemProperties">
- <arg type="n" name="result" direction="out"/> <!-- method return code (am_Error_e) -->
- <arg type="a(nn)" name="listSystemProperties" direction="out"/> <!-- am_SystemProperty_e type; int16_t value; -->
- </method>
-
- <method name="GetTimingInformation">
- <arg type="q" name="mainConnectionID" direction="in"/>
- <arg type="n" name="result" direction="out"/> <!-- method return code (am_Error_e) -->
- <arg type="n" name="delay" direction="out"/>
- </method>
-
- <method name="GetListSinkMainNotificationConfigurations">
- <arg type="q" name="sinkID" direction="in"/>
- <arg type="n" name="result" direction="out"/> <!-- method return code (am_Error_e) -->
- <arg type="a(nnn)" name="listMainNotificationConfigurations" direction="out"/> <!-- am_am_notification_e type; am_status_e status; int16t parameter; -->
- </method>
-
- <method name="GetListSourceMainNotificationConfigurations">
- <arg type="q" name="sourceID" direction="in"/>
- <arg type="n" name="result" direction="out"/> <!-- method return code (am_Error_e) -->
- <arg type="a(nnn)" name="listMainNotificationConfigurations" direction="out"/> <!-- am_am_notification_e type; am_status_e status; int16t parameter; -->
- </method>
-
- <method name="setMainSinkNotificationConfiguration">
- <arg type="q" name="sinkID" direction="in"/>
- <arg type="(nnn)" name="mainNotificationConfiguration" direction="in"/> <!-- am_am_notification_e type; am_status_e status; int16t parameter; -->
- <arg type="n" name="error" direction="out"/>
- </method>
-
- <method name="setMainSourceNotificationConfiguration">
- <arg type="q" name="sourceID" direction="in"/>
- <arg type="(nnn)" name="mainNotificationConfiguration" direction="in"/> <!-- am_am_notification_e type; am_status_e status; int16t parameter; -->
- <arg type="n" name="error" direction="out"/>
- </method>
-
- <signal name="NumberOfMainConnectionsChanged"></signal>
-
- <signal name="SinkAdded">
- <arg type="(qs(nn)nnq)" name="newSink" direction="out"/> <!-- am_sinkID_t sinkID; std::string name; am_Availability_s availability; am_mainVolume_t volume; am_MuteState_e muteState; am_sinkClass_t sinkClassID; -->
- </signal>
-
- <signal name="SinkRemoved">
- <arg type="q" name="removedSinkID" direction="out"/>
- </signal>
-
- <signal name="SourceAdded">
- <arg type="(qs(nn)q)" name="newSource" direction="out"/> <!-- am_sourceID_t sourceID; std::string name; am_Availability_s availability; am_sourceClass_t sourceClassID; -->
- </signal>
-
- <signal name="SourceRemoved">
- <arg type="q" name="removedSourceID" direction="out"/>
- </signal>
-
- <signal name="NumberOfSinkClassesChanged">
- </signal>
-
- <signal name="NumberOfSourceClassesChanged">
- </signal>
-
- <signal name="MainConnectionStateChanged">
- <arg type="q" name="connectionID" direction="out"/>
- <arg type="n" name="connectionState" direction="out"/>
- </signal>
-
- <signal name="MainSinkSoundPropertyChanged">
- <arg type="q" name="sinkID" direction="out"/>
- <arg type="(nn)" name="SoundProperty" direction="out"/>
- </signal>
-
- <signal name="MainSourceSoundPropertyChanged">
- <arg type="q" name="sourceID" direction="out"/>
- <arg type="(nn)" name="SoundProperty" direction="out"/>
- </signal>
-
- <signal name="SinkAvailabilityChanged">
- <arg type="q" name="sinkID" direction="out"/>
- <arg type="(nn)" name="availability" direction="out"/>
- </signal>
-
- <signal name="SourceAvailabilityChanged">
- <arg type="q" name="sourceID" direction="out"/>
- <arg type="(nn)" name="availability" direction="out"/>
- </signal>
-
- <signal name="VolumeChanged">
- <arg type="q" name="sinkID" direction="out"/>
- <arg type="n" name="volume" direction="out"/>
- </signal>
-
- <signal name="SinkMuteStateChanged">
- <arg type="q" name="sinkID" direction="out"/>
- <arg type="n" name="muteState" direction="out"/>
- </signal>
-
- <signal name="SystemPropertyChanged">
- <arg type="(nn)" name="SystemProperty" direction="out"/>
- </signal>
-
- <signal name="TimingInformationChanged">
- <arg type="q" name="mainConnection" direction="out"/>
- <arg type="n" name="time" direction="out"/>
- </signal>
-
- <signal name="SinkUpdated">
- <arg type="q" name="sinkID" direction="out"/>
- <arg type="q" name="sinkClassID" direction="out"/>
- <arg type="a(nn)" name="listMainSinkProperties" direction="out"/> <!-- am_CustomMainSoundPropertyType_t type; int16_t value; -->
- </signal>
-
- <signal name="SourceUpdated">
- <arg type="q" name="sourceID" direction="out"/>
- <arg type="q" name="sourceClassID" direction="out"/>
- <arg type="a(nn)" name="listMainSinkProperties" direction="out"/> <!-- am_CustomMainSoundPropertyType_t type; int16_t value; -->
- </signal>
-
- <signal name="SourceNotification">
- <arg type="q" name="sourceID" direction="out"/>
- <arg type="(nn)" name="notificationPayload" direction="out"/> <!-- am_notification_e type; int16_t value; -->
- </signal>
-
- <signal name="SinkNotification">
- <arg type="q" name="sinkID" direction="out"/>
- <arg type="(nn)" name="notificationPayload" direction="out"/> <!-- am_notification_e type; int16_t value; -->
- </signal>
-
- <signal name="SinkMainNotificationConfigurationChanged">
- <arg type="q" name="sinkID" direction="out"/>
- <arg type="(nnn)" name="mainNotificationConfiguration" direction="out"/> <!-- am_am_notification_e type; am_status_e status; int16t parameter; -->
- </signal>
-
- <signal name="SourceMainNotificationConfigurationChanged">
- <arg type="q" name="sourceID" direction="out"/>
- <arg type="(nnn)" name="mainNotificationConfiguration" direction="out"/> <!-- am_am_notification_e type; am_status_e status; int16t parameter; -->
- </signal>
- </interface>
-</node>
diff --git a/PluginCommandInterfaceDbus/include/IAmCommandReceiverShadow.h b/PluginCommandInterfaceDbus/include/IAmCommandReceiverShadow.h
deleted file mode 100644
index c582ee6..0000000
--- a/PluginCommandInterfaceDbus/include/IAmCommandReceiverShadow.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/**
- * Copyright (c) 2012 BMW
- *
- * \author Christian Mueller, christian.ei.mueller@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 COMMANDRECEIVERSHADOW_H_
-#define COMMANDRECEIVERSHADOW_H_
-
-
-
-#include <dbus/dbus.h>
-#include <map>
-#include "config.h"
-#include "command/IAmCommandReceive.h"
-#include "CAmDbusMessageHandler.h"
-#include "shared/CAmDbusWrapper.h"
-
-namespace am
-{
-
-class IAmCommandReceiverShadow;
-
-typedef void (IAmCommandReceiverShadow::*CallBackMethod)(DBusConnection *connection, DBusMessage *message);
-
-/**
- * receives the DBus Callbacks, marhsalls and demarshalls the parameters and calls CommandReceive
- */
-class IAmCommandReceiverShadow
-{
-public:
- IAmCommandReceiverShadow();
- virtual ~IAmCommandReceiverShadow();
- void connect(DBusConnection *conn, DBusMessage *msg);
- void disconnect(DBusConnection *conn, DBusMessage *msg);
- void setVolume(DBusConnection *conn, DBusMessage *msg);
- void volumeStep(DBusConnection *conn, DBusMessage *msg);
- void setSinkMuteState(DBusConnection *conn, DBusMessage *msg);
- void setMainSinkSoundProperty(DBusConnection *conn, DBusMessage *msg);
- void setMainSourceSoundProperty(DBusConnection *conn, DBusMessage *msg);
- void setSystemProperty(DBusConnection *conn, DBusMessage *msg);
- void getListMainConnections(DBusConnection *conn, DBusMessage *msg);
- void getListMainSinks(DBusConnection *conn, DBusMessage *msg);
- void getListMainSources(DBusConnection *conn, DBusMessage *msg);
- void getListMainSinkSoundProperties(DBusConnection *conn, DBusMessage *msg);
- void getListMainSourceSoundProperties(DBusConnection *conn, DBusMessage *msg);
- void getListSourceClasses(DBusConnection *conn, DBusMessage *msg);
- void getListSinkClasses(DBusConnection *conn, DBusMessage *msg);
- void getListSystemProperties(DBusConnection *conn, DBusMessage *msg);
- void getTimingInformation(DBusConnection *conn, DBusMessage *msg);
- void getListSinkMainNotificationConfigurations(DBusConnection *conn, DBusMessage *msg);
- void getListSourceMainNotificationConfigurations(DBusConnection *conn, DBusMessage *msg);
- void setSinkMainNotificationConfiguration(DBusConnection *conn, DBusMessage *msg);
- void setSourceMainNotificationConfiguration(DBusConnection *conn, DBusMessage *msg);
-
- /**
- * sets the pointer to the CommandReceiveInterface and registers Callback
- * @param receiver
- */
- void setCommandReceiver(IAmCommandReceive*& receiver);
-private:
- typedef std::map<std::string, CallBackMethod> functionMap_t;
- functionMap_t mFunctionMap;
- CAmDbusMessageHandler mDBUSMessageHandler;
- IAmCommandReceive* mpIAmCommandReceive;
- CAmDbusWrapper* mpCAmDbusWrapper;
-
- /**
- * 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 CommandReceiverShadow
- * @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 /* COMMANDRECEIVERSHADOW_H_ */
diff --git a/PluginCommandInterfaceDbus/include/configCommandDbus.h b/PluginCommandInterfaceDbus/include/configCommandDbus.h
deleted file mode 100644
index 8761936..0000000
--- a/PluginCommandInterfaceDbus/include/configCommandDbus.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef _COMMANDDBUS_CONFIG_H
-#define _COMMANDDBUS_CONFIG_H
-
-#define COMMAND_DBUS_INTROSPECTION_FILE "/home/genius/workspace/AudioManager/bin/CommandInterface.xml"
-#define LIBRARY_OUTPUT_PATH "/home/genius/workspace/AudioManager/bin/plugins/command"
-
-#endif /* _COMMANDDBUS_CONFIG_H */
diff --git a/PluginCommandInterfaceDbus/src/CAmCommandSenderDbus.cpp b/PluginCommandInterfaceDbus/src/CAmCommandSenderDbus.cpp
deleted file mode 100644
index eebfc00..0000000
--- a/PluginCommandInterfaceDbus/src/CAmCommandSenderDbus.cpp
+++ /dev/null
@@ -1,401 +0,0 @@
-/**
- * Copyright (c) 2012 BMW
- *
- * \author Christian Mueller, christian.ei.mueller@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 "CAmCommandSenderDbus.h"
-#include <algorithm>
-#include <string>
-#include <vector>
-#include <cassert>
-#include <set>
-#include "CAmDbusMessageHandler.h"
-#include "shared/CAmDltWrapper.h"
-
-
-using namespace am;
-DLT_DECLARE_CONTEXT(commandDbus)
-
-
-/**
- * factory for plugin loading
- */
-extern "C" IAmCommandSend* PluginCommandInterfaceDbusFactory()
-{
- CAmDltWrapper::instance()->registerContext(commandDbus, "DBP", "DBus Plugin");
- return (new CAmCommandSenderDbus());
-}
-
-/**
- * destroy instance of commandSendInterface
- */
-extern "C" void destroyRoutingPluginInterfaceDbus(IAmCommandSend* commandSendInterface)
-{
- delete commandSendInterface;
-}
-
-CAmCommandSenderDbus::CAmCommandSenderDbus() :
- mCAmDbusMessageHandler(), //
- mIAmCommandReceiverShadow(), //
- mpCAmDbusWrapper(NULL), //
- mpIAmCommandReceive(NULL), //
- mReady(false)
-{
- log(&commandDbus, DLT_LOG_INFO, "DbusCommandSender constructor called");
-}
-
-CAmCommandSenderDbus::~CAmCommandSenderDbus()
-{
- log(&commandDbus, DLT_LOG_INFO, "DbusCommandSender destructed");
- CAmDltWrapper::instance()->unregisterContext(commandDbus);
-}
-
-am_Error_e CAmCommandSenderDbus::startupInterface(IAmCommandReceive* commandreceiveinterface)
-{
- log(&commandDbus, DLT_LOG_INFO, "startupInterface called");
-
- mpIAmCommandReceive = commandreceiveinterface;
- mIAmCommandReceiverShadow.setCommandReceiver(mpIAmCommandReceive);
- mpIAmCommandReceive->getDBusConnectionWrapper(mpCAmDbusWrapper);
- assert(mpCAmDbusWrapper!=NULL);
- DBusConnection * connection;
- mpCAmDbusWrapper->getDBusConnection(connection);
- assert(connection!=NULL);
- mCAmDbusMessageHandler.setDBusConnection(connection);
- return (E_OK);
-}
-
-void CAmCommandSenderDbus::setCommandReady(const uint16_t handle)
-{
- //todo:implement handle handling
- log(&commandDbus, DLT_LOG_INFO, "cbCommunicationReady called");
- mReady = true;
- mpIAmCommandReceive->confirmCommandReady(handle,E_OK);
-}
-
-void CAmCommandSenderDbus::setCommandRundown(const uint16_t handle)
-{
- log(&commandDbus, DLT_LOG_INFO, "cbCommunicationRundown called");
- mReady = false;
- mpIAmCommandReceive->confirmCommandRundown(handle,E_OK);
- /**
- * todo: implement DbusCommandSender::cbCommunicationRundown()
- */
-}
-
-void CAmCommandSenderDbus::cbNewMainConnection(const am_MainConnectionType_s& mainConnection)
-{
- (void)mainConnection;
- //todo: change xml and interface to differetiate between new connection and removed one
- log(&commandDbus, DLT_LOG_INFO, "cbNumberOfMainConnectionsChanged called");
-
- if (mReady)
- {
- mCAmDbusMessageHandler.initSignal(std::string(MY_NODE), std::string("NumberOfMainConnectionsChanged"));
- mCAmDbusMessageHandler.sendMessage();
- }
-}
-
-void CAmCommandSenderDbus::cbRemovedMainConnection(const am_mainConnectionID_t mainConnection)
-{
- (void)mainConnection;
-//todo: change xml and interface to differetiate between new connection and removed one
- log(&commandDbus, DLT_LOG_INFO, "cbNumberOfMainConnectionsChanged called");
-
- if (mReady)
- {
- mCAmDbusMessageHandler.initSignal(std::string(MY_NODE), std::string("NumberOfMainConnectionsChanged"));
- mCAmDbusMessageHandler.sendMessage();
- }
-}
-
-void CAmCommandSenderDbus::cbNewSink(const am_SinkType_s& sink)
-{
- log(&commandDbus, DLT_LOG_INFO, "cbNewSink called");
-
- if (mReady)
- {
- mCAmDbusMessageHandler.initSignal(std::string(MY_NODE), "SinkAdded");
- mCAmDbusMessageHandler.append(sink);
-
- log(&commandDbus, DLT_LOG_INFO, "send signal SinkAdded");
- mCAmDbusMessageHandler.sendMessage();
- }
-}
-
-void CAmCommandSenderDbus::cbRemovedSink(const am_sinkID_t sinkID)
-{
- //todo: check if this really works!
- log(&commandDbus, DLT_LOG_INFO, "cbRemovedSink called");
-
- if (mReady)
- {
- mCAmDbusMessageHandler.initSignal(std::string(MY_NODE), "SinkRemoved");
- mCAmDbusMessageHandler.append(sinkID);
-
- log(&commandDbus, DLT_LOG_INFO, "send signal SinkRemoved");
- mCAmDbusMessageHandler.sendMessage();
- }
-}
-
-void CAmCommandSenderDbus::cbNewSource(const am_SourceType_s& source)
-{
- log(&commandDbus, DLT_LOG_INFO, "cbNewSource called");
-
- if (mReady)
- {
- mCAmDbusMessageHandler.initSignal(std::string(MY_NODE), "SourceAdded");
- mCAmDbusMessageHandler.append(source);
-
- log(&commandDbus, DLT_LOG_INFO, "send signal SourceAdded");
- mCAmDbusMessageHandler.sendMessage();
- }
-}
-
-void am::CAmCommandSenderDbus::cbRemovedSource(const am_sourceID_t source)
-{
- if (mReady)
- {
- mCAmDbusMessageHandler.initSignal(std::string(MY_NODE), "SourceRemoved");
- mCAmDbusMessageHandler.append(source);
-
- log(&commandDbus, DLT_LOG_INFO, "send signal SourceRemoved");
-
- mCAmDbusMessageHandler.sendMessage();
- }
-}
-
-void CAmCommandSenderDbus::cbNumberOfSinkClassesChanged()
-{
- log(&commandDbus, DLT_LOG_INFO, "cbNumberOfSinkClassesChanged called");
-
- if (mReady)
- {
- mCAmDbusMessageHandler.initSignal(std::string(MY_NODE), std::string("NumberOfSinkClassesChanged"));
- mCAmDbusMessageHandler.sendMessage();
- }
-}
-
-void CAmCommandSenderDbus::cbNumberOfSourceClassesChanged()
-{
- log(&commandDbus, DLT_LOG_INFO, "cbNumberOfSourceClassesChanged called");
-
- if (mReady)
- {
- mCAmDbusMessageHandler.initSignal(std::string(MY_NODE), std::string("NumberOfSourceClassesChanged"));
- mCAmDbusMessageHandler.sendMessage();
- }
-}
-
-void CAmCommandSenderDbus::cbMainConnectionStateChanged(const am_mainConnectionID_t connectionID, const am_ConnectionState_e connectionState)
-{
- log(&commandDbus, DLT_LOG_INFO, "cbMainConnectionStateChanged called, connectionID=", connectionID, "connectionState=", connectionState);
-
- if (mReady)
- {
- mCAmDbusMessageHandler.initSignal(std::string(MY_NODE), std::string("MainConnectionStateChanged"));
- mCAmDbusMessageHandler.append((dbus_uint16_t) connectionID);
- mCAmDbusMessageHandler.append((dbus_int16_t) connectionState);
- mCAmDbusMessageHandler.sendMessage();
- }
-}
-
-void CAmCommandSenderDbus::cbMainSinkSoundPropertyChanged(const am_sinkID_t sinkID, const am_MainSoundProperty_s & soundProperty)
-{
- log(&commandDbus, DLT_LOG_INFO, "cbMainSinkSoundPropertyChanged called, sinkID", sinkID, "SoundProperty.type", soundProperty.type, "SoundProperty.value", soundProperty.value);
-
- if (mReady)
- {
- mCAmDbusMessageHandler.initSignal(std::string(MY_NODE), std::string("MainSinkSoundPropertyChanged"));
- mCAmDbusMessageHandler.append((dbus_uint16_t) sinkID);
- mCAmDbusMessageHandler.append(soundProperty);
- mCAmDbusMessageHandler.sendMessage();
- }
-}
-
-void CAmCommandSenderDbus::cbMainSourceSoundPropertyChanged(const am_sourceID_t sourceID, const am_MainSoundProperty_s & SoundProperty)
-{
- log(&commandDbus, DLT_LOG_INFO, "cbMainSourceSoundPropertyChanged called, sourceID", sourceID, "SoundProperty.type", SoundProperty.type, "SoundProperty.value", SoundProperty.value);
-
- if (mReady)
- {
- mCAmDbusMessageHandler.initSignal(std::string(MY_NODE), std::string("MainSourceSoundPropertyChanged"));
- mCAmDbusMessageHandler.append((dbus_uint16_t) sourceID);
- mCAmDbusMessageHandler.append(SoundProperty);
- mCAmDbusMessageHandler.sendMessage();
- }
-}
-
-void CAmCommandSenderDbus::cbSinkAvailabilityChanged(const am_sinkID_t sinkID, const am_Availability_s & availability)
-{
- log(&commandDbus, DLT_LOG_INFO, "cbSinkAvailabilityChanged called, sinkID", sinkID, "availability.availability", availability.availability, "SoundProperty.reason", availability.availabilityReason);
-
- if (mReady)
- {
- mCAmDbusMessageHandler.initSignal(std::string(MY_NODE), std::string("SinkAvailabilityChanged"));
- mCAmDbusMessageHandler.append((dbus_uint16_t) sinkID);
- mCAmDbusMessageHandler.append(availability);
- mCAmDbusMessageHandler.sendMessage();
- }
-}
-
-void CAmCommandSenderDbus::cbSourceAvailabilityChanged(const am_sourceID_t sourceID, const am_Availability_s & availability)
-{
- log(&commandDbus, DLT_LOG_INFO, "cbSourceAvailabilityChanged called, sourceID", sourceID, "availability.availability", availability.availability, "SoundProperty.reason", availability.availabilityReason);
-
- if (mReady)
- {
- mCAmDbusMessageHandler.initSignal(std::string(MY_NODE), std::string("SourceAvailabilityChanged"));
- mCAmDbusMessageHandler.append((dbus_uint16_t) sourceID);
- mCAmDbusMessageHandler.append(availability);
- mCAmDbusMessageHandler.sendMessage();
- }
-}
-
-void CAmCommandSenderDbus::cbVolumeChanged(const am_sinkID_t sinkID, const am_mainVolume_t volume)
-{
- log(&commandDbus, DLT_LOG_INFO, "cbVolumeChanged called, sinkID", sinkID, "volume", volume);
-
- if (mReady)
- {
- mCAmDbusMessageHandler.initSignal(std::string(MY_NODE), std::string("VolumeChanged"));
- mCAmDbusMessageHandler.append((dbus_uint16_t) sinkID);
- mCAmDbusMessageHandler.append((dbus_int16_t) volume);
- mCAmDbusMessageHandler.sendMessage();
- }
-}
-
-void CAmCommandSenderDbus::cbSinkMuteStateChanged(const am_sinkID_t sinkID, const am_MuteState_e muteState)
-{
- log(&commandDbus, DLT_LOG_INFO, "cbSinkMuteStateChanged called, sinkID", sinkID, "muteState", muteState);
-
- if (mReady)
- {
- mCAmDbusMessageHandler.initSignal(std::string(MY_NODE), std::string("SinkMuteStateChanged"));
- mCAmDbusMessageHandler.append((dbus_uint16_t) sinkID);
- mCAmDbusMessageHandler.append((dbus_int16_t) muteState);
- mCAmDbusMessageHandler.sendMessage();
- }
-}
-
-void CAmCommandSenderDbus::cbSystemPropertyChanged(const am_SystemProperty_s & SystemProperty)
-{
- log(&commandDbus, DLT_LOG_INFO, "cbSystemPropertyChanged called, SystemProperty.type", SystemProperty.type, "SystemProperty.value", SystemProperty.value);
-
- if (mReady)
- {
- mCAmDbusMessageHandler.initSignal(std::string(MY_NODE), std::string("SystemPropertyChanged"));
- mCAmDbusMessageHandler.append(SystemProperty);
- mCAmDbusMessageHandler.sendMessage();
- }
-}
-
-void am::CAmCommandSenderDbus::cbTimingInformationChanged(const am_mainConnectionID_t mainConnectionID, const am_timeSync_t time)
-{
- log(&commandDbus, DLT_LOG_INFO, "cbTimingInformationChanged called, mainConnectionID=", mainConnectionID, "time=", time);
-
- if (mReady)
- {
- mCAmDbusMessageHandler.initSignal(std::string(MY_NODE), std::string("TimingInformationChanged"));
- mCAmDbusMessageHandler.append((dbus_uint16_t) mainConnectionID);
- mCAmDbusMessageHandler.append((dbus_int16_t) time);
- mCAmDbusMessageHandler.sendMessage();
- }
-}
-
-void CAmCommandSenderDbus::getInterfaceVersion(std::string & version) const
-{
- version = CommandSendVersion;
-}
-
-void am::CAmCommandSenderDbus::cbSinkUpdated(const am_sinkID_t sinkID, const am_sinkClass_t sinkClassID, const std::vector<am_MainSoundProperty_s>& listMainSoundProperties)
-{
- log(&commandDbus, DLT_LOG_INFO, "cbSinkUpdated called, sinkID", sinkID);
-
- if (mReady)
- {
- mCAmDbusMessageHandler.initSignal(std::string(MY_NODE), std::string("SinkUpdated"));
- mCAmDbusMessageHandler.append(static_cast<dbus_uint16_t>(sinkID));
- mCAmDbusMessageHandler.append(static_cast<dbus_uint16_t>(sinkClassID));
- mCAmDbusMessageHandler.append(listMainSoundProperties);
- mCAmDbusMessageHandler.sendMessage();
- }
-}
-
-void am::CAmCommandSenderDbus::cbSourceUpdated(const am_sourceID_t sourceID, const am_sourceClass_t sourceClassID, const std::vector<am_MainSoundProperty_s>& listMainSoundProperties)
-{
- log(&commandDbus, DLT_LOG_INFO, "cbSourceUpdated called, sourceID", sourceID);
-
- if (mReady)
- {
- mCAmDbusMessageHandler.initSignal(std::string(MY_NODE), std::string("SinkUpdated"));
- mCAmDbusMessageHandler.append(static_cast<dbus_uint16_t>(sourceID));
- mCAmDbusMessageHandler.append(static_cast<dbus_uint16_t>(sourceClassID));
- mCAmDbusMessageHandler.append(listMainSoundProperties);
- mCAmDbusMessageHandler.sendMessage();
- }
-}
-
-void am::CAmCommandSenderDbus::cbSinkNotification(const am_sinkID_t sinkID, const am_NotificationPayload_s& notification)
-{
- log(&commandDbus, DLT_LOG_INFO, "cbSinkNotification called, sinkID", sinkID);
-
- if (mReady)
- {
- mCAmDbusMessageHandler.initSignal(std::string(MY_NODE), std::string("SinkNotification"));
- mCAmDbusMessageHandler.append(static_cast<dbus_uint16_t>(sinkID));
- mCAmDbusMessageHandler.append(notification);
- mCAmDbusMessageHandler.sendMessage();
- }
-}
-
-void am::CAmCommandSenderDbus::cbSourceNotification(const am_sourceID_t sourceID, const am_NotificationPayload_s& notification)
-{
- log(&commandDbus, DLT_LOG_INFO, "cbSourceNotification called, sourceID", sourceID);
-
- if (mReady)
- {
- mCAmDbusMessageHandler.initSignal(std::string(MY_NODE), std::string("SourceNotification"));
- mCAmDbusMessageHandler.append(static_cast<dbus_uint16_t>(sourceID));
- mCAmDbusMessageHandler.append(notification);
- mCAmDbusMessageHandler.sendMessage();
- }
-}
-
-void am::CAmCommandSenderDbus::cbMainSinkNotificationConfigurationChanged(const am_sinkID_t sinkID, const am_NotificationConfiguration_s& mainNotificationConfiguration)
-{
- log(&commandDbus, DLT_LOG_INFO, "cbSinkMainNotificationConfigurationChanged called, sinkID", sinkID);
-
- if (mReady)
- {
- mCAmDbusMessageHandler.initSignal(std::string(MY_NODE), std::string("SinkMainNotificationConfigurationChanged"));
- mCAmDbusMessageHandler.append(static_cast<dbus_uint16_t>(sinkID));
- mCAmDbusMessageHandler.append(mainNotificationConfiguration);
- mCAmDbusMessageHandler.sendMessage();
- }
-}
-
-void am::CAmCommandSenderDbus::cbMainSourceNotificationConfigurationChanged(const am_sourceID_t sourceID, const am_NotificationConfiguration_s& mainNotificationConfiguration)
-{
- log(&commandDbus, DLT_LOG_INFO, "cbSourceMainNotificationConfigurationChanged called, sourceID", sourceID);
-
- if (mReady)
- {
- mCAmDbusMessageHandler.initSignal(std::string(MY_NODE), std::string("SinkMainNotificationConfigurationChanged"));
- mCAmDbusMessageHandler.append(static_cast<dbus_uint16_t>(sourceID));
- mCAmDbusMessageHandler.append(mainNotificationConfiguration);
- mCAmDbusMessageHandler.sendMessage();
- }
-}
diff --git a/PluginCommandInterfaceDbus/src/CAmDbusMessageHandler.cpp b/PluginCommandInterfaceDbus/src/CAmDbusMessageHandler.cpp
deleted file mode 100644
index 491239a..0000000
--- a/PluginCommandInterfaceDbus/src/CAmDbusMessageHandler.cpp
+++ /dev/null
@@ -1,709 +0,0 @@
-/**
- * Copyright (c) 2012 BMW
- *
- * \author Christian Mueller, christian.ei.mueller@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 "config.h"
-#include <cstdlib>
-#include <cassert>
-#include <vector>
-#include "CAmCommandSenderDbus.h"
-#include "shared/CAmDltWrapper.h"
-
-DLT_IMPORT_CONTEXT(commandDbus)
-
-namespace am
-{
-
-CAmDbusMessageHandler::CAmDbusMessageHandler() :
- mDBusMessageIter(), //
- mDBusError(), //
- mSerial(0), //
- mErrorName(""), //
- mErrorMsg(""), //
- mpDBusMessage(NULL), //
- mpReveiveMessage(NULL), //
- mpDBusConnection(NULL)
-{
- // CAmDltWrapper::instance()->registerContext(commandDbus, "DBP", "DBus Plugin");
- log(&commandDbus, DLT_LOG_INFO, "DBusMessageHandler constructed");
-}
-
-CAmDbusMessageHandler::~CAmDbusMessageHandler()
-{
- log(&commandDbus, DLT_LOG_INFO, "DBUSMessageHandler destructed");
-}
-
-void CAmDbusMessageHandler::initReceive(DBusMessage* msg)
-{
- assert(msg!=NULL);
- mpReveiveMessage = msg;
- if (!dbus_message_iter_init(msg, &mDBusMessageIter))
- {
- log(&commandDbus, DLT_LOG_INFO, "DBusMessageHandler::initReceive DBus Message has no arguments!");
- mErrorName = std::string(DBUS_ERROR_INVALID_ARGS);
- mErrorMsg = "DBUS Message has no arguments!";
- }
-}
-
-void CAmDbusMessageHandler::initReply(DBusMessage* msg)
-{
- assert(msg!=NULL);
- mpDBusMessage = dbus_message_new_method_return(msg);
- if (mpDBusMessage == NULL)
- {
- log(&commandDbus, 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 CAmDbusMessageHandler::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) + "." + MY_NODE;
- mpDBusMessage = dbus_message_new_signal(completePath.c_str(), completeInterface.c_str(), signalName.c_str());
-
- if (mpDBusMessage == NULL)
- {
- log(&commandDbus, DLT_LOG_ERROR, "DBusMessageHandler::initSignal Cannot allocate DBus message!");
- }
- dbus_message_iter_init_append(mpDBusMessage, &mDBusMessageIter);
-}
-
-void CAmDbusMessageHandler::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(&commandDbus, DLT_LOG_ERROR, "DBusMessageHandler::sendMessage cannot send message!");
- }
- dbus_connection_flush(mpDBusConnection);
- dbus_message_unref(mpDBusMessage);
- mpDBusMessage = NULL;
- mpReveiveMessage = NULL;
-}
-
-char* CAmDbusMessageHandler::getString()
-{
- char* param = NULL;
-
- if (DBUS_TYPE_STRING != dbus_message_iter_get_arg_type(&mDBusMessageIter))
- {
- log(&commandDbus, 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(&mDBusMessageIter, &param);
- dbus_message_iter_next(&mDBusMessageIter);
- }
- return (param);
-}
-
-dbus_bool_t CAmDbusMessageHandler::getBool()
-{
- dbus_bool_t boolparam = false;
-
- if (DBUS_TYPE_BOOLEAN != dbus_message_iter_get_arg_type(&mDBusMessageIter))
- {
- log(&commandDbus, 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(&mDBusMessageIter, &boolparam);
- dbus_message_iter_next(&mDBusMessageIter);
- }
- return (boolparam);
-}
-
-char CAmDbusMessageHandler::getByte()
-{
- char param(0);
-
- if (DBUS_TYPE_BYTE != dbus_message_iter_get_arg_type(&mDBusMessageIter))
- {
- log(&commandDbus, 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(&mDBusMessageIter, &param);
- dbus_message_iter_next(&mDBusMessageIter);
- }
- return (param);
-}
-
-dbus_uint16_t CAmDbusMessageHandler::getUInt()
-{
- dbus_uint16_t param(0);
-
-#ifdef GLIB_DBUS_TYPES_TOLERANT
- if (DBUS_TYPE_UINT16 != dbus_message_iter_get_arg_type(&mDBusMessageIter) && DBUS_TYPE_UINT32 != dbus_message_iter_get_arg_type(&mDBusMessageIter))
-#else
- if (DBUS_TYPE_UINT16 != dbus_message_iter_get_arg_type(&mDBusMessageIter))
-#endif
- {
- log(&commandDbus, 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(&mDBusMessageIter, &param);
- dbus_message_iter_next(&mDBusMessageIter);
- }
- return (param);
-}
-
-dbus_int16_t CAmDbusMessageHandler::getInt()
-{
- dbus_int16_t param(0);
-
-#ifdef GLIB_DBUS_TYPES_TOLERANT
- if (DBUS_TYPE_INT16 != dbus_message_iter_get_arg_type(&mDBusMessageIter) && DBUS_TYPE_INT32 != dbus_message_iter_get_arg_type(&mDBusMessageIter))
-#else
- if (DBUS_TYPE_INT16 != dbus_message_iter_get_arg_type(&mDBusMessageIter))
-#endif
- {
- log(&commandDbus, 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(&mDBusMessageIter, &param);
- dbus_message_iter_next(&mDBusMessageIter);
- }
- return (param);
-}
-
-double CAmDbusMessageHandler::getDouble()
-{
- double param(0);
- if (DBUS_TYPE_DOUBLE != dbus_message_iter_get_arg_type(&mDBusMessageIter))
- {
- log(&commandDbus, 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(&mDBusMessageIter, &param);
- dbus_message_iter_next(&mDBusMessageIter);
- }
- return (param);
-}
-
-void CAmDbusMessageHandler::getProperty(dbus_int16_t & type, dbus_int16_t & value)
-{
- DBusMessageIter arrayIter;
- if (DBUS_TYPE_STRUCT != dbus_message_iter_get_arg_type(&mDBusMessageIter))
- {
- log(&commandDbus, 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
- {
- dbus_message_iter_recurse(&mDBusMessageIter, &arrayIter);
- dbus_message_iter_get_basic(&arrayIter, &type);
- dbus_message_iter_next(&arrayIter);
- dbus_message_iter_get_basic(&arrayIter, &value);
- dbus_message_iter_next(&mDBusMessageIter);
- }
-}
-
-void CAmDbusMessageHandler::append(bool toAppend)
-{
- dbus_bool_t mybool = toAppend;
- if (!dbus_message_iter_append_basic(&mDBusMessageIter, DBUS_TYPE_BOOLEAN, &mybool))
- {
- log(&commandDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
- mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
- mErrorMsg = "Cannot create reply!";
- }
-}
-
-void CAmDbusMessageHandler::append(double toAppend)
-{
- if (!dbus_message_iter_append_basic(&mDBusMessageIter, DBUS_TYPE_DOUBLE, &toAppend))
- {
- log(&commandDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
- mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
- mErrorMsg = "Cannot create reply!";
- }
-}
-
-void CAmDbusMessageHandler::append(char toAppend)
-{
- if (!dbus_message_iter_append_basic(&mDBusMessageIter, DBUS_TYPE_BYTE, &toAppend))
- {
- log(&commandDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
- mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
- mErrorMsg = "Cannot create reply!";
- }
-}
-
-void CAmDbusMessageHandler::append(dbus_int16_t toAppend)
-{
- if (!dbus_message_iter_append_basic(&mDBusMessageIter, DBUS_TYPE_INT16, &toAppend))
- {
- log(&commandDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
- mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
- mErrorMsg = "Cannot create reply!";
- }
-}
-
-void CAmDbusMessageHandler::append(dbus_uint16_t toAppend)
-{
- if (!dbus_message_iter_append_basic(&mDBusMessageIter, DBUS_TYPE_UINT16, &toAppend))
- {
- log(&commandDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
- mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
- mErrorMsg = "Cannot create reply!";
- }
-}
-
-void CAmDbusMessageHandler::setDBusConnection(DBusConnection *& connection)
-{
- assert(connection!=NULL);
- mpDBusConnection = connection;
-}
-
-void CAmDbusMessageHandler::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(&commandDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
- mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
- mErrorMsg = "Cannot create reply!";
- }
-}
-
-void CAmDbusMessageHandler::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(&commandDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
- mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
- mErrorMsg = "Cannot create reply!";
- }
-}
-
-void CAmDbusMessageHandler::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(&commandDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
- mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
- mErrorMsg = "Cannot create reply!";
- }
-}
-
-void CAmDbusMessageHandler::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(&commandDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
- mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
- mErrorMsg = "Cannot create reply!";
- }
-}
-
-void CAmDbusMessageHandler::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(&commandDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
- mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
- mErrorMsg = "Cannot create reply!";
- }
-}
-
-void CAmDbusMessageHandler::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(&commandDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
- mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
- mErrorMsg = "Cannot create reply!";
- }
-}
-
-void CAmDbusMessageHandler::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(&commandDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
- mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
- mErrorMsg = "Cannot create reply!";
- }
-}
-
-void CAmDbusMessageHandler::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(&commandDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
- mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
- mErrorMsg = "Cannot create reply!";
- }
-}
-
-void CAmDbusMessageHandler::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(&commandDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
- mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
- mErrorMsg = "Cannot create reply!";
- }
-}
-
-void CAmDbusMessageHandler::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(&commandDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
- mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
- mErrorMsg = "Cannot create reply!";
- }
-}
-
-void CAmDbusMessageHandler::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(&commandDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
- mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
- mErrorMsg = "Cannot create reply!";
- }
-}
-
-void CAmDbusMessageHandler::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(&commandDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
- mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
- mErrorMsg = "Cannot create reply!";
- }
-}
-
-void CAmDbusMessageHandler::getNotificationConfiguration(dbus_int16_t& type, dbus_int16_t& status, dbus_int16_t& parameter)
-{
- DBusMessageIter arrayIter;
- if (DBUS_TYPE_STRUCT != dbus_message_iter_get_arg_type(&mDBusMessageIter))
- {
- log(&commandDbus, 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
- {
- dbus_message_iter_recurse(&mDBusMessageIter, &arrayIter);
- dbus_message_iter_get_basic(&arrayIter, &type);
- dbus_message_iter_next(&arrayIter);
- dbus_message_iter_get_basic(&arrayIter, &status);
- dbus_message_iter_next(&arrayIter);
- dbus_message_iter_get_basic(&arrayIter, &parameter);
- dbus_message_iter_next(&mDBusMessageIter);
- }
-}
-
-void CAmDbusMessageHandler::append(const std::vector<am::am_NotificationConfiguration_s>& listNotifications)
-{
- DBusMessageIter arrayIter;
- DBusMessageIter structIter;
- std::vector<am::am_NotificationConfiguration_s>::const_iterator listIterator = listNotifications.begin();
- dbus_bool_t success = true;
-
- success = success && dbus_message_iter_open_container(&mDBusMessageIter, DBUS_TYPE_ARRAY, "(nnn)", &arrayIter);
- for (; listIterator < listNotifications.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->status);
- success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &listIterator->parameter);
- success = success && dbus_message_iter_close_container(&arrayIter, &structIter);
- }
- success = success && dbus_message_iter_close_container(&mDBusMessageIter, &arrayIter);
-
- if (!success)
- {
- log(&commandDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
- mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
- mErrorMsg = "Cannot create reply!";
- }
-}
-
-void CAmDbusMessageHandler::append(const am::am_NotificationPayload_s& notificationPayload)
-{
- 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, &notificationPayload.type);
- success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &notificationPayload.value);
- success = success && dbus_message_iter_close_container(&mDBusMessageIter, &structIter);
-
- if (!success)
- {
- log(&commandDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
- mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
- mErrorMsg = "Cannot create reply!";
- }
-}
-
-void CAmDbusMessageHandler::append(const am::am_NotificationConfiguration_s& notificationConfiguration)
-{
- 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, &notificationConfiguration.type);
- success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &notificationConfiguration.status);
- success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &notificationConfiguration.parameter);
- success = success && dbus_message_iter_close_container(&mDBusMessageIter, &structIter);
-
- if (!success)
- {
- log(&commandDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
- mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
- mErrorMsg = "Cannot create reply!";
- }
-}
-
-}
diff --git a/PluginCommandInterfaceDbus/src/IAmCommandReceiverShadow.cpp b/PluginCommandInterfaceDbus/src/IAmCommandReceiverShadow.cpp
deleted file mode 100644
index 11cacb4..0000000
--- a/PluginCommandInterfaceDbus/src/IAmCommandReceiverShadow.cpp
+++ /dev/null
@@ -1,526 +0,0 @@
-/**
- * Copyright (c) 2012 BMW
- *
- * \author Christian Mueller, christian.ei.mueller@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 "IAmCommandReceiverShadow.h"
-#include <string>
-#include <fstream>
-#include <stdexcept>
-#include <cassert>
-#include "audiomanagertypes.h"
-#include "CAmCommandSenderDbus.h"
-#include "shared/CAmDltWrapper.h"
-#include "configCommandDbus.h"
-
-using namespace am;
-
-DLT_IMPORT_CONTEXT(commandDbus)
-
-/**
- * static ObjectPathTable is needed for DBus Callback handling
- */
-static DBusObjectPathVTable gObjectPathVTable;
-
-IAmCommandReceiverShadow::IAmCommandReceiverShadow() :
- mFunctionMap(createMap()), //
- mDBUSMessageHandler(), //
- mpIAmCommandReceive(NULL), //
- mpCAmDbusWrapper(NULL)
-{
- log(&commandDbus, DLT_LOG_INFO, "CommandReceiverShadow constructed");
-}
-
-IAmCommandReceiverShadow::~IAmCommandReceiverShadow()
-{
- log(&commandDbus, DLT_LOG_INFO, "CommandReceiverShadow destructed");
-}
-
-void IAmCommandReceiverShadow::connect(DBusConnection *conn, DBusMessage *msg)
-{
- log(&commandDbus, DLT_LOG_INFO, "CommandReceiverShadow::connect called");
-
- (void) conn;
- assert(mpIAmCommandReceive!=NULL);
-
- mDBUSMessageHandler.initReceive(msg);
- am_sourceID_t sourceID = (am_sourceID_t) mDBUSMessageHandler.getUInt();
- am_sinkID_t sinkID = (am_sinkID_t) mDBUSMessageHandler.getUInt();
- am_mainConnectionID_t mainConnectionID = 0;
- am_Error_e returnCode = mpIAmCommandReceive->connect(sourceID, sinkID, mainConnectionID);
- mDBUSMessageHandler.initReply(msg);
- mDBUSMessageHandler.append((dbus_int16_t) returnCode);
- mDBUSMessageHandler.append((dbus_uint16_t) mainConnectionID);
- mDBUSMessageHandler.sendMessage();
-}
-
-void IAmCommandReceiverShadow::disconnect(DBusConnection *conn, DBusMessage *msg)
-{
- log(&commandDbus, DLT_LOG_INFO, "CommandReceiverShadow::disconnect called");
-
- (void) conn;
- assert(mpIAmCommandReceive!=NULL);
-
- mDBUSMessageHandler.initReceive(msg);
- am_mainConnectionID_t mainConnnectionID = (am_mainConnectionID_t) mDBUSMessageHandler.getUInt();
- am_Error_e returnCode = mpIAmCommandReceive->disconnect(mainConnnectionID);
- mDBUSMessageHandler.initReply(msg);
- mDBUSMessageHandler.append((dbus_int16_t) returnCode);
- mDBUSMessageHandler.sendMessage();
-}
-
-void IAmCommandReceiverShadow::setVolume(DBusConnection *conn, DBusMessage *msg)
-{
- log(&commandDbus, DLT_LOG_INFO, "CommandReceiverShadow::setVolume called");
-
- (void) conn;
- assert(mpIAmCommandReceive!=NULL);
-
- mDBUSMessageHandler.initReceive(msg);
- am_sinkID_t sinkID = (am_sinkID_t) mDBUSMessageHandler.getUInt();
- am_volume_t volume = (am_volume_t) mDBUSMessageHandler.getInt();
- am_Error_e returnCode = mpIAmCommandReceive->setVolume(sinkID, volume);
- mDBUSMessageHandler.initReply(msg);
- mDBUSMessageHandler.append((dbus_int16_t) returnCode);
- mDBUSMessageHandler.sendMessage();
-}
-
-void IAmCommandReceiverShadow::volumeStep(DBusConnection *conn, DBusMessage *msg)
-{
- log(&commandDbus, DLT_LOG_INFO, "CommandReceiverShadow::volumeStep called");
-
- (void) conn;
- assert(mpIAmCommandReceive!=NULL);
-
- mDBUSMessageHandler.initReceive(msg);
- am_sinkID_t sinkID = (am_sinkID_t) mDBUSMessageHandler.getUInt();
- int16_t volumeStep = (int16_t) mDBUSMessageHandler.getInt();
- am_Error_e returnCode = mpIAmCommandReceive->volumeStep(sinkID, volumeStep);
- mDBUSMessageHandler.initReply(msg);
- mDBUSMessageHandler.append((dbus_int16_t) returnCode);
- mDBUSMessageHandler.sendMessage();
-}
-
-void IAmCommandReceiverShadow::setSinkMuteState(DBusConnection *conn, DBusMessage *msg)
-{
- log(&commandDbus, DLT_LOG_INFO, "CommandReceiverShadow::setSinkMuteState called");
-
- (void) conn;
- assert(mpIAmCommandReceive!=NULL);
-
- mDBUSMessageHandler.initReceive(msg);
- am_sinkID_t sinkID = (am_sinkID_t) mDBUSMessageHandler.getUInt();
- am_MuteState_e muteState = (am_MuteState_e) mDBUSMessageHandler.getInt();
- am_Error_e returnCode = mpIAmCommandReceive->setSinkMuteState(sinkID, muteState);
- mDBUSMessageHandler.initReply(msg);
- mDBUSMessageHandler.append((dbus_int16_t) returnCode);
- mDBUSMessageHandler.sendMessage();
-}
-
-void IAmCommandReceiverShadow::setMainSinkSoundProperty(DBusConnection *conn, DBusMessage *msg)
-{
- log(&commandDbus, DLT_LOG_INFO, "CommandReceiverShadow::setMainSinkSoundProperty called");
-
- (void) conn;
- assert(mpIAmCommandReceive!=NULL);
-
- mDBUSMessageHandler.initReceive(msg);
- am_sinkID_t sinkID = (am_sinkID_t) mDBUSMessageHandler.getUInt();
- dbus_int16_t type = 0;
- dbus_int16_t value = 0;
- mDBUSMessageHandler.getProperty(type, value);
- am_MainSoundProperty_s mainSoundProperty;
- mainSoundProperty.type = (am_CustomMainSoundPropertyType_t) type;
- mainSoundProperty.value = (int32_t) value;
- am_Error_e returnCode = mpIAmCommandReceive->setMainSinkSoundProperty(mainSoundProperty, sinkID);
- mDBUSMessageHandler.initReply(msg);
- mDBUSMessageHandler.append((dbus_int16_t) returnCode);
- mDBUSMessageHandler.sendMessage();
-}
-
-void IAmCommandReceiverShadow::setMainSourceSoundProperty(DBusConnection *conn, DBusMessage *msg)
-{
- log(&commandDbus, DLT_LOG_INFO, "CommandReceiverShadow::setMainSourceSoundProperty called");
-
- (void) conn;
- assert(mpIAmCommandReceive!=NULL);
-
- mDBUSMessageHandler.initReceive(msg);
- am_sourceID_t sourceID = (am_sinkID_t) mDBUSMessageHandler.getUInt();
- dbus_int16_t type = 0;
- dbus_int16_t value = 0;
- mDBUSMessageHandler.getProperty(type, value);
- am_MainSoundProperty_s mainSoundProperty;
- mainSoundProperty.type = (am_CustomMainSoundPropertyType_t) type;
- mainSoundProperty.value = (int32_t) value;
- am_Error_e returnCode = mpIAmCommandReceive->setMainSourceSoundProperty(mainSoundProperty, sourceID);
- mDBUSMessageHandler.initReply(msg);
- mDBUSMessageHandler.append((dbus_int16_t) returnCode);
- mDBUSMessageHandler.sendMessage();
-}
-
-void IAmCommandReceiverShadow::setSystemProperty(DBusConnection *conn, DBusMessage *msg)
-{
- log(&commandDbus, DLT_LOG_INFO, "CommandReceiverShadow::setSystemProperty called");
-
- (void) conn;
- assert(mpIAmCommandReceive!=NULL);
-
- mDBUSMessageHandler.initReceive(msg);
- dbus_int16_t type = 0;
- dbus_int16_t value = 0;
- mDBUSMessageHandler.getProperty(type, value);
- am_SystemProperty_s systemProperty;
- systemProperty.type = (am_CustomSystemPropertyType_t) type;
- systemProperty.value = (int32_t) value;
- am_Error_e returnCode = mpIAmCommandReceive->setSystemProperty(systemProperty);
- mDBUSMessageHandler.initReply(msg);
- mDBUSMessageHandler.append((dbus_int16_t) returnCode);
- mDBUSMessageHandler.sendMessage();
-}
-
-void IAmCommandReceiverShadow::getListMainConnections(DBusConnection *conn, DBusMessage *msg)
-{
- log(&commandDbus, DLT_LOG_INFO, "CommandReceiverShadow::getListMainConnections called");
-
- (void) conn;
- assert(mpIAmCommandReceive!=NULL);
- std::vector<am_MainConnectionType_s> listMainConnections;
- am_Error_e returnCode = mpIAmCommandReceive->getListMainConnections(listMainConnections);
- mDBUSMessageHandler.initReply(msg);
- mDBUSMessageHandler.append((dbus_int16_t) returnCode);
- mDBUSMessageHandler.append(listMainConnections);
- mDBUSMessageHandler.sendMessage();
-}
-
-void IAmCommandReceiverShadow::getListMainSinks(DBusConnection *conn, DBusMessage *msg)
-{
- log(&commandDbus, DLT_LOG_INFO, "CommandReceiverShadow::getListMainSinks called");
-
- (void) conn;
- assert(mpIAmCommandReceive!=NULL);
- std::vector<am_SinkType_s> listSinks;
- am_Error_e returnCode = mpIAmCommandReceive->getListMainSinks(listSinks);
- mDBUSMessageHandler.initReply(msg);
- mDBUSMessageHandler.append((dbus_int16_t) returnCode);
- mDBUSMessageHandler.append(listSinks);
- mDBUSMessageHandler.sendMessage();
-}
-
-void IAmCommandReceiverShadow::getListMainSources(DBusConnection *conn, DBusMessage *msg)
-{
- log(&commandDbus, DLT_LOG_INFO, "CommandReceiverShadow::getListMainSources called");
-
- (void) conn;
- assert(mpIAmCommandReceive!=NULL);
- std::vector<am_SourceType_s> listSources;
- am_Error_e returnCode = mpIAmCommandReceive->getListMainSources(listSources);
- mDBUSMessageHandler.initReply(msg);
- mDBUSMessageHandler.append((dbus_int16_t) returnCode);
- mDBUSMessageHandler.append(listSources);
- mDBUSMessageHandler.sendMessage();
-}
-
-void IAmCommandReceiverShadow::getListMainSinkSoundProperties(DBusConnection *conn, DBusMessage *msg)
-{
- log(&commandDbus, DLT_LOG_INFO, "CommandReceiverShadow::getListMainSinkSoundProperties called");
-
- (void) conn;
- assert(mpIAmCommandReceive!=NULL);
-
- mDBUSMessageHandler.initReceive(msg);
- am_sinkID_t sinkID = (am_sinkID_t) mDBUSMessageHandler.getUInt();
- std::vector<am_MainSoundProperty_s> listSinkSoundProperties;
- am_Error_e returnCode = mpIAmCommandReceive->getListMainSinkSoundProperties(sinkID, listSinkSoundProperties);
- mDBUSMessageHandler.initReply(msg);
- mDBUSMessageHandler.append((dbus_int16_t) returnCode);
- mDBUSMessageHandler.append(listSinkSoundProperties);
- mDBUSMessageHandler.sendMessage();
-}
-
-void IAmCommandReceiverShadow::getListMainSourceSoundProperties(DBusConnection *conn, DBusMessage *msg)
-{
- log(&commandDbus, DLT_LOG_INFO, "CommandReceiverShadow::getListMainSourceSoundProperties called");
-
- (void) conn;
- assert(mpIAmCommandReceive!=NULL);
-
- mDBUSMessageHandler.initReceive(msg);
- am_sourceID_t sourceID = (am_sourceID_t) mDBUSMessageHandler.getUInt();
- std::vector<am_MainSoundProperty_s> listSinkSoundProperties;
- am_Error_e returnCode = mpIAmCommandReceive->getListMainSourceSoundProperties(sourceID, listSinkSoundProperties);
- mDBUSMessageHandler.initReply(msg);
- mDBUSMessageHandler.append((dbus_int16_t) returnCode);
- mDBUSMessageHandler.append(listSinkSoundProperties);
- mDBUSMessageHandler.sendMessage();
-}
-
-void IAmCommandReceiverShadow::getListSourceClasses(DBusConnection *conn, DBusMessage *msg)
-{
- log(&commandDbus, DLT_LOG_INFO, "CommandReceiverShadow::getListSourceClasses called");
-
- (void) conn;
- assert(mpIAmCommandReceive!=NULL);
- std::vector<am_SourceClass_s> listSourceClasses;
- am_Error_e returnCode = mpIAmCommandReceive->getListSourceClasses(listSourceClasses);
- mDBUSMessageHandler.initReply(msg);
- mDBUSMessageHandler.append((dbus_int16_t) returnCode);
- mDBUSMessageHandler.append(listSourceClasses);
- mDBUSMessageHandler.sendMessage();
-}
-
-void IAmCommandReceiverShadow::getListSinkClasses(DBusConnection *conn, DBusMessage *msg)
-{
- log(&commandDbus, DLT_LOG_INFO, "CommandReceiverShadow::getListSinkClasses called");
-
- (void) conn;
- assert(mpIAmCommandReceive!=NULL);
- std::vector<am_SinkClass_s> listSinkClasses;
- am_Error_e returnCode = mpIAmCommandReceive->getListSinkClasses(listSinkClasses);
- mDBUSMessageHandler.initReply(msg);
- mDBUSMessageHandler.append((dbus_int16_t) returnCode);
- mDBUSMessageHandler.append(listSinkClasses);
- mDBUSMessageHandler.sendMessage();
-}
-
-void IAmCommandReceiverShadow::getListSystemProperties(DBusConnection *conn, DBusMessage *msg)
-{
- log(&commandDbus, DLT_LOG_INFO, "CommandReceiverShadow::getListSystemProperties called");
-
- (void) conn;
- assert(mpIAmCommandReceive!=NULL);
- std::vector<am_SystemProperty_s> listSystemProperties;
- am_Error_e returnCode = mpIAmCommandReceive->getListSystemProperties(listSystemProperties);
- mDBUSMessageHandler.initReply(msg);
- mDBUSMessageHandler.append((dbus_int16_t) returnCode);
- mDBUSMessageHandler.append(listSystemProperties);
- mDBUSMessageHandler.sendMessage();
-}
-
-void IAmCommandReceiverShadow::getTimingInformation(DBusConnection *conn, DBusMessage *msg)
-{
- log(&commandDbus, DLT_LOG_INFO, "CommandReceiverShadow::getTimingInformation called");
-
- (void) conn;
- assert(mpIAmCommandReceive!=NULL);
-
- mDBUSMessageHandler.initReceive(msg);
- am_mainConnectionID_t mainConnectionID = (am_mainConnectionID_t) mDBUSMessageHandler.getUInt();
- am_timeSync_t delay = 0;
- am_Error_e returnCode = mpIAmCommandReceive->getTimingInformation(mainConnectionID, delay);
- mDBUSMessageHandler.initReply(msg);
- mDBUSMessageHandler.append((dbus_int16_t) returnCode);
- mDBUSMessageHandler.append((dbus_int16_t) delay);
- mDBUSMessageHandler.sendMessage();
-}
-
-DBusHandlerResult IAmCommandReceiverShadow::receiveCallback(DBusConnection *conn, DBusMessage *msg, void *user_data)
-{
- assert(conn!=NULL);
- assert(msg!=NULL);
- assert(user_data!=NULL);
- IAmCommandReceiverShadow* reference = (IAmCommandReceiverShadow*) user_data;
- return (reference->receiveCallbackDelegate(conn, msg));
-}
-
-void IAmCommandReceiverShadow::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(COMMAND_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))
- {
- // DLT_LOG(DLT_CONTEXT,DLT_LOG_ERROR, DLT_STRING("DBUS handler Out Of Memory!"));
- }
-
- // send the reply && flush the connection
- if (!dbus_connection_send(conn, reply, &serial))
- {
- // DLT_LOG(DLT_CONTEXT,DLT_LOG_ERROR, DLT_STRING("DBUS handler Out Of Memory!"));
- }
- dbus_connection_flush(conn);
-
- // free the reply
- dbus_message_unref(reply);
-}
-
-DBusHandlerResult IAmCommandReceiverShadow::receiveCallbackDelegate(DBusConnection *conn, DBusMessage *msg)
-{
- //DLT_LOG(dMain, DLT_LOG_INFO, DLT_STRING("message received"));
-
- 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));
- 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 IAmCommandReceiverShadow::setCommandReceiver(IAmCommandReceive*& receiver)
-{
- assert(receiver!=NULL);
- mpIAmCommandReceive = receiver;
-
- gObjectPathVTable.message_function = IAmCommandReceiverShadow::receiveCallback;
-
- DBusConnection* connection;
- mpIAmCommandReceive->getDBusConnectionWrapper(mpCAmDbusWrapper);
- assert(mpCAmDbusWrapper!=NULL);
-
- mpCAmDbusWrapper->getDBusConnection(connection);
- assert(connection!=NULL);
- mDBUSMessageHandler.setDBusConnection(connection);
-
- std::string path(MY_NODE);
- mpCAmDbusWrapper->registerCallback(&gObjectPathVTable, path, this);
-}
-
-void am::IAmCommandReceiverShadow::getListSinkMainNotificationConfigurations(DBusConnection* conn, DBusMessage* msg)
-{
- log(&commandDbus, DLT_LOG_INFO, "CommandReceiverShadow::getListSinkMainNotificationConfigurations called");
-
- (void) conn;
- assert(mpIAmCommandReceive!=NULL);
-
- mDBUSMessageHandler.initReceive(msg);
- am_sinkID_t sinkID = static_cast<am_sinkID_t>(mDBUSMessageHandler.getUInt());
- std::vector<am_NotificationConfiguration_s> listNotificationConfigurations;
- am_Error_e returnCode = mpIAmCommandReceive->getListMainSinkNotificationConfigurations(sinkID,listNotificationConfigurations);
- mDBUSMessageHandler.initReply(msg);
- mDBUSMessageHandler.append((dbus_int16_t) returnCode);
- mDBUSMessageHandler.append(listNotificationConfigurations);
- mDBUSMessageHandler.sendMessage();
-}
-
-void am::IAmCommandReceiverShadow::getListSourceMainNotificationConfigurations(DBusConnection* conn, DBusMessage* msg)
-{
- log(&commandDbus, DLT_LOG_INFO, "CommandReceiverShadow::getListSourceMainNotificationConfigurations called");
-
- (void) conn;
- assert(mpIAmCommandReceive!=NULL);
-
- mDBUSMessageHandler.initReceive(msg);
- am_sourceID_t sourceID = static_cast<am_sourceID_t>(mDBUSMessageHandler.getUInt());
- std::vector<am_NotificationConfiguration_s> listNotificationConfigurations;
- am_Error_e returnCode = mpIAmCommandReceive->getListMainSourceNotificationConfigurations(sourceID,listNotificationConfigurations);
- mDBUSMessageHandler.initReply(msg);
- mDBUSMessageHandler.append((dbus_int16_t) returnCode);
- mDBUSMessageHandler.append(listNotificationConfigurations);
- mDBUSMessageHandler.sendMessage();
-
-}
-
-void am::IAmCommandReceiverShadow::setSinkMainNotificationConfiguration(DBusConnection* conn, DBusMessage* msg)
-{
- log(&commandDbus, DLT_LOG_INFO, "CommandReceiverShadow::setSinkMainNotificationConfiguration called");
-
- (void) conn;
- assert(mpIAmCommandReceive!=NULL);
-
- mDBUSMessageHandler.initReceive(msg);
- am_sinkID_t sinkID = (am_sinkID_t) mDBUSMessageHandler.getUInt();
- dbus_int16_t type = 0;
- dbus_int16_t status = 0;
- dbus_int16_t parameter = 0;
- mDBUSMessageHandler.getNotificationConfiguration(type, status, parameter);
- am_NotificationConfiguration_s mainNotificationConfiguration;
- mainNotificationConfiguration.type = static_cast<am_CustomNotificationType_t> (type);
- mainNotificationConfiguration.status = static_cast<am_NotificationStatus_e> (status);
- mainNotificationConfiguration.parameter = static_cast<int16_t>(parameter);
- am_Error_e returnCode = mpIAmCommandReceive->setMainSinkNotificationConfiguration(sinkID,mainNotificationConfiguration);
- mDBUSMessageHandler.initReply(msg);
- mDBUSMessageHandler.append((dbus_int16_t) returnCode);
- mDBUSMessageHandler.sendMessage();
-}
-
-void am::IAmCommandReceiverShadow::setSourceMainNotificationConfiguration(DBusConnection* conn, DBusMessage* msg)
-{
- log(&commandDbus, DLT_LOG_INFO, "CommandReceiverShadow::setSourceMainNotificationConfiguration called");
-
- (void) conn;
- assert(mpIAmCommandReceive!=NULL);
-
- mDBUSMessageHandler.initReceive(msg);
- am_sourceID_t sourceID = (am_sourceID_t) mDBUSMessageHandler.getUInt();
- dbus_int16_t type = 0;
- dbus_int16_t status = 0;
- dbus_int16_t parameter = 0;
- mDBUSMessageHandler.getNotificationConfiguration(type, status, parameter);
- am_NotificationConfiguration_s mainNotificationConfiguration;
- mainNotificationConfiguration.type = static_cast<am_CustomNotificationType_t> (type);
- mainNotificationConfiguration.status = static_cast<am_NotificationStatus_e> (status);
- mainNotificationConfiguration.parameter = static_cast<int16_t>(parameter);
- am_Error_e returnCode = mpIAmCommandReceive->setMainSourceNotificationConfiguration(sourceID,mainNotificationConfiguration);
- mDBUSMessageHandler.initReply(msg);
- mDBUSMessageHandler.append((dbus_int16_t) returnCode);
- mDBUSMessageHandler.sendMessage();
-}
-
-IAmCommandReceiverShadow::functionMap_t IAmCommandReceiverShadow::createMap()
-{
- functionMap_t m;
- m["Connect"] = &IAmCommandReceiverShadow::connect;
- m["Disconnect"] = &IAmCommandReceiverShadow::disconnect;
- m["SetVolume"] = &IAmCommandReceiverShadow::setVolume;
- m["VolumeStep"] = &IAmCommandReceiverShadow::volumeStep;
- m["SetSinkMuteState"] = &IAmCommandReceiverShadow::setSinkMuteState;
- m["SetMainSinkSoundProperty"] = &IAmCommandReceiverShadow::setMainSinkSoundProperty;
- m["SetMainSourceSoundProperty"] = &IAmCommandReceiverShadow::setMainSourceSoundProperty;
- m["GetListMainConnections"] = &IAmCommandReceiverShadow::getListMainConnections;
- m["GetListMainSinks"] = &IAmCommandReceiverShadow::getListMainSinks;
- m["GetListMainSources"] = &IAmCommandReceiverShadow::getListMainSources;
- m["GetListMainSinkSoundProperties"] = &IAmCommandReceiverShadow::getListMainSinkSoundProperties;
- m["GetListMainSourceSoundProperties"] = &IAmCommandReceiverShadow::getListMainSourceSoundProperties;
- m["GetListSourceClasses"] = &IAmCommandReceiverShadow::getListSourceClasses;
- m["GetListSinkClasses"] = &IAmCommandReceiverShadow::getListSinkClasses;
- m["GetListSystemProperties"] = &IAmCommandReceiverShadow::getListSystemProperties;
- m["GetTimingInformation"] = &IAmCommandReceiverShadow::getTimingInformation;
- m["SetSystemProperty"] = &IAmCommandReceiverShadow::setSystemProperty;
- m["getListSinkMainNotificationConfigurations"] = &IAmCommandReceiverShadow::getListSinkMainNotificationConfigurations;
- m["getListSourceMainNotificationConfigurations"] = &IAmCommandReceiverShadow::getListSourceMainNotificationConfigurations;
- m["setSinkMainNotificationConfiguration"] = &IAmCommandReceiverShadow::setSinkMainNotificationConfiguration;
- m["setSourceMainNotificationConfiguration"] = & IAmCommandReceiverShadow::setSourceMainNotificationConfiguration;
- return (m);
-}
-
diff --git a/PluginCommandInterfaceDbus/test/CAmCommandSenderDbusBackdoor.cpp b/PluginCommandInterfaceDbus/test/CAmCommandSenderDbusBackdoor.cpp
deleted file mode 100644
index f97c7b6..0000000
--- a/PluginCommandInterfaceDbus/test/CAmCommandSenderDbusBackdoor.cpp
+++ /dev/null
@@ -1,63 +0,0 @@
-/**
- * Copyright (c) 2012 BMW
- *
- * \author Christian Mueller, christian.ei.mueller@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 "CAmCommandSenderDbusBackdoor.h"
-#include "command/IAmCommandReceive.h"
-
-
-using namespace am;
-
-CAmCommandSenderDbusBackdoor::CAmCommandSenderDbusBackdoor()
-{
-}
-
-CAmCommandSenderDbusBackdoor::~CAmCommandSenderDbusBackdoor()
-{
-}
-
-void CAmCommandSenderDbusBackdoor::setReceiveInterface(CAmCommandSenderDbus *sender, IAmCommandReceive* interface)
-{
- sender->mpIAmCommandReceive=interface;
-}
-
-void CAmCommandSenderDbusBackdoor::setDbusConnection(CAmCommandSenderDbus *sender, DBusConnection *conn)
-{
- sender->mCAmDbusMessageHandler.setDBusConnection(conn);
-}
-
-void CAmCommandSenderDbusBackdoor::setListSinks(CAmCommandSenderDbus *sender, std::vector<am_SinkType_s> newList)
-{
- sender->mlistSinks=newList;
-}
-
-void CAmCommandSenderDbusBackdoor::setListSources(CAmCommandSenderDbus *sender, std::vector<am_SourceType_s> newList)
-{
- sender->mlistSources=newList;
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/PluginCommandInterfaceDbus/test/CAmCommandSenderDbusBackdoor.h b/PluginCommandInterfaceDbus/test/CAmCommandSenderDbusBackdoor.h
deleted file mode 100644
index 9aec152..0000000
--- a/PluginCommandInterfaceDbus/test/CAmCommandSenderDbusBackdoor.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/**
- * Copyright (c) 2012 BMW
- *
- * \author Christian Mueller, christian.ei.mueller@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 DBUSCOMMANDINTERFACEBACKDOOR_H_
-#define DBUSCOMMANDINTERFACEBACKDOOR_H_
-
-#include "../include/CAmCommandSenderDbus.h"
-#include <vector>
-#include <dbus/dbus.h>
-#include "audiomanagertypes.h"
-#include "command/IAmCommandReceive.h"
-
-namespace am {
-
-class CAmCommandSenderDbus;
-
-class CAmCommandSenderDbusBackdoor
-{
-public:
- CAmCommandSenderDbusBackdoor();
- virtual ~CAmCommandSenderDbusBackdoor();
- void setReceiveInterface(CAmCommandSenderDbus *sender, IAmCommandReceive* interface);
- void setDbusConnection(CAmCommandSenderDbus *sender,DBusConnection *conn);
- void setListSinks(CAmCommandSenderDbus *sender, std::vector<am_SinkType_s> newList);
- void setListSources(CAmCommandSenderDbus *sender, std::vector<am_SourceType_s> newList);
-};
-
-}
-
-#endif /* DBUSCOMMANDINTERFACEBACKDOOR_H_ */
diff --git a/PluginCommandInterfaceDbus/test/CAmCommandSenderDbusSignalTest.cpp b/PluginCommandInterfaceDbus/test/CAmCommandSenderDbusSignalTest.cpp
deleted file mode 100644
index e0d2b97..0000000
--- a/PluginCommandInterfaceDbus/test/CAmCommandSenderDbusSignalTest.cpp
+++ /dev/null
@@ -1,803 +0,0 @@
-/**
- * Copyright (c) 2012 BMW
- *
- * \author Christian Mueller, christian.ei.mueller@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 "CAmCommandSenderDbusSignalTest.h"
-#include <Python.h>
-#include <iostream>
-#include <fstream>
-#include <algorithm>
-#include <string>
-#include <vector>
-#include <set>
-#include "CAmCommandSenderDbusBackdoor.h"
-#include "MockIAmCommandReceive.h"
-#include "../include/CAmCommandSenderDbus.h"
-#include "../include/CAmDbusMessageHandler.h"
-#include "../../AudioManagerDaemon/include/TAmPluginTemplate.h"
-#include "shared/CAmDltWrapper.h"
-#include "configCommandDbus.h"
-
-using namespace am;
-using namespace testing;
-
-CAmCommandSenderDbusSignalTest::CAmCommandSenderDbusSignalTest() :
- ppCommandSend(NULL) //
-{
- CAmDltWrapper::instance()->registerApp("dbusTest", "dbusTest");
- logInfo("dbusCommandInterfaceSignalTest started");
-}
-
-CAmCommandSenderDbusSignalTest::~CAmCommandSenderDbusSignalTest()
-{
-}
-
-void* NumberOfMainConnectionsChanged(void* ppCommandSend)
-{
- sleep(3);
- IAmCommandSend* sender=static_cast<IAmCommandSend*>(ppCommandSend);
- am_MainConnectionType_s mainConnection;
- sender->cbNewMainConnection(mainConnection);
- return (NULL);
-}
-
-void* cbSinkAdded(void* ppCommandSend)
-{
- sleep(1);
- IAmCommandSend* sender=static_cast<IAmCommandSend*>(ppCommandSend);
- std::vector<am_SinkType_s> list;
- am_SinkType_s mysink;
- mysink.name = "MySink";
- mysink.sinkID = 23;
- mysink.availability.availability = A_MAX;
- mysink.availability.availabilityReason = AR_UNKNOWN;
- mysink.muteState = MS_UNKNOWN;
- mysink.sinkClassID = 3;
- mysink.volume = 234;
- sender->cbNewSink(mysink);
- return (NULL);
-}
-
-void* cbSourceAdded(void* ppCommandSend)
-{
- sleep(1);
- IAmCommandSend* sender=static_cast<IAmCommandSend*>(ppCommandSend);
- am_SourceType_s mysource;
- mysource.name = "MySink";
- mysource.sourceID = 42;
- mysource.availability.availability = A_MAX;
- mysource.availability.availabilityReason = AR_UNKNOWN;
- mysource.sourceClassID = 15;
- sender->cbNewSource(mysource);
- return (NULL);
-}
-
-void* cbSourceRemoved(void* ppCommandSend)
-{
- sleep(1);
- IAmCommandSend* sender=static_cast<IAmCommandSend*>(ppCommandSend);
- am_SourceType_s mysource;
- mysource.name = "MySink";
- mysource.sourceID = 42;
- sender->cbRemovedSource(mysource.sourceID);
- return (NULL);
-}
-
-void* cbSinkRemoved(void* ppCommandSend)
-{
- sleep(1);
- IAmCommandSend* sender=static_cast<IAmCommandSend*>(ppCommandSend);
- am_SinkType_s mysink;
- mysink.name = "MySink";
- mysink.sinkID = 23;
- sender->cbRemovedSink(mysink.sinkID);
- return (NULL);
-}
-
-void* NumberOfSinkClassesChanged(void* ppCommandSend)
-{
- sleep(1);
- IAmCommandSend* sender=static_cast<IAmCommandSend*>(ppCommandSend);
- sender->cbNumberOfSinkClassesChanged();
- return (NULL);
-}
-
-void* NumberOfSourceClassesChanged(void* ppCommandSend)
-{
- sleep(1);
- IAmCommandSend* sender=static_cast<IAmCommandSend*>(ppCommandSend);
- sender->cbNumberOfSourceClassesChanged();
- return (NULL);
-}
-
-void* MainConnectionStateChanged(void* ppCommandSend)
-{
- sleep(1);
- IAmCommandSend* sender=static_cast<IAmCommandSend*>(ppCommandSend);
- am_connectionID_t id = 4;
- am_ConnectionState_e state = CS_CONNECTING;
- sender->cbMainConnectionStateChanged(id, state);
- return (NULL);
-}
-
-void* MainSinkSoundPropertyChanged(void* ppCommandSend)
-{
- sleep(1);
- IAmCommandSend* sender=static_cast<IAmCommandSend*>(ppCommandSend);
- am_sinkID_t sinkID = 3;
- am_MainSoundProperty_s soundProperty;
- soundProperty.type = MSP_UNKNOWN;
- soundProperty.value = 23;
- sender->cbMainSinkSoundPropertyChanged(sinkID, soundProperty);
- return (NULL);
-}
-
-void* MainSourceSoundPropertyChanged(void* ppCommandSend)
-{
- sleep(1);
- IAmCommandSend* sender=static_cast<IAmCommandSend*>(ppCommandSend);
- am_sourceID_t sourceID = 35;
- am_MainSoundProperty_s soundProperty;
- soundProperty.type = MSP_UNKNOWN;
- soundProperty.value = 233;
- sender->cbMainSourceSoundPropertyChanged(sourceID, soundProperty);
- return (NULL);
-}
-
-void* cbSinkAvailabilityChangedLoop(void* ppCommandSend)
-{
- sleep(1);
- IAmCommandSend* sender=static_cast<IAmCommandSend*>(ppCommandSend);
- am_Availability_s av;
- av.availability = A_AVAILABLE;
- av.availabilityReason = AR_UNKNOWN;
- sender->cbSinkAvailabilityChanged(4, av);
- return (NULL);
-}
-
-void* VolumeChanged(void* ppCommandSend)
-{
- sleep(1);
- IAmCommandSend* sender=static_cast<IAmCommandSend*>(ppCommandSend);
- am_volume_t volume = 344;
- sender->cbVolumeChanged(23, volume);
- return (NULL);
-}
-
-void* cbSourceAvailabilityChangedLoop(void* ppCommandSend)
-{
- sleep(1);
- IAmCommandSend* sender=static_cast<IAmCommandSend*>(ppCommandSend);
- am_Availability_s av;
- av.availability = A_AVAILABLE;
- av.availabilityReason = AR_UNKNOWN;
- sender->cbSourceAvailabilityChanged(2, av);
- return (NULL);
-}
-
-void* SinkMuteStateChanged(void* ppCommandSend)
-{
- sleep(1);
- IAmCommandSend* sender=static_cast<IAmCommandSend*>(ppCommandSend);
- sender->cbSinkMuteStateChanged(42, MS_MUTED);
- return (NULL);
-}
-
-void* SystemPropertyChanged(void* ppCommandSend)
-{
- sleep(1);
- IAmCommandSend* sender=static_cast<IAmCommandSend*>(ppCommandSend);
- am_SystemProperty_s property;
- property.type = SYP_UNKNOWN;
- property.value = 355;
- sender->cbSystemPropertyChanged(property);
- return (NULL);
-}
-
-void* TimingInformationChanged(void* ppCommandSend)
-{
- sleep(1);
- IAmCommandSend* sender=static_cast<IAmCommandSend*>(ppCommandSend);
- sender->cbTimingInformationChanged(42, 233);
- return (NULL);
-}
-
-TEST_F(CAmCommandSenderDbusSignalTest,cbSourceAvailabilityChanged)
-{
-
- //ok, now we want to test the signals. It did not work out that the python receiver worked in an own thread (as originally intended)
- //so it is running in the main context and the signals are send from threads...
- CAmSocketHandler pSocketHandler;
- CAmDbusWrapper pDBusWrapper(&pSocketHandler);
- MockIAmCommandReceive pReceiveInterface;
-
- IAmCommandSend* (*createFunc)();
- void* tempLibHandle = NULL;
- std::string libname(LIBRARY_OUTPUT_PATH);
- libname.append("/libPluginCommandInterfaceDbus.so");
- createFunc = getCreateFunction<IAmCommandSend*()>(libname, tempLibHandle);
-
- if (!createFunc)
- {
- logError("CommandSendInterface Test Entry point of CommandPlugin not found");
- exit(1);
- }
-
- ppCommandSend = createFunc();
-
- if (!ppCommandSend)
- {
- logError("CommandSendInterface Test CommandPlugin initialization failed. Entry Function not callable");
- exit(1);
- }
-
- // ok, here we give the DBusWrapper pointer to the Plugin and start the interface
- EXPECT_CALL(pReceiveInterface,getDBusConnectionWrapper(_)).WillRepeatedly(DoAll(SetArgReferee<0>(&pDBusWrapper), Return(E_OK)));
- EXPECT_CALL(pReceiveInterface, confirmCommandReady(10,_));
-
- ppCommandSend->startupInterface(&pReceiveInterface);
- ppCommandSend->setCommandReady(10);
-
- pthread_t pythonloop;
- pthread_create(&pythonloop, NULL, NumberOfMainConnectionsChanged, (void*) ppCommandSend);
- PyRun_SimpleStringFlags("import sys\n"
- "import traceback\n"
- "import gobject\n"
- "import dbus\n"
- "import dbus.mainloop.glib\n"
- "print('Started thread') \n"
- "loop = gobject.MainLoop()\n"
- "def catchsignal(*arg, **kwarg):\n"
- " print ('Caught NumberOfMainConnectionsChanged') \n"
- " loop.quit()\n"
- "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n"
- "bus = dbus.SessionBus()\n"
- "bus.add_signal_receiver(catchsignal, signal_name='NumberOfMainConnectionsChanged', dbus_interface = 'org.genivi.audiomanager.commandinterface', message_keyword='dbus_message')\n"
- "print('Started thread') \n"
- "loop.run()\n", NULL);
- pthread_join(pythonloop, NULL);
-
- pthread_create(&pythonloop, NULL, cbSinkAdded, (void*) ppCommandSend);
- PyRun_SimpleStringFlags("import sys\n"
- "import traceback\n"
- "import gobject\n"
- "import dbus\n"
- "import dbus.mainloop.glib\n"
- "loop = gobject.MainLoop()\n"
- "def catchSinkAdded(*arg, **karg):\n"
- " print ('Caught signal (in SinkAdded handler) ') \n"
- " print (arg[0])\n"
- " f = open('/tmp/result.txt','w')\n"
- " f.write(str(arg[0]));\n"
- " f.close()\n"
- " loop.quit()\n"
- "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n"
- "bus = dbus.SessionBus()\n"
- "bus.add_signal_receiver(catchSinkAdded, signal_name='SinkAdded', dbus_interface = 'org.genivi.audiomanager.commandinterface', message_keyword='dbus_message')\n"
- "loop.run()\n", NULL);
- pthread_join(pythonloop, NULL);
-
- std::ifstream ifs("/tmp/result.txt");
- std::string line;
- int lineCounter = 0, result = 0;
- while (std::getline(ifs, line))
- {
- ASSERT_EQ(line.compare("dbus.Struct((dbus.UInt16(23), dbus.String(u'MySink'), dbus.Struct((dbus.Int16(3), dbus.Int16(0)), signature=None), dbus.Int16(234), dbus.Int16(0), dbus.UInt16(3)), signature=None)"), 0);
- }
- ifs.close();
-
- pthread_create(&pythonloop, NULL, cbSinkRemoved, (void*) ppCommandSend);
- PyRun_SimpleStringFlags("import sys\n"
- "import traceback\n"
- "import gobject\n"
- "import dbus\n"
- "import dbus.mainloop.glib\n"
- "loop = gobject.MainLoop()\n"
- "def catchSinkRemoved(*arg, **karg):\n"
- " print ('Caught signal (in SinkRemoved handler) ') \n"
- " print (arg[0])\n"
- " f = open('/tmp/result.txt','w')\n"
- " f.write(str(arg[0]));\n"
- " f.close()\n"
- " loop.quit()\n"
- "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n"
- "bus = dbus.SessionBus()\n"
- "bus.add_signal_receiver(catchSinkRemoved, signal_name='SinkRemoved', dbus_interface = 'org.genivi.audiomanager.commandinterface', message_keyword='dbus_message')\n"
- "loop.run()\n", NULL);
- pthread_join(pythonloop, NULL);
-
- ifs.open("/tmp/result.txt");
- lineCounter = 0;
- result = 0;
- while (std::getline(ifs, line))
- {
- std::stringstream(line) >> result;
- ASSERT_EQ(result, 23);
- }
- ifs.close();
-
- pthread_create(&pythonloop, NULL, cbSourceAdded, (void*) ppCommandSend);
- PyRun_SimpleStringFlags("import sys\n"
- "import traceback\n"
- "import gobject\n"
- "import dbus\n"
- "import dbus.mainloop.glib\n"
- "loop = gobject.MainLoop()\n"
- "def catchSourceAdded(*arg, **karg):\n"
- " print ('Caught signal (in SourceAdded handler) ') \n"
- " print (arg[0])\n"
- " f = open('/tmp/result.txt','w')\n"
- " f.write(str(arg[0]));\n"
- " f.close()\n"
- " loop.quit()\n"
- "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n"
- "bus = dbus.SessionBus()\n"
- "bus.add_signal_receiver(catchSourceAdded, signal_name='SourceAdded', dbus_interface = 'org.genivi.audiomanager.commandinterface', message_keyword='dbus_message')\n"
- "loop.run()\n", NULL);
- pthread_join(pythonloop, NULL);
-
- ifs.open("/tmp/result.txt");
- lineCounter = 0;
- result = 0;
- while (std::getline(ifs, line))
- {
- ASSERT_EQ(line.compare("dbus.Struct((dbus.UInt16(42), dbus.String(u'MySink'), dbus.Struct((dbus.Int16(3), dbus.Int16(0)), signature=None), dbus.UInt16(15)), signature=None)"), 0);
- }
- ifs.close();
-
- pthread_create(&pythonloop, NULL, cbSourceRemoved, (void*) ppCommandSend);
- PyRun_SimpleStringFlags("import sys\n"
- "import traceback\n"
- "import gobject\n"
- "import dbus\n"
- "import dbus.mainloop.glib\n"
- "loop = gobject.MainLoop()\n"
- "def catchSourceRemoved(*arg, **karg):\n"
- " print ('Caught signal (in SinkRemoved handler) ') \n"
- " print (arg[0])\n"
- " f = open('/tmp/result.txt','w')\n"
- " f.write(str(arg[0]));\n"
- " f.close()\n"
- " loop.quit()\n"
- "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n"
- "bus = dbus.SessionBus()\n"
- "bus.add_signal_receiver(catchSourceRemoved, signal_name='SourceRemoved', dbus_interface = 'org.genivi.audiomanager.commandinterface', message_keyword='dbus_message')\n"
- "loop.run()\n", NULL);
- pthread_join(pythonloop, NULL);
-
- ifs.open("/tmp/result.txt");
- lineCounter = 0;
- result = 0;
- while (std::getline(ifs, line))
- {
- std::stringstream(line) >> result;
- ASSERT_EQ(result, 42);
- }
- ifs.close();
-
- pthread_create(&pythonloop, NULL, NumberOfSinkClassesChanged, (void*) ppCommandSend);
- PyRun_SimpleStringFlags("import sys\n"
- "import traceback\n"
- "import gobject\n"
- "import dbus\n"
- "import dbus.mainloop.glib\n"
- "loop = gobject.MainLoop()\n"
- "def catchNumberOfSinkClassesChanged(*arg, **kwarg):\n"
- " print ('Caught catchNumberOfSinkClassesChanged') \n"
- " loop.quit()\n"
- "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n"
- "bus = dbus.SessionBus()\n"
- "bus.add_signal_receiver(catchNumberOfSinkClassesChanged, signal_name='NumberOfSinkClassesChanged', dbus_interface = 'org.genivi.audiomanager.commandinterface', message_keyword='dbus_message')\n"
- "loop.run()\n", NULL);
- pthread_join(pythonloop, NULL);
-
- pthread_create(&pythonloop, NULL, NumberOfSourceClassesChanged, (void*) ppCommandSend);
- PyRun_SimpleStringFlags("import sys\n"
- "import traceback\n"
- "import gobject\n"
- "import dbus\n"
- "import dbus.mainloop.glib\n"
- "loop = gobject.MainLoop()\n"
- "def CatchNumberOfSourceClassesChanged(*arg, **kwarg):\n"
- " print ('Caught CatchNumberOfSourceClassesChanged') \n"
- " loop.quit()\n"
- "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n"
- "bus = dbus.SessionBus()\n"
- "bus.add_signal_receiver(CatchNumberOfSourceClassesChanged, signal_name='NumberOfSourceClassesChanged', dbus_interface = 'org.genivi.audiomanager.commandinterface', message_keyword='dbus_message')\n"
- "loop.run()\n", NULL);
- pthread_join(pythonloop, NULL);
-
- //ok, now we want to test the signals. It did not work out that the python receiver worked in an own thread (as originally intended)
- //so it is running in the main context and the signals are send from threads...
- pthread_create(&pythonloop, NULL, MainConnectionStateChanged, (void*) ppCommandSend);
- PyRun_SimpleStringFlags("import sys\n"
- "import traceback\n"
- "import gobject\n"
- "import dbus\n"
- "import dbus.mainloop.glib\n"
- "loop = gobject.MainLoop()\n"
- "def catchMainConnectionStateChanged(*arg, **karg):\n"
- " print ('Caught signal (in catchMainConnectionStateChanged handler) ') \n"
- " print (arg[0])\n"
- " print (arg[1])\n"
- " f = open('/tmp/result.txt','w')\n"
- " f.write(str(arg[0]) + '\\n' + str (arg[1]));\n"
- " f.close()\n"
- " loop.quit()\n"
- "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n"
- "bus = dbus.SessionBus()\n"
- "bus.add_signal_receiver(catchMainConnectionStateChanged, signal_name='MainConnectionStateChanged', dbus_interface = 'org.genivi.audiomanager.commandinterface', message_keyword='dbus_message')\n"
- "loop.run()\n", NULL);
- pthread_join(pythonloop, NULL);
-
- ifs.open("/tmp/result.txt");
- lineCounter = 0;
- result = 0;
- while (std::getline(ifs, line))
- {
- if (lineCounter == 0)
- {
- std::stringstream(line) >> result;
- ASSERT_EQ(result, 4);
- }
- else if (lineCounter == 1)
- {
- std::stringstream(line) >> result;
- ASSERT_EQ(result, CS_CONNECTING);
- }
- lineCounter++;
- }
- ifs.close();
-
- //ok, now we want to test the signals. It did not work out that the python receiver worked in an own thread (as originally intended)
- //so it is running in the main context and the signals are send from threads...
- pthread_create(&pythonloop, NULL, MainSinkSoundPropertyChanged, (void*) ppCommandSend);
- PyRun_SimpleStringFlags("import sys\n"
- "import traceback\n"
- "import gobject\n"
- "import dbus\n"
- "import dbus.mainloop.glib\n"
- "loop = gobject.MainLoop()\n"
- "def catchMainSinkSoundPropertyChanged(*arg, **karg):\n"
- " print ('Caught signal (in catchMainSinkSoundPropertyChanged handler) ') \n"
- " print (arg[0])\n"
- " print (arg[1])\n"
- " f = open('/tmp/result.txt','w')\n"
- " f.write(str(arg[0]) + '\\n' + str (arg[1]));\n"
- " f.close()\n"
- " loop.quit()\n"
- "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n"
- "bus = dbus.SessionBus()\n"
- "bus.add_signal_receiver(catchMainSinkSoundPropertyChanged, signal_name='MainSinkSoundPropertyChanged', dbus_interface = 'org.genivi.audiomanager.commandinterface', message_keyword='dbus_message')\n"
- "loop.run()\n", NULL);
- pthread_join(pythonloop, NULL);
-
- ifs.open("/tmp/result.txt");
- lineCounter = 0;
- result = 0;
- while (std::getline(ifs, line))
- {
- if (lineCounter == 0)
- {
- std::stringstream(line) >> result;
- ASSERT_EQ(result, 3);
- }
- else if (lineCounter == 1)
- {
- ASSERT_EQ(line.compare("dbus.Struct((dbus.Int16(0), dbus.Int16(23)), signature=None)"), 0);
- }
- lineCounter++;
- }
- ifs.close();
-
- //ok, now we want to test the signals. It did not work out that the python receiver worked in an own thread (as originally intended)
- //so it is running in the main context and the signals are send from threads...
- pthread_create(&pythonloop, NULL, MainSourceSoundPropertyChanged, (void*) ppCommandSend);
- PyRun_SimpleStringFlags("import sys\n"
- "import traceback\n"
- "import gobject\n"
- "import dbus\n"
- "import dbus.mainloop.glib\n"
- "loop = gobject.MainLoop()\n"
- "def catchMainSourceSoundPropertyChanged(*arg, **karg):\n"
- " print ('Caught signal (in catchMainSourceSoundPropertyChanged handler) ') \n"
- " print (arg[0])\n"
- " print (arg[1])\n"
- " f = open('/tmp/result.txt','w')\n"
- " f.write(str(arg[0]) + '\\n' + str (arg[1]));\n"
- " f.close()\n"
- " loop.quit()\n"
- "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n"
- "bus = dbus.SessionBus()\n"
- "bus.add_signal_receiver(catchMainSourceSoundPropertyChanged, signal_name='MainSourceSoundPropertyChanged', dbus_interface = 'org.genivi.audiomanager.commandinterface', message_keyword='dbus_message')\n"
- "loop.run()\n", NULL);
- pthread_join(pythonloop, NULL);
-
- ifs.open("/tmp/result.txt");
- lineCounter = 0;
- result = 0;
- while (std::getline(ifs, line))
- {
- if (lineCounter == 0)
- {
- std::stringstream(line) >> result;
- ASSERT_EQ(result, 35);
- }
- else if (lineCounter == 1)
- {
- ASSERT_EQ(line.compare("dbus.Struct((dbus.Int16(0), dbus.Int16(233)), signature=None)"), 0);
- }
- lineCounter++;
- }
- ifs.close();
-
- //ok, now we want to test the signals. It did not work out that the python receiver worked in an own thread (as originally intended)
- //so it is running in the main context and the signals are send from threads...
- pthread_create(&pythonloop, NULL, cbSinkAvailabilityChangedLoop, (void*) ppCommandSend);
- PyRun_SimpleStringFlags("import sys\n"
- "import traceback\n"
- "import gobject\n"
- "import dbus\n"
- "import dbus.mainloop.glib\n"
- "loop = gobject.MainLoop()\n"
- "def catchSinkAvailabilityChanged(*arg, **karg):\n"
- " print ('Caught signal (in catchSinkAvailabilityChanged handler) ') \n"
- " print (arg[0])\n"
- " print (arg[1])\n"
- " f = open('/tmp/result.txt','w')\n"
- " f.write(str(arg[0]) + '\\n' + str (arg[1]));\n"
- " f.close()\n"
- " loop.quit()\n"
- "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n"
- "bus = dbus.SessionBus()\n"
- "bus.add_signal_receiver(catchSinkAvailabilityChanged, signal_name='SinkAvailabilityChanged', dbus_interface = 'org.genivi.audiomanager.commandinterface', message_keyword='dbus_message')\n"
- "loop.run()\n", NULL);
- pthread_join(pythonloop, NULL);
-
- ifs.open("/tmp/result.txt");
- lineCounter = 0;
- result = 0;
- while (std::getline(ifs, line))
- {
- if (lineCounter == 0)
- {
- std::stringstream(line) >> result;
- ASSERT_EQ(result, 4);
- }
- else if (lineCounter == 1)
- {
- ASSERT_EQ(line.compare("dbus.Struct((dbus.Int16(1), dbus.Int16(0)), signature=None)"), 0);
- }
- lineCounter++;
- }
- ifs.close();
-
- //ok, now we want to test the signals. It did not work out that the python receiver worked in an own thread (as originally intended)
- //so it is running in the main context and the signals are send from threads...
- pthread_create(&pythonloop, NULL, cbSourceAvailabilityChangedLoop, (void*) ppCommandSend);
- PyRun_SimpleStringFlags("import sys\n"
- "import traceback\n"
- "import gobject\n"
- "import dbus\n"
- "import dbus.mainloop.glib\n"
- "loop = gobject.MainLoop()\n"
- "def catchSourceAvailability(*arg, **karg):\n"
- " print ('Caught signal (in catchSourceAvailability handler) ') \n"
- " print (arg[0])\n"
- " print (arg[1])\n"
- " f = open('/tmp/result.txt','w')\n"
- " f.write(str(arg[0]) + '\\n' + str (arg[1]));\n"
- " f.close()\n"
- " loop.quit()\n"
- "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n"
- "bus = dbus.SessionBus()\n"
- "bus.add_signal_receiver(catchSourceAvailability, signal_name='SourceAvailabilityChanged', dbus_interface = 'org.genivi.audiomanager.commandinterface', message_keyword='dbus_message')\n"
- "loop.run()\n", NULL);
- pthread_join(pythonloop, NULL);
-
- ifs.open("/tmp/result.txt");
- lineCounter = 0;
- result = 0;
- while (std::getline(ifs, line))
- {
- if (lineCounter == 0)
- {
- std::stringstream(line) >> result;
- ASSERT_EQ(result, 2);
- }
- else if (lineCounter == 1)
- {
- ASSERT_EQ(line.compare("dbus.Struct((dbus.Int16(1), dbus.Int16(0)), signature=None)"), 0);
- }
- lineCounter++;
- }
- ifs.close();
-
- //ok, now we want to test the signals. It did not work out that the python receiver worked in an own thread (as originally intended)
- //so it is running in the main context and the signals are send from threads...
- pthread_create(&pythonloop, NULL, VolumeChanged, (void*) ppCommandSend);
- PyRun_SimpleStringFlags("import sys\n"
- "import traceback\n"
- "import gobject\n"
- "import dbus\n"
- "import dbus.mainloop.glib\n"
- "loop = gobject.MainLoop()\n"
- "def catchVolumeChanged(*arg, **karg):\n"
- " print ('Caught signal (in catchVolumeChanged handler) ') \n"
- " print (arg[0])\n"
- " print (arg[1])\n"
- " f = open('/tmp/result.txt','w')\n"
- " f.write(str(arg[0]) + '\\n' + str (arg[1]));\n"
- " f.close()\n"
- " loop.quit()\n"
- "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n"
- "bus = dbus.SessionBus()\n"
- "bus.add_signal_receiver(catchVolumeChanged, signal_name='VolumeChanged', dbus_interface = 'org.genivi.audiomanager.commandinterface', message_keyword='dbus_message')\n"
- "loop.run()\n", NULL);
- pthread_join(pythonloop, NULL);
-
- ifs.open("/tmp/result.txt");
- lineCounter = 0;
- result = 0;
- while (std::getline(ifs, line))
- {
- if (lineCounter == 0)
- {
- std::stringstream(line) >> result;
- ASSERT_EQ(result, 23);
- }
- else if (lineCounter == 1)
- {
- std::stringstream(line) >> result;
- ASSERT_EQ(result, 344);
- }
- lineCounter++;
- }
- ifs.close();
-
- //ok, now we want to test the signals. It did not work out that the python receiver worked in an own thread (as originally intended)
- //so it is running in the main context and the signals are send from threads...
- pthread_create(&pythonloop, NULL, SinkMuteStateChanged, (void*) ppCommandSend);
- PyRun_SimpleStringFlags("import sys\n"
- "import traceback\n"
- "import gobject\n"
- "import dbus\n"
- "import dbus.mainloop.glib\n"
- "loop = gobject.MainLoop()\n"
- "def catchSinkMuteStateChanged(*arg, **karg):\n"
- " print ('Caught signal (in catchSinkMuteStateChanged handler) ') \n"
- " print (arg[0])\n"
- " print (arg[1])\n"
- " f = open('/tmp/result.txt','w')\n"
- " f.write(str(arg[0]) + '\\n' + str (arg[1]));\n"
- " f.close()\n"
- " loop.quit()\n"
- "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n"
- "bus = dbus.SessionBus()\n"
- "bus.add_signal_receiver(catchSinkMuteStateChanged, signal_name='SinkMuteStateChanged', dbus_interface = 'org.genivi.audiomanager.commandinterface', message_keyword='dbus_message')\n"
- "loop.run()\n", NULL);
- pthread_join(pythonloop, NULL);
-
- ifs.open("/tmp/result.txt");
- lineCounter = 0;
- result = 0;
- while (std::getline(ifs, line))
- {
- if (lineCounter == 0)
- {
- std::stringstream(line) >> result;
- ASSERT_EQ(result, 42);
- }
- else if (lineCounter == 1)
- {
- std::stringstream(line) >> result;
- ASSERT_EQ(result, MS_MUTED);
- }
- lineCounter++;
- }
- ifs.close();
-
- //ok, now we want to test the signals. It did not work out that the python receiver worked in an own thread (as originally intended)
- //so it is running in the main context and the signals are send from threads...
- pthread_create(&pythonloop, NULL, SystemPropertyChanged, (void*) ppCommandSend);
- PyRun_SimpleStringFlags("import sys\n"
- "import traceback\n"
- "import gobject\n"
- "import dbus\n"
- "import dbus.mainloop.glib\n"
- "loop = gobject.MainLoop()\n"
- "def catchSystemPropertyChanged(*arg, **karg):\n"
- " print ('Caught signal (in catchSystemPropertyChanged handler) ') \n"
- " print (arg[0])\n"
- " f = open('/tmp/result.txt','w')\n"
- " f.write(str(arg[0]));\n"
- " f.close()\n"
- " loop.quit()\n"
- "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n"
- "bus = dbus.SessionBus()\n"
- "bus.add_signal_receiver(catchSystemPropertyChanged, signal_name='SystemPropertyChanged', dbus_interface = 'org.genivi.audiomanager.commandinterface', message_keyword='dbus_message')\n"
- "loop.run()\n", NULL);
- pthread_join(pythonloop, NULL);
-
- ifs.open("/tmp/result.txt");
- lineCounter = 0;
- result = 0;
- while (std::getline(ifs, line))
- {
- ASSERT_EQ(line.compare("dbus.Struct((dbus.Int16(0), dbus.Int16(355)), signature=None)"), 0);
- }
- ifs.close();
-
- //ok, now we want to test the signals. It did not work out that the python receiver worked in an own thread (as originally intended)
- //so it is running in the main context and the signals are send from threads...
- pthread_create(&pythonloop, NULL, TimingInformationChanged, (void*) ppCommandSend);
- PyRun_SimpleStringFlags("import sys\n"
- "import traceback\n"
- "import gobject\n"
- "import dbus\n"
- "import dbus.mainloop.glib\n"
- "loop = gobject.MainLoop()\n"
- "def catchTimingInformationChanged(*arg, **karg):\n"
- " print ('Caught signal (in catchTimingInformationChanged handler) ') \n"
- " print (arg[0])\n"
- " print (arg[1])\n"
- " f = open('/tmp/result.txt','w')\n"
- " f.write(str(arg[0]) + '\\n' + str (arg[1]));\n"
- " f.close()\n"
- " loop.quit()\n"
- "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n"
- "bus = dbus.SessionBus()\n"
- "bus.add_signal_receiver(catchTimingInformationChanged, signal_name='TimingInformationChanged', dbus_interface = 'org.genivi.audiomanager.commandinterface', message_keyword='dbus_message')\n"
- "loop.run()\n", NULL);
- pthread_join(pythonloop, NULL);
-
- ifs.open("/tmp/result.txt");
- lineCounter = 0;
- result = 0;
- while (std::getline(ifs, line))
- {
- if (lineCounter == 0)
- {
- std::stringstream(line) >> result;
- ASSERT_EQ(result, 42);
- }
- else if (lineCounter == 1)
- {
- std::stringstream(line) >> result;
- ASSERT_EQ(result, 233);
- }
- lineCounter++;
- }
- ifs.close();
-
-}
-
-int main(int argc, char **argv)
-{
- ::testing::InitGoogleTest(&argc, argv);
- return RUN_ALL_TESTS();
-}
-
-void CAmCommandSenderDbusSignalTest::SetUp()
-{
- Py_Initialize();
-}
-
-void CAmCommandSenderDbusSignalTest::TearDown()
-{
- Py_Finalize();
-}
-
diff --git a/PluginCommandInterfaceDbus/test/CAmCommandSenderDbusSignalTest.h b/PluginCommandInterfaceDbus/test/CAmCommandSenderDbusSignalTest.h
deleted file mode 100644
index b92b894..0000000
--- a/PluginCommandInterfaceDbus/test/CAmCommandSenderDbusSignalTest.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/**
- * Copyright (c) 2012 BMW
- *
- * \author Christian Mueller, christian.ei.mueller@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 DBUSCOMMANINTERFACESIGNALSTEST_H_
-#define DBUSCOMMANINTERFACESIGNALSTEST_H_
-
-
-#include "gtest/gtest.h"
-#include "gmock/gmock.h"
-
-#define UNIT_TEST 1
-
-namespace am {
-
-class IAmCommandSend;
-
-class CAmCommandSenderDbusSignalTest: public ::testing::Test
-{
-public:
- IAmCommandSend *ppCommandSend;
- CAmCommandSenderDbusSignalTest();
- virtual ~CAmCommandSenderDbusSignalTest();
- void SetUp();
- void TearDown();
-};
-
-}
-
-#endif /* DBUSCOMMANINTERFACESIGNALSTEST_H_ */
diff --git a/PluginCommandInterfaceDbus/test/CAmCommandSenderDbusTest.cpp b/PluginCommandInterfaceDbus/test/CAmCommandSenderDbusTest.cpp
deleted file mode 100644
index 9aaa766..0000000
--- a/PluginCommandInterfaceDbus/test/CAmCommandSenderDbusTest.cpp
+++ /dev/null
@@ -1,622 +0,0 @@
-/**
- * Copyright (c) 2012 BMW
- *
- * \author Christian Mueller, christian.ei.mueller@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 "CAmCommandSenderDbusTest.h"
-#include <Python.h>
-#include <iostream>
-#include <fstream>
-#include <sstream>
-#include <algorithm>
-#include <string>
-#include <vector>
-#include <set>
-#include "TAmPluginTemplate.h"
-#include "MockIAmCommandReceive.h"
-#include "shared/CAmDltWrapper.h"
-#include "shared/CAmSocketHandler.h"
-#include "shared/CAmDbusWrapper.h"
-#include "../include/CAmCommandSenderDbus.h"
-#include "../include/CAmDbusMessageHandler.h"
-
-using namespace am;
-using namespace testing;
-
-std::string DBUSCOMMAND = "dbus-send --session --print-reply --dest=org.genivi.audiomanager /org/genivi/audiomanager/commandinterface org.genivi.audiomanager.commandinterface.";
-
-void* run_the_loop(void* wrapper)
-{
- CAmSocketHandler* wrap = (CAmSocketHandler*) wrapper;
- wrap->start_listenting();
- return (NULL);
-}
-
-CAmCommandSenderDbusTest::CAmCommandSenderDbusTest() :
- ppCommandSend(NULL) //
-{
- CAmDltWrapper::instance()->registerApp("dbusTest", "dbusTest");
-}
-
-CAmCommandSenderDbusTest::~CAmCommandSenderDbusTest()
-{
-
-}
-
-void CAmCommandSenderDbusTest::SetUp()
-{
-
-}
-
-void CAmCommandSenderDbusTest::TearDown()
-{
-
-}
-
-ACTION(returnListConnections){
-std::vector<am::am_MainConnectionType_s> list;
-am::am_MainConnectionType_s listItem;
-listItem.mainConnectionID=15;
-listItem.sinkID=4;
-listItem.sourceID=3;
-listItem.connectionState=CS_UNKNOWN;
-listItem.delay=34;
-list.push_back(listItem);
-arg0=list;
-}
-
-ACTION(returnListSinks){
-std::vector<am::am_SinkType_s> list;
-am::am_SinkType_s listItem;
-listItem.availability.availability=A_UNAVAILABLE;
-listItem.availability.availabilityReason=AR_GENIVI_NOMEDIA;
-listItem.muteState=MS_UNMUTED;
-listItem.name="mySink";
-listItem.sinkClassID=34;
-listItem.sinkID=24;
-listItem.volume=124;
-list.push_back(listItem);
-arg0=list;
-}
-
-ACTION(returnListSources){
-std::vector<am::am_SourceType_s> list;
-am::am_SourceType_s listItem;
-listItem.availability.availability=A_MAX;
-listItem.availability.availabilityReason=AR_GENIVI_SAMEMEDIA;
-listItem.name="MySource";
-listItem.sourceClassID=12;
-listItem.sourceID=224;
-list.push_back(listItem);
-listItem.name="NextSource";
-listItem.sourceID=22;
-list.push_back(listItem);
-arg0=list;
-}
-
-ACTION(returnListMainSinkSoundProperties){
-std::vector<am::am_MainSoundProperty_s> list;
-am::am_MainSoundProperty_s listItem;
-listItem.type=MSP_GENIVI_MID;
-listItem.value=223;
-list.push_back(listItem);
-listItem.type=MSP_UNKNOWN;
-listItem.value=2;
-list.push_back(listItem);
-arg1=list;
-}
-
-ACTION(returnListSourceClasses){
-std::vector<am::am_SourceClass_s> list;
-am::am_SourceClass_s listItem;
-am::am_ClassProperty_s property;
-property.classProperty=static_cast<am_CustomClassProperty_t>(2);
-property.value=12;
-listItem.name="FirstCLass";
-listItem.sourceClassID=23;
-listItem.listClassProperties.push_back(property);
-list.push_back(listItem);
-listItem.name="SecondCLass";
-listItem.sourceClassID=2;
-listItem.listClassProperties.push_back(property);
-list.push_back(listItem);
-arg0=list;
-}
-
-ACTION(returnListSinkClasses){
-std::vector<am::am_SinkClass_s> list;
-am::am_SinkClass_s listItem;
-am::am_ClassProperty_s property;
-property.classProperty=static_cast<am_CustomClassProperty_t>(1);
-property.value=122;
-listItem.name="FirstCLass";
-listItem.sinkClassID=2123;
-listItem.listClassProperties.push_back(property);
-list.push_back(listItem);
-listItem.name="SecondCLass";
-listItem.sinkClassID=23;
-listItem.listClassProperties.push_back(property);
-list.push_back(listItem);
-arg0=list;
-}
-
-ACTION(returnListSystemProperties){
-std::vector<am::am_SystemProperty_s> list;
-am::am_SystemProperty_s listItem;
-listItem.type=SYP_UNKNOWN;
-listItem.value=-2245;
-list.push_back(listItem);
-arg0=list;
-}
-
-ACTION(returnTimingInfo){
-am::am_timeSync_t time=23;
-arg1=time;
-}
-
-TEST_F(CAmCommandSenderDbusTest, MessageTest)
-{
- Py_Initialize();
- //unfortunatly we need to put all in one testcase because testing with the dbus loop caused problems...
- CAmSocketHandler pSocketHandler;
- CAmDbusWrapper pDBusWrapper(&pSocketHandler);
- pthread_t ptestThread;
- std::vector<std::string> plistCommandPluginDirs;
- plistCommandPluginDirs.push_back(std::string(DEFAULT_PLUGIN_COMMAND_DIR));
-
- MockIAmCommandReceive pReceiveInterface;
-
- //this class just creates the thread that will handle the mainloop...
- pthread_create(&ptestThread, NULL, run_the_loop, (void*) &pSocketHandler);
-
- IAmCommandSend* (*createFunc)();
- void* tempLibHandle = NULL;
- std::string libname("../plugins/command/libPluginCommandInterfaceDbus.so");
- createFunc = getCreateFunction<IAmCommandSend*()>(libname, tempLibHandle);
-
- if (!createFunc)
- {
- logError("CommandSendInterface Test Entry point of RoutingPlugin not found");
- exit(1);
- }
-
- ppCommandSend = createFunc();
-
- if (!ppCommandSend)
- {
- logError("CommandSendInterface Test RoutingPlugin initialization failed. Entry Function not callable");
- exit(1);
- }
-
-// ok, here we give the DBusWrapper pointer to the Plugin and start the interface
- EXPECT_CALL(pReceiveInterface,getDBusConnectionWrapper(_)).WillRepeatedly(DoAll(SetArgReferee<0>(&pDBusWrapper), Return(E_OK)));
- EXPECT_CALL(pReceiveInterface, confirmCommandReady(10,E_OK));
-
- ppCommandSend->startupInterface(&pReceiveInterface);
- ppCommandSend->setCommandReady(10);
-
- EXPECT_CALL(pReceiveInterface,connect(2,3,_)).WillRepeatedly(DoAll(SetArgReferee<2>(35), Return(E_OK)));
- system((DBUSCOMMAND + std::string("Connect uint16:2 uint16:3 > /tmp/result.txt ")).c_str());
-
- //check the results
- std::ifstream ifs("/tmp/result.txt");
- std::string line;
- int lineCounter = 0, result = 0;
- while (std::getline(ifs, line))
- {
- if (lineCounter == 1)
- {
- std::stringstream(line.replace(line.begin(), line.begin() + 9, "")) >> result;
- ASSERT_EQ(result, E_OK);
- }
- else if (lineCounter == 2)
- {
- std::stringstream(line.replace(line.begin(), line.begin() + 10, "")) >> result;
- ASSERT_EQ(result, 35);
- }
- lineCounter++;
- }
- ifs.close();
-
- std::cout << "[connect ]" << std::endl;
-
- EXPECT_CALL(pReceiveInterface,disconnect(2)).WillOnce(Return(E_OK));
- system((DBUSCOMMAND + std::string("Disconnect uint16:2 > /tmp/result.txt ")).c_str());
-
- //check the results
- lineCounter = 0;
- result = 0;
- ifs.open("/tmp/result.txt");
- while (std::getline(ifs, line))
- {
- if (lineCounter == 1)
- {
- std::stringstream(line.replace(line.begin(), line.begin() + 9, "")) >> result;
- ASSERT_EQ(result, E_OK);
- }
- lineCounter++;
- }
- ifs.close();
-
- std::cout << "[disconnect]" << std::endl;
-
- EXPECT_CALL(pReceiveInterface,setVolume(22,12)).WillOnce(Return(E_OK));
- system((DBUSCOMMAND + std::string("SetVolume uint16:22 int16:12 > /tmp/result.txt ")).c_str());
-
- //check the results
- lineCounter = 0;
- result = 0;
- ifs.open("/tmp/result.txt");
- while (std::getline(ifs, line))
- {
- if (lineCounter == 1)
- {
- std::stringstream(line.replace(line.begin(), line.begin() + 9, "")) >> result;
- ASSERT_EQ(result, E_OK);
- }
- lineCounter++;
- }
- ifs.close();
-
- std::cout << "[setVolume ]" << std::endl;
-
- EXPECT_CALL(pReceiveInterface,volumeStep(2,1)).WillOnce(Return(E_OK));
- system((DBUSCOMMAND + std::string("VolumeStep uint16:2 int16:1 > /tmp/result.txt ")).c_str());
-
- //check the results
- lineCounter = 0;
- result = 0;
- ifs.open("/tmp/result.txt");
- while (std::getline(ifs, line))
- {
- if (lineCounter == 1)
- {
- std::stringstream(line.replace(line.begin(), line.begin() + 9, "")) >> result;
- ASSERT_EQ(result, E_OK);
- }
- lineCounter++;
- }
- ifs.close();
-
- std::cout << "[volumeStep]" << std::endl;
-
- EXPECT_CALL(pReceiveInterface,setSinkMuteState(1,MS_UNKNOWN)).WillOnce(Return(E_OK));
- system((DBUSCOMMAND + std::string("SetSinkMuteState uint16:1 int16:0 > /tmp/result.txt ")).c_str());
-
- //check the results
- lineCounter = 0;
- result = 0;
- ifs.open("/tmp/result.txt");
- while (std::getline(ifs, line))
- {
- if (lineCounter == 1)
- {
- std::stringstream(line.replace(line.begin(), line.begin() + 9, "")) >> result;
- ASSERT_EQ(result, E_OK);
- }
- lineCounter++;
- }
- ifs.close();
-
- std::cout << "[sinkmutest]" << std::endl;
-
- EXPECT_CALL(pReceiveInterface,setMainSinkSoundProperty(AllOf(Field(&am_MainSoundProperty_s::value, 3),
- Field(&am_MainSoundProperty_s::type,MSP_UNKNOWN)),1)).WillOnce(Return(E_ABORTED));
-
- PyRun_SimpleStringFlags("import dbus\n"
- "f = open('/tmp/result.txt','w')\n"
- "bus = dbus.SessionBus()\n"
- "retVal=dbus.Bus().call_blocking(\n"
- "bus_name='org.genivi.audiomanager',\n"
- "object_path='/org/genivi/audiomanager/commandinterface',\n"
- "dbus_interface='org.genivi.audiomanager.commandinterface',\n"
- "method='SetMainSinkSoundProperty',\n"
- "signature='q(nn)',\n"
- "args=[1,(0,3)],) \n"
- "f.write(str(retVal));\n"
- "f.close()", NULL);
- result = 0;
- ifs.open("/tmp/result.txt");
- while (std::getline(ifs, line))
- {
- std::stringstream(line) >> result;
- }ASSERT_EQ(result, E_ABORTED);
- ifs.close();
-
- std::cout << "[sinksound ]" << std::endl;
-
- EXPECT_CALL(pReceiveInterface,setMainSourceSoundProperty(AllOf(Field(&am_MainSoundProperty_s::value, 3),
- Field(&am_MainSoundProperty_s::type,MSP_UNKNOWN)),1)).WillOnce(Return(E_ABORTED));
-
- PyRun_SimpleStringFlags("import dbus\n"
- "f = open('/tmp/result.txt','w')\n"
- "bus = dbus.SessionBus()\n"
- "retVal=dbus.Bus().call_blocking(\n"
- "bus_name='org.genivi.audiomanager',\n"
- "object_path='/org/genivi/audiomanager/commandinterface',\n"
- "dbus_interface='org.genivi.audiomanager.commandinterface',\n"
- "method='SetMainSourceSoundProperty',\n"
- "signature='q(nn)',\n"
- "args=[1,(0,3)],) \n"
- "f.write(str(retVal));\n"
- "f.close()", NULL);
- result = 0;
- ifs.open("/tmp/result.txt");
- while (std::getline(ifs, line))
- {
- std::stringstream(line) >> result;
- }ASSERT_EQ(result, E_ABORTED);
- ifs.close();
-
- std::cout << "[sourcesnd ]" << std::endl;
-
- EXPECT_CALL(pReceiveInterface,setSystemProperty(Field(&am_SystemProperty_s::value,2))).WillOnce(Return(E_DATABASE_ERROR));
-
- PyRun_SimpleStringFlags("import dbus\n"
- "f = open('/tmp/result.txt','w')\n"
- "bus = dbus.SessionBus()\n"
- "retVal=dbus.Bus().call_blocking(\n"
- "bus_name='org.genivi.audiomanager',\n"
- "object_path='/org/genivi/audiomanager/commandinterface',\n"
- "dbus_interface='org.genivi.audiomanager.commandinterface',\n"
- "method='SetSystemProperty',\n"
- "signature='(nn)',\n"
- "args=[(2,2)],) \n"
- "f.write(str(retVal));\n"
- "f.close()", NULL);
-
- result = 0;
- ifs.open("/tmp/result.txt");
- while (std::getline(ifs, line))
- {
- std::stringstream(line) >> result;
- }ASSERT_EQ(result, E_DATABASE_ERROR);
- ifs.close();
-
- std::cout << "[systemprop]" << std::endl;
-
- EXPECT_CALL(pReceiveInterface,getListMainConnections(_)).WillOnce(DoAll(returnListConnections(), Return(E_ABORTED)));
-
- PyRun_SimpleStringFlags("import dbus\n"
- "f = open('/tmp/result.txt','w')\n"
- "bus = dbus.SessionBus()\n"
- "retVal=dbus.Bus().call_blocking(\n"
- "bus_name='org.genivi.audiomanager',\n"
- "object_path='/org/genivi/audiomanager/commandinterface',\n"
- "dbus_interface='org.genivi.audiomanager.commandinterface',\n"
- "method='GetListMainConnections',\n"
- "signature='',\n"
- "args=[],) \n"
- "f.write(str(retVal));\n"
- "f.close()", NULL);
- result = 0;
- ifs.open("/tmp/result.txt");
- while (std::getline(ifs, line))
- {
- //we could parse here, but this is the fastest way....
- ASSERT_EQ(line.compare("(dbus.Int16(9), dbus.Array([dbus.Struct((dbus.UInt16(15), dbus.UInt16(3), dbus.UInt16(4), dbus.Int16(34), dbus.Int16(0)), signature=None)], signature=dbus.Signature('(qqqnn)')))"), 0);
- }
- ifs.close();
-
- std::cout << "[listmainc ]" << std::endl;
-
- EXPECT_CALL(pReceiveInterface,getListMainSinks(_)).WillOnce(DoAll(returnListSinks(), Return(E_ABORTED)));
-
- PyRun_SimpleStringFlags("import dbus\n"
- "f = open('/tmp/result.txt','w')\n"
- "bus = dbus.SessionBus()\n"
- "retVal=dbus.Bus().call_blocking(\n"
- "bus_name='org.genivi.audiomanager',\n"
- "object_path='/org/genivi/audiomanager/commandinterface',\n"
- "dbus_interface='org.genivi.audiomanager.commandinterface',\n"
- "method='GetListMainSinks',\n"
- "signature='',\n"
- "args=[],) \n"
- "f.write(str(retVal));\n"
- "f.close()", NULL);
- result = 0;
- ifs.open("/tmp/result.txt");
- while (std::getline(ifs, line))
- {
- //we could parse here, but this is the fastest way....
- ASSERT_EQ(line.compare("(dbus.Int16(9), dbus.Array([dbus.Struct((dbus.UInt16(24), dbus.String(u'mySink'), dbus.Struct((dbus.Int16(2), dbus.Int16(3)), signature=None), dbus.Int16(124), dbus.Int16(2), dbus.UInt16(34)), signature=None)], signature=dbus.Signature('(qs(nn)nnq)')))"), 0);
- }
- ifs.close();
-
- std::cout << "[listsinks ]" << std::endl;
-
- EXPECT_CALL(pReceiveInterface,getListMainSources(_)).WillOnce(DoAll(returnListSources(), Return(E_ABORTED)));
-
- PyRun_SimpleStringFlags("import dbus\n"
- "f = open('/tmp/result.txt','w')\n"
- "bus = dbus.SessionBus()\n"
- "retVal=dbus.Bus().call_blocking(\n"
- "bus_name='org.genivi.audiomanager',\n"
- "object_path='/org/genivi/audiomanager/commandinterface',\n"
- "dbus_interface='org.genivi.audiomanager.commandinterface',\n"
- "method='GetListMainSources',\n"
- "signature='',\n"
- "args=[],) \n"
- "f.write(str(retVal));\n"
- "f.close()", NULL);
- result = 0;
- ifs.open("/tmp/result.txt");
- while (std::getline(ifs, line))
- {
- //we could parse here, but this is the fastest way....
- ASSERT_EQ(line.compare("(dbus.Int16(9), dbus.Array([dbus.Struct((dbus.UInt16(224), dbus.String(u'MySource'), dbus.Struct((dbus.Int16(3), dbus.Int16(2)), signature=None), dbus.UInt16(12)), signature=None), dbus.Struct((dbus.UInt16(22), dbus.String(u'NextSource'), dbus.Struct((dbus.Int16(3), dbus.Int16(2)), signature=None), dbus.UInt16(12)), signature=None)], signature=dbus.Signature('(qs(nn)q)')))"), 0);
- }
- ifs.close();
-
- std::cout << "[listsource]" << std::endl;
-
- EXPECT_CALL(pReceiveInterface,getListMainSinkSoundProperties(1,_)).WillOnce(DoAll(returnListMainSinkSoundProperties(), Return(E_ABORTED)));
-
- PyRun_SimpleStringFlags("import dbus\n"
- "f = open('/tmp/result.txt','w')\n"
- "bus = dbus.SessionBus()\n"
- "retVal=dbus.Bus().call_blocking(\n"
- "bus_name='org.genivi.audiomanager',\n"
- "object_path='/org/genivi/audiomanager/commandinterface',\n"
- "dbus_interface='org.genivi.audiomanager.commandinterface',\n"
- "method='GetListMainSinkSoundProperties',\n"
- "signature='q',\n"
- "args=[1],) \n"
- "f.write(str(retVal));\n"
- "f.close()", NULL);
- result = 0;
- ifs.open("/tmp/result.txt");
- while (std::getline(ifs, line))
- {
- //we could parse here, but this is the fastest way....
- ASSERT_EQ(line.compare("(dbus.Int16(9), dbus.Array([dbus.Struct((dbus.Int16(2), dbus.Int16(223)), signature=None), dbus.Struct((dbus.Int16(0), dbus.Int16(2)), signature=None)], signature=dbus.Signature('(nn)')))"), 0);
- }
- ifs.close();
-
- std::cout << "[lMainSiPro]" << std::endl;
-
- EXPECT_CALL(pReceiveInterface,getListMainSourceSoundProperties(1,_)).WillOnce(DoAll(returnListMainSinkSoundProperties(), Return(E_ABORTED)));
-
- PyRun_SimpleStringFlags("import dbus\n"
- "f = open('/tmp/result.txt','w')\n"
- "bus = dbus.SessionBus()\n"
- "retVal=dbus.Bus().call_blocking(\n"
- "bus_name='org.genivi.audiomanager',\n"
- "object_path='/org/genivi/audiomanager/commandinterface',\n"
- "dbus_interface='org.genivi.audiomanager.commandinterface',\n"
- "method='GetListMainSourceSoundProperties',\n"
- "signature='q',\n"
- "args=[1],) \n"
- "f.write(str(retVal));\n"
- "f.close()", NULL);
- result = 0;
- ifs.open("/tmp/result.txt");
- while (std::getline(ifs, line))
- {
- //we could parse here, but this is the fastest way....
- ASSERT_EQ(line.compare("(dbus.Int16(9), dbus.Array([dbus.Struct((dbus.Int16(2), dbus.Int16(223)), signature=None), dbus.Struct((dbus.Int16(0), dbus.Int16(2)), signature=None)], signature=dbus.Signature('(nn)')))"), 0);
- }
- ifs.close();
-
- std::cout << "[lMainSoPro]" << std::endl;
-
- EXPECT_CALL(pReceiveInterface,getListSourceClasses(_)).WillOnce(DoAll(returnListSourceClasses(), Return(E_ABORTED)));
-
- PyRun_SimpleStringFlags("import dbus\n"
- "f = open('/tmp/result.txt','w')\n"
- "bus = dbus.SessionBus()\n"
- "retVal=dbus.Bus().call_blocking(\n"
- "bus_name='org.genivi.audiomanager',\n"
- "object_path='/org/genivi/audiomanager/commandinterface',\n"
- "dbus_interface='org.genivi.audiomanager.commandinterface',\n"
- "method='GetListSourceClasses',\n"
- "signature='',\n"
- "args=[],) \n"
- "f.write(str(retVal));\n"
- "f.close()", NULL);
- result = 0;
- ifs.open("/tmp/result.txt");
- while (std::getline(ifs, line))
- {
- //we could parse here, but this is the fastest way....
- ASSERT_EQ(line.compare("(dbus.Int16(9), dbus.Array([dbus.Struct((dbus.UInt16(23), dbus.String(u'FirstCLass'), dbus.Array([dbus.Struct((dbus.Int16(2), dbus.Int16(12)), signature=None)], signature=dbus.Signature('(nn)'))), signature=None), dbus.Struct((dbus.UInt16(2), dbus.String(u'SecondCLass'), dbus.Array([dbus.Struct((dbus.Int16(2), dbus.Int16(12)), signature=None), dbus.Struct((dbus.Int16(2), dbus.Int16(12)), signature=None)], signature=dbus.Signature('(nn)'))), signature=None)], signature=dbus.Signature('(qsa(nn))')))"), 0);
- }
- ifs.close();
-
- std::cout << "[lSourceCla]" << std::endl;
-
- EXPECT_CALL(pReceiveInterface,getListSinkClasses(_)).WillOnce(DoAll(returnListSinkClasses(), Return(E_ABORTED)));
-
- PyRun_SimpleStringFlags("import dbus\n"
- "f = open('/tmp/result.txt','w')\n"
- "bus = dbus.SessionBus()\n"
- "retVal=dbus.Bus().call_blocking(\n"
- "bus_name='org.genivi.audiomanager',\n"
- "object_path='/org/genivi/audiomanager/commandinterface',\n"
- "dbus_interface='org.genivi.audiomanager.commandinterface',\n"
- "method='GetListSinkClasses',\n"
- "signature='',\n"
- "args=[],) \n"
- "f.write(str(retVal));\n"
- "f.close()", NULL);
- result = 0;
- ifs.open("/tmp/result.txt");
- while (std::getline(ifs, line))
- {
- //we could parse here, but this is the fastest way....
- ASSERT_EQ(line.compare("(dbus.Int16(9), dbus.Array([dbus.Struct((dbus.UInt16(2123), dbus.String(u'FirstCLass'), dbus.Array([dbus.Struct((dbus.Int16(1), dbus.Int16(122)), signature=None)], signature=dbus.Signature('(nn)'))), signature=None), dbus.Struct((dbus.UInt16(23), dbus.String(u'SecondCLass'), dbus.Array([dbus.Struct((dbus.Int16(1), dbus.Int16(122)), signature=None), dbus.Struct((dbus.Int16(1), dbus.Int16(122)), signature=None)], signature=dbus.Signature('(nn)'))), signature=None)], signature=dbus.Signature('(qsa(nn))')))"), 0);
- }
- ifs.close();
-
- std::cout << "[lSinkClass]" << std::endl;
-
- EXPECT_CALL(pReceiveInterface,getListSystemProperties(_)).WillOnce(DoAll(returnListSystemProperties(), Return(E_ABORTED)));
-
- PyRun_SimpleStringFlags("import dbus\n"
- "f = open('/tmp/result.txt','w')\n"
- "bus = dbus.SessionBus()\n"
- "retVal=dbus.Bus().call_blocking(\n"
- "bus_name='org.genivi.audiomanager',\n"
- "object_path='/org/genivi/audiomanager/commandinterface',\n"
- "dbus_interface='org.genivi.audiomanager.commandinterface',\n"
- "method='GetListSystemProperties',\n"
- "signature='',\n"
- "args=[],) \n"
- "f.write(str(retVal));\n"
- "f.close()", NULL);
- result = 0;
- ifs.open("/tmp/result.txt");
- while (std::getline(ifs, line))
- {
- //we could parse here, but this is the fastest way....
- ASSERT_EQ(line.compare("(dbus.Int16(9), dbus.Array([dbus.Struct((dbus.Int16(0), dbus.Int16(-2245)), signature=None)], signature=dbus.Signature('(nn)')))"), 0);
- }
- ifs.close();
-
- std::cout << "[lSysProp ]" << std::endl;
-
- EXPECT_CALL(pReceiveInterface,getTimingInformation(2,_)).WillOnce(DoAll(returnTimingInfo(), Return(E_ABORTED)));
-
- PyRun_SimpleStringFlags("import dbus\n"
- "f = open('/tmp/result.txt','w')\n"
- "bus = dbus.SessionBus()\n"
- "retVal=dbus.Bus().call_blocking(\n"
- "bus_name='org.genivi.audiomanager',\n"
- "object_path='/org/genivi/audiomanager/commandinterface',\n"
- "dbus_interface='org.genivi.audiomanager.commandinterface',\n"
- "method='GetTimingInformation',\n"
- "signature='q',\n"
- "args=[2],) \n"
- "f.write(str(retVal));\n"
- "f.close()", NULL);
- result = 0;
- ifs.open("/tmp/result.txt");
- while (std::getline(ifs, line))
- {
- //we could parse here, but this is the fastest way....
- ASSERT_EQ(line.compare("(dbus.Int16(9), dbus.Int16(23))"), 0);
- }
- ifs.close();
-
- std::cout << "[timingInfo]" << std::endl;
- Py_Finalize();
-}
-
-int main(int argc, char **argv)
-{
- ::testing::InitGoogleTest(&argc, argv);
- return RUN_ALL_TESTS();
-}
-
diff --git a/PluginCommandInterfaceDbus/test/CAmCommandSenderDbusTest.h b/PluginCommandInterfaceDbus/test/CAmCommandSenderDbusTest.h
deleted file mode 100644
index 1351da4..0000000
--- a/PluginCommandInterfaceDbus/test/CAmCommandSenderDbusTest.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/**
- * Copyright (c) 2012 BMW
- *
- * \author Christian Mueller, christian.ei.mueller@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 DBUSCOMMANDPLUGININTERFACETEST_H_
-#define DBUSCOMMANDPLUGININTERFACETEST_H_
-
-#include "gtest/gtest.h"
-#include "gmock/gmock.h"
-
-#define UNIT_TEST 1
-
-namespace am {
-
-class CAmCommandSenderDbusBackdoor;
-class IAmCommandSend;
-
-/*
- * originally, I would want to have several tests, but there are problems implementing this with
- * Dbus.
- * I use python to send put the messages and to check the returns I get from the Plugin.
- *
- */
-
-
-class CAmCommandSenderDbusTest :public ::testing::Test
-{
-public:
- IAmCommandSend *ppCommandSend;
- CAmCommandSenderDbusTest();
- ~CAmCommandSenderDbusTest();
-
- void SetUp();
- void TearDown();
-};
-
-}
-
-#endif /* DBUSCOMMANDPLUGININTERFACETEST_H_ */
diff --git a/PluginCommandInterfaceDbus/test/CMakeLists.txt b/PluginCommandInterfaceDbus/test/CMakeLists.txt
deleted file mode 100644
index d9d9e51..0000000
--- a/PluginCommandInterfaceDbus/test/CMakeLists.txt
+++ /dev/null
@@ -1,115 +0,0 @@
-# Copyright (c) 2012 GENIVI Alliance
-# Copyright (c) 2012 BMW
-#
-# author Christian Mueller, christian.ei.mueller@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.6)
-
-PROJECT(CAmCommandSenderDbusTests)
-
-set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w -g -DUNIT_TEST=1 -DDLT_CONTEXT=AudioManager")
-
-string (REPLACE "-g -Wall -Wextra" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
-string (REPLACE "-pedantic" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
-
-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)
-
-
-IF(WITH_DLT)
- pkg_check_modules(DLT REQUIRED automotive-dlt>=2.2.0)
-ENDIF(WITH_DLT)
-
-INCLUDE_DIRECTORIES(
- ${STD_INCLUDE_DIRS}
- ${CMAKE_SOURCE_DIR}
- ${CMAKE_CURRENT_BINARY_DIR}
- ${AUDIO_INCLUDE_FOLDER}
- ${DBUS_ARCH_INCLUDE_DIR}
- ${DBUS_INCLUDE_FOLDER}
- ${CMAKE_SOURCE_DIR}
- ${DLT_INCLUDE_DIRS}
- ${DBUS_INCLUDE_DIR}
- ${INCLUDE_FOLDER}
- ${PYTHON_INCLUDE_DIRS}
- ${GOOGLE_TEST_INCLUDE_DIR}
- ${GMOCK_INCLUDE_DIR}
- "../../AudioManagerDaemon/include"
- "../include"
-)
-
-file(GLOB DBUS_PLUGIN_INTERFACE_SRCS_CXX
- "../../AudioManagerDaemon/src/CAmDbusWrapper.cpp"
- "../../AudioManagerDaemon/src/CAmSocketHandler.cpp"
- "../../AudioManagerDaemon/src/CAmDltWrapper.cpp"
- "../src/*.cpp"
- "CAmCommandSenderDbusBackdoor.cpp"
- "CAmCommandSenderDbusTest.cpp"
-
-)
-
-file(GLOB DBUS_SIGNAL_INTERFACE_SRCS_CXX
- "../../AudioManagerDaemon/src/CAmDbusWrapper.cpp"
- "../../AudioManagerDaemon/src/CAmSocketHandler.cpp"
- "../../AudioManagerDaemon/src/CAmDltWrapper.cpp"
- "../src/*.cpp"
- "CAmCommandSenderDbusBackdoor.cpp"
- "CAmCommandSenderDbusSignalTest.cpp"
-)
-ADD_EXECUTABLE(AmCommandSenderDbusTest ${DBUS_PLUGIN_INTERFACE_SRCS_CXX})
-
-ADD_EXECUTABLE(AmCommandSenderDbusSignalTest ${DBUS_SIGNAL_INTERFACE_SRCS_CXX})
-
-TARGET_LINK_LIBRARIES(AmCommandSenderDbusTest
- ${DLT_LIBRARIES}
- ${DBUS_LIBRARY}
- ${CMAKE_DL_LIBS}
- ${CMAKE_THREAD_LIBS_INIT}
- ${PYTHON_LIBRARY}
- gtest
- gmock
-)
-
-
-TARGET_LINK_LIBRARIES(AmCommandSenderDbusSignalTest
- ${DLT_LIBRARIES}
- ${DBUS_LIBRARY}
- ${CMAKE_DL_LIBS}
- ${CMAKE_THREAD_LIBS_INIT}
- ${PYTHON_LIBRARY}
- gtest
- gmock
-)
-
-INSTALL(TARGETS AmCommandSenderDbusTest
- DESTINATION "~/AudioManagerTest/"
- PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
- COMPONENT tests
-)
-
-INSTALL(TARGETS AmCommandSenderDbusSignalTest
- DESTINATION "~/AudioManagerTest/"
- PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
- COMPONENT tests
-)
-
-SET(ADD_DEPEND "audiomanager-bin" "sqlite3(>=3.6.22)" "dlt" "libdbus-1-3(>=1.2.16)" "gtest" "libpthread-stubs0")
-set_property(GLOBAL APPEND PROPERTY tests_prop "${ADD_DEPEND}")
-
diff --git a/PluginCommandInterfaceDbus/test/MockIAmCommandReceive.h b/PluginCommandInterfaceDbus/test/MockIAmCommandReceive.h
deleted file mode 100644
index cf70aa8..0000000
--- a/PluginCommandInterfaceDbus/test/MockIAmCommandReceive.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/**
- * Copyright (c) 2012 BMW
- *
- * \author Christian Mueller, christian.ei.mueller@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 MOCKCOMMANDRECEIVENTERFACE_H_
-#define MOCKCOMMANDRECEIVENTERFACE_H_
-
-#include "command/IAmCommandReceive.h"
-#include "gtest/gtest.h"
-#include "gmock/gmock.h"
-
-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));
-
-
-};
-
-} // namespace am
-#endif /* MOCKCOMMANDRECEIVENTERFACE_H_ */
diff --git a/PluginControlInterface/CMakeLists.txt b/PluginControlInterface/CMakeLists.txt
deleted file mode 100644
index 1c4d3fd..0000000
--- a/PluginControlInterface/CMakeLists.txt
+++ /dev/null
@@ -1,78 +0,0 @@
-# Copyright (c) 2012 BMW
-#
-# author Christian Mueller, christian.ei.mueller@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.6)
-
-PROJECT(PluginControlInterface)
-
-OPTION (WITH_TEST_CONTROLLER
- "Build with the test controller" ON)
-
-IF (WITH_TEST_CONTROLLER)
-
-set(LIBRARY_OUTPUT_PATH ${PLUGINS_OUTPUT_PATH}/control)
-set(DOC_OUTPUT_PATH ${DOC_OUTPUT_PATH}/ControlPlugin)
-set(INCLUDE_FOLDER "include")
-
-FILE(READ "${AUDIO_INCLUDE_FOLDER}/control/IAmControlSend.h" VERSION_BUFFER LIMIT 6000)
-STRING(REGEX MATCH "ControlSendVersion*.[^0-9]*[0-9].[0-9]*[0-9]" LIB_INTERFACE_VERSION_STRING ${VERSION_BUFFER})
-STRING(REGEX REPLACE "ControlSendVersion*.." "" LIB_INTERFACE_VERSION ${LIB_INTERFACE_VERSION_STRING})
-MESSAGE(STATUS "Building against control interface version ${LIB_INTERFACE_VERSION}")
-
-FIND_PACKAGE(NSM REQUIRED)
-
-INCLUDE_DIRECTORIES(
- ${CMAKE_SOURCE_DIR}
- ${STD_INCLUDE_DIRS}
- ${CMAKE_CURRENT_BINARY_DIR}
- ${AUDIO_INCLUDE_FOLDER}
- ${PROJECT_INCLUDE_FOLDER}
- ${INCLUDE_FOLDER}
- ${NSM_INCLUDE_DIR}
-)
-
-# all source files go here
-file(GLOB PLUGIN_CONTROL_SRCS_CXX "src/*.cpp")
-
-add_library(PluginControlInterface MODULE ${PLUGIN_CONTROL_SRCS_CXX})
-
-
-TARGET_LINK_LIBRARIES(PluginControlInterface
- ${DLT_LIBRARIES})
-
-IF(WITH_TESTS)
- add_subdirectory (test)
-ENDIF(WITH_TESTS)
-
-#IF(WITH_DOCUMENTATION)
-# file(MAKE_DIRECTORY ${DOC_OUTPUT_PATH})
-# configure_file(${DOXY_FILE} ${DOC_OUTPUT_PATH}/Doxyfile @ONLY IMMEDIATE)
-# add_custom_target (PluginControlInterfaceDBusDocs ALL
-# COMMAND ${DOXYGEN_EXECUTABLE} ${DOC_OUTPUT_PATH}/Doxyfile WORKING_DIRECTORY ${DOC_OUTPUT_PATH}
-# SOURCES ${PROJECT_BINARY_DIR} ${DOC_OUTPUT_PATH}/Doxyfile
-# )
-#ENDIF(WITH_DOCUMENTATION)
-
-INSTALL(TARGETS PluginControlInterface
- DESTINATION "lib/${LIB_INSTALL_SUFFIX}/control"
- PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
- COMPONENT sampleplugins
-)
-
-SET(ADD_DEPEND "audiomanager-bin")
-set_property(GLOBAL APPEND PROPERTY sampleplugins_prop "${ADD_DEPEND}")
-
-ENDIF (WITH_TEST_CONTROLLER)
diff --git a/PluginControlInterface/include/CAmControlSenderBase.h b/PluginControlInterface/include/CAmControlSenderBase.h
deleted file mode 100644
index a2d2cec..0000000
--- a/PluginControlInterface/include/CAmControlSenderBase.h
+++ /dev/null
@@ -1,246 +0,0 @@
-/**
- * Copyright (c) 2012 BMW
- *
- * \author Christian Mueller, christian.ei.mueller@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 CONTROLSENDER_H_
-#define CONTROLSENDER_H_
-
-#include "control/IAmControlSend.h"
-#include <list>
-
-using namespace am;
-
-class CAmControlSenderBase: public IAmControlSend
-{
-public:
- CAmControlSenderBase();
- virtual ~CAmControlSenderBase();
- am_Error_e startupController(IAmControlReceive* controlreceiveinterface);
- void setControllerReady();
- void setControllerRundown(const int16_t signal);
- am_Error_e hookUserConnectionRequest(const am_sourceID_t sourceID, const am_sinkID_t sinkID, am_mainConnectionID_t& mainConnectionID);
- am_Error_e hookUserDisconnectionRequest(const am_mainConnectionID_t connectionID);
- am_Error_e hookUserSetMainSinkSoundProperty(const am_sinkID_t sinkID, const am_MainSoundProperty_s& soundProperty);
- am_Error_e hookUserSetMainSourceSoundProperty(const am_sourceID_t sourceID, const am_MainSoundProperty_s& soundProperty);
- am_Error_e hookUserSetSystemProperty(const am_SystemProperty_s& property);
- am_Error_e hookUserVolumeChange(const am_sinkID_t SinkID, const am_mainVolume_t newVolume);
- am_Error_e hookUserVolumeStep(const am_sinkID_t SinkID, const int16_t increment);
- am_Error_e hookUserSetSinkMuteState(const am_sinkID_t sinkID, const am_MuteState_e muteState);
- am_Error_e hookSystemRegisterDomain(const am_Domain_s& domainData, am_domainID_t& domainID);
- am_Error_e hookSystemDeregisterDomain(const am_domainID_t domainID);
- void hookSystemDomainRegistrationComplete(const am_domainID_t domainID);
- am_Error_e hookSystemRegisterSink(const am_Sink_s& sinkData, am_sinkID_t& sinkID);
- am_Error_e hookSystemDeregisterSink(const am_sinkID_t sinkID);
- am_Error_e hookSystemRegisterSource(const am_Source_s& sourceData, am_sourceID_t& sourceID);
- am_Error_e hookSystemDeregisterSource(const am_sourceID_t sourceID);
- am_Error_e hookSystemRegisterGateway(const am_Gateway_s& gatewayData, am_gatewayID_t& gatewayID);
- am_Error_e hookSystemRegisterConverter(const am_Converter_s& converterData, am_converterID_t& converterID);
- am_Error_e hookSystemDeregisterConverter(const am_converterID_t converterID);
- am_Error_e hookSystemDeregisterGateway(const am_gatewayID_t gatewayID);
- am_Error_e hookSystemRegisterCrossfader(const am_Crossfader_s& crossfaderData, am_crossfaderID_t& crossfaderID);
- am_Error_e hookSystemDeregisterCrossfader(const am_crossfaderID_t crossfaderID);
- void hookSystemSinkVolumeTick(const am_Handle_s handle, const am_sinkID_t sinkID, const am_volume_t volume);
- void hookSystemSourceVolumeTick(const am_Handle_s handle, const am_sourceID_t sourceID, const am_volume_t volume);
- void hookSystemInterruptStateChange(const am_sourceID_t sourceID, const am_InterruptState_e interruptState);
- void hookSystemSinkAvailablityStateChange(const am_sinkID_t sinkID, const am_Availability_s& availability);
- void hookSystemSourceAvailablityStateChange(const am_sourceID_t sourceID, const am_Availability_s& availability);
- void hookSystemDomainStateChange(const am_domainID_t domainID, const am_DomainState_e state);
- void hookSystemReceiveEarlyData(const std::vector<am_EarlyData_s>& data);
- void hookSystemSpeedChange(const am_speed_t speed);
- void hookSystemTimingInformationChanged(const am_mainConnectionID_t mainConnectionID, const am_timeSync_t time);
- void cbAckConnect(const am_Handle_s handle, const am_Error_e errorID);
- void cbAckDisconnect(const am_Handle_s handle, const am_Error_e errorID);
- void cbAckCrossFade(const am_Handle_s handle, const am_HotSink_e hostsink, const am_Error_e error);
- void cbAckSetSinkVolumeChange(const am_Handle_s handle, const am_volume_t volume, const am_Error_e error);
- void cbAckSetSourceVolumeChange(const am_Handle_s handle, const am_volume_t voulme, const am_Error_e error);
- void cbAckSetSourceState(const am_Handle_s handle, const am_Error_e error);
- void cbAckSetSourceSoundProperties(const am_Handle_s handle, const am_Error_e error);
- void cbAckSetSourceSoundProperty(const am_Handle_s handle, const am_Error_e error);
- void cbAckSetSinkSoundProperties(const am_Handle_s handle, const am_Error_e error);
- void cbAckSetSinkSoundProperty(const am_Handle_s handle, const am_Error_e error);
- am_Error_e getConnectionFormatChoice(const am_sourceID_t sourceID, const am_sinkID_t sinkID, const am_Route_s listRoute, const std::vector<am_CustomConnectionFormat_t> listPossibleConnectionFormats, std::vector<am_CustomConnectionFormat_t>& listPrioConnectionFormats);
- void getInterfaceVersion(std::string& version) const;
- void confirmCommandReady(const am_Error_e error) ;
- void confirmRoutingReady(const am_Error_e error) ;
- void confirmCommandRundown(const am_Error_e error) ;
- void confirmRoutingRundown(const am_Error_e error) ;
- am_Error_e hookSystemUpdateSink(const am_sinkID_t sinkID, const am_sinkClass_t sinkClassID, const std::vector<am_SoundProperty_s>& listSoundProperties, const std::vector<am_CustomConnectionFormat_t>& listConnectionFormats, const std::vector<am_MainSoundProperty_s>& listMainSoundProperties) ;
- am_Error_e hookSystemUpdateSource(const am_sourceID_t sourceID, const am_sourceClass_t sourceClassID, const std::vector<am_SoundProperty_s>& listSoundProperties, const std::vector<am_CustomConnectionFormat_t>& listConnectionFormats, const std::vector<am_MainSoundProperty_s>& listMainSoundProperties) ;
- am_Error_e hookSystemUpdateGateway(const am_gatewayID_t gatewayID, const std::vector<am_CustomConnectionFormat_t>& listSourceConnectionFormats, const std::vector<am_CustomConnectionFormat_t>& listSinkConnectionFormats, const std::vector<bool>& convertionMatrix) ;
- am_Error_e hookSystemUpdateConverter(const am_converterID_t converterID, const std::vector<am_CustomConnectionFormat_t>& listSourceConnectionFormats, const std::vector<am_CustomConnectionFormat_t>& listSinkConnectionFormats, const std::vector<bool>& convertionMatrix);
- void cbAckSetVolumes(const am_Handle_s handle, const std::vector<am_Volumes_s>& listVolumes, const am_Error_e error) ;
- void cbAckSetSinkNotificationConfiguration(const am_Handle_s handle, const am_Error_e error) ;
- void cbAckSetSourceNotificationConfiguration(const am_Handle_s handle, const am_Error_e error) ;
- void hookSinkNotificationDataChanged(const am_sinkID_t sinkID, const am_NotificationPayload_s& payload) ;
- void hookSourceNotificationDataChanged(const am_sourceID_t sourceID, const am_NotificationPayload_s& payload) ;
- am_Error_e hookUserSetMainSinkNotificationConfiguration(const am_sinkID_t sinkID, const am_NotificationConfiguration_s& notificationConfiguration) ;
- am_Error_e hookUserSetMainSourceNotificationConfiguration(const am_sourceID_t sourceID, const am_NotificationConfiguration_s& notificationConfiguration) ;
- void hookSystemNodeStateChanged(const NsmNodeState_e NodeStateId) ;
- void hookSystemNodeApplicationModeChanged(const NsmApplicationMode_e ApplicationModeId) ;
- void hookSystemSessionStateChanged(const std::string& sessionName, const NsmSeat_e seatID, const NsmSessionState_e sessionStateID) ;
- NsmErrorStatus_e hookSystemLifecycleRequest(const uint32_t Request, const uint32_t RequestId) ;
-
-private:
- IAmControlReceive * mControlReceiveInterface;
-
- void disconnect(am_mainConnectionID_t connectionID);
- void connect(am_sourceID_t sourceID, am_sinkID_t sinkID, am_mainConnectionID_t mainConnectionID);
-
- struct handleStatus
- {
- bool status;
- am_Handle_s handle;
- };
-
- struct mainConnectionSet
- {
- am_mainConnectionID_t connectionID;
- std::vector<handleStatus> listHandleStaus;
- };
-
- struct mainVolumeSet
- {
- am_sinkID_t sinkID;
- am_Handle_s handle;
- am_mainVolume_t mainVolume;
- };
-
- struct mainSinkSoundPropertySet
- {
- am_sinkID_t sinkID;
- am_Handle_s handle;
- am_MainSoundProperty_s mainSoundProperty;
- };
-
- class findHandle
- {
- handleStatus mHandle;
- public:
- explicit findHandle(handleStatus handle) :
- mHandle(handle)
- {
- }
- bool operator()(const handleStatus& handle) const
- {
- return (handle.handle.handle == mHandle.handle.handle);
- }
- };
-
- struct checkHandle
- {
-
- handleStatus mHandleStatus;
- explicit checkHandle(const handleStatus& value) :
- mHandleStatus(value)
- {
- }
-
- bool operator()(const handleStatus &value)
- {
- return !value.status;
- }
- };
-
- struct checkMainConnectionID
- {
- am_MainConnection_s mMainConnection;
- explicit checkMainConnectionID(const am_MainConnection_s& mainConnection) :
- mMainConnection(mainConnection)
- {
- }
- bool operator()(const am_MainConnection_s& mainConnection)
- {
- if (mMainConnection.mainConnectionID == mainConnection.mainConnectionID)
- return true;
- return false;
- }
- };
-
- enum cs_stateflow_e
- {
- SF_NONE,
- SF_CONNECT,
- SF_NAVI,
- SF_TA
- };
-
- enum cs_connectSf_e
- {
- SFC_RAMP_DOWN,
- SFC_SOURCE_STATE_OFF,
- SFC_DISCONNECT,
- SFC_CONNECT,
- SFC_SOURCE_STATE_ON,
- SFC_RAMP_UP,
- SFC_FINISHED
- };
-
- enum cs_naviSf_e
- {
- NAVC_RAMP_DOWN,
- NAVC_CONNECT,
- NAVC_SOURCE_STATE_ON,
- NAVC_RAMP_UP,
- NAVC_WAIT_STATE,
- NAVC_RAMP_DOWN_AGAIN,
- NAVC_SOURCE_VOLUME_BACK,
- NAVC_SOURCE_ACTIVITY_BACK,
- NAVC_DISCONNECT,
- NAVC_FINISHED
- };
-
- enum cs_trafficSf_e
- {
- TA_RAMP_DOWN,
- TA_CONNECT,
- TA_SOURCE_STATE_ON,
- TA_RAMP_UP,
- TA_WAIT_STATE,
- TA_RAMP_DOWN_AGAIN,
- TA_SOURCE_STATE_OFF,
- TA_SOURCE_STATE_OLD_OFF,
- TA_DISCONNECT,
- TA_FINISHED
- };
-
- struct cs_connectData_s
- {
- am_mainConnectionID_t currentMainConnection;
- am_mainConnectionID_t newMainConnection;
- am_sourceID_t oldSourceID;
- am_sinkID_t sinkID;
- am_sourceID_t sourceID;
- };
-
- void callStateFlowHandler();
- void callConnectHandler();
- void callNaviHandler();
- void callTAHandler();
-
- std::vector<mainConnectionSet> mListOpenConnections;
- std::vector<mainConnectionSet> mListOpenDisconnections;
- std::vector<mainVolumeSet> mListOpenVolumeChanges;
- std::vector<mainSinkSoundPropertySet> mListMainSoundPropertyChanges;
-
- cs_connectSf_e mConnectSf;
- cs_naviSf_e mNaviSf;
- cs_trafficSf_e mTrafficSf;
- cs_connectData_s mConnectData;
- cs_stateflow_e mStateflow;
-
-};
-
-#endif /* CONTROLSENDER_H_ */
diff --git a/PluginControlInterface/include/IAmControlReceiverShadow.h b/PluginControlInterface/include/IAmControlReceiverShadow.h
deleted file mode 100644
index 2557836..0000000
--- a/PluginControlInterface/include/IAmControlReceiverShadow.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/**
- * Copyright (c) 2012 BMW
- *
- * \author Christian Mueller, christian.ei.mueller@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 IAMCONTROLRECEIVERSHADOW_H_
-#define IAMCONTROLRECEIVERSHADOW_H_
-
-#include "audiomanagertypes.h"
-#include "shared/CAmSerializer.h"
-
-namespace am
-{
-class IAmControlReceive;
-class CAmSocketHandler;
-
-/**
- * shadow class that used CAmSerializer to make threadsafe calls to the IAmControlReceive interface.
- */
-class IAmControlReceiverShadow
-{
-public:
- IAmControlReceiverShadow(IAmControlReceive* iReceiveInterface, CAmSocketHandler* iSocketHandler);
- ~IAmControlReceiverShadow();
- am_Error_e getRoute(bool onlyfree, am_sourceID_t sourceID, am_sinkID_t sinkID, std::vector<am_Route_s>& returnList);
- am_Error_e connect(am_Handle_s& handle, am_connectionID_t& connectionID, am_CustomConnectionFormat_t format, am_sourceID_t sourceID, am_sinkID_t sinkID);
- am_Error_e disconnect(am_Handle_s& handle, am_connectionID_t connectionID);
- am_Error_e crossfade(am_Handle_s& handle, am_HotSink_e hotSource, am_crossfaderID_t crossfaderID, am_CustomRampType_t rampType, am_time_t rampTime);
- am_Error_e abortAction(am_Handle_s handle);
- am_Error_e setSourceState(am_Handle_s& handle, am_sourceID_t sourceID, am_SourceState_e state);
- am_Error_e setSinkVolume(am_Handle_s& handle, am_sinkID_t sinkID, am_volume_t volume, am_CustomRampType_t ramp, am_time_t time);
- am_Error_e setSourceVolume(am_Handle_s& handle, am_sourceID_t sourceID, am_volume_t volume, am_CustomRampType_t rampType, am_time_t time);
- am_Error_e setSinkSoundProperties(am_Handle_s& handle, am_sinkID_t sinkID, std::vector<am_SoundProperty_s>& soundProperty);
- am_Error_e setSinkSoundProperty(am_Handle_s& handle, am_sinkID_t sinkID, am_SoundProperty_s& soundProperty);
- am_Error_e setSourceSoundProperties(am_Handle_s& handle, am_sourceID_t sourceID, std::vector<am_SoundProperty_s>& soundProperty);
- am_Error_e setSourceSoundProperty(am_Handle_s& handle, am_sourceID_t sourceID, am_SoundProperty_s& soundProperty);
- am_Error_e setDomainState(am_domainID_t domainID, am_DomainState_e domainState);
- am_Error_e enterDomainDB(am_Domain_s& domainData, am_domainID_t& domainID);
- am_Error_e enterMainConnectionDB(am_MainConnection_s& mainConnectionData, am_mainConnectionID_t& connectionID);
- am_Error_e enterSinkDB(am_Sink_s& sinkData, am_sinkID_t& sinkID);
- am_Error_e enterCrossfaderDB(am_Crossfader_s& crossfaderData, am_crossfaderID_t& crossfaderID);
- am_Error_e enterGatewayDB(am_Gateway_s& gatewayData, am_gatewayID_t& gatewayID);
- am_Error_e enterSourceDB(am_Source_s& sourceData, am_sourceID_t& sourceID);
- am_Error_e enterSinkClassDB(am_SinkClass_s& sinkClass, am_sinkClass_t& sinkClassID);
- am_Error_e enterSourceClassDB(am_sourceClass_t& sourceClassID, am_SourceClass_s& sourceClass);
- am_Error_e changeSinkClassInfoDB(am_SinkClass_s& sinkClass);
- am_Error_e changeSourceClassInfoDB(am_SourceClass_s& sourceClass);
- am_Error_e enterSystemPropertiesListDB(std::vector<am_SystemProperty_s>& listSystemProperties);
- am_Error_e changeMainConnectionRouteDB(am_mainConnectionID_t mainconnectionID, std::vector<am_connectionID_t>& listConnectionID);
- am_Error_e changeMainConnectionStateDB(am_mainConnectionID_t mainconnectionID, am_ConnectionState_e connectionState);
- am_Error_e changeSinkMainVolumeDB(am_mainVolume_t mainVolume, am_sinkID_t sinkID);
- am_Error_e changeSinkAvailabilityDB(am_Availability_s& availability, am_sinkID_t sinkID);
- am_Error_e changDomainStateDB(am_DomainState_e domainState, am_domainID_t domainID);
- am_Error_e changeSinkMuteStateDB(am_MuteState_e muteState, am_sinkID_t sinkID);
- am_Error_e changeMainSinkSoundPropertyDB(am_MainSoundProperty_s& soundProperty, am_sinkID_t sinkID);
- am_Error_e changeMainSourceSoundPropertyDB(am_MainSoundProperty_s& soundProperty, am_sourceID_t sourceID);
- am_Error_e changeSourceAvailabilityDB(am_Availability_s& availability, am_sourceID_t sourceID);
- am_Error_e changeSystemPropertyDB(am_SystemProperty_s& property);
- am_Error_e removeMainConnectionDB(am_mainConnectionID_t mainConnectionID);
- am_Error_e removeSinkDB(am_sinkID_t sinkID);
- am_Error_e removeSourceDB(am_sourceID_t sourceID);
- am_Error_e removeGatewayDB(am_gatewayID_t gatewayID);
- am_Error_e removeCrossfaderDB(am_crossfaderID_t crossfaderID);
- am_Error_e removeDomainDB(am_domainID_t domainID);
- am_Error_e removeSinkClassDB(am_sinkClass_t sinkClassID);
- am_Error_e removeSourceClassDB(am_sourceClass_t sourceClassID);
- am_Error_e getSourceClassInfoDB(am_sourceID_t sourceID, am_SourceClass_s& classInfo);
- am_Error_e getSinkClassInfoDB(am_sinkID_t sinkID, am_SinkClass_s& sinkClass);
- am_Error_e getSinkInfoDB(am_sinkID_t sinkID, am_Sink_s& sinkData);
- am_Error_e getSourceInfoDB(am_sourceID_t sourceID, am_Source_s& sourceData);
- am_Error_e getGatewayInfoDB(am_gatewayID_t gatewayID, am_Gateway_s& gatewayData);
- am_Error_e getCrossfaderInfoDB(am_crossfaderID_t crossfaderID, am_Crossfader_s& crossfaderData);
- am_Error_e getMainConnectionInfoDB(am_mainConnectionID_t mainConnectionID, am_MainConnection_s& mainConnectionData);
- am_Error_e getListSinksOfDomain(am_domainID_t domainID, std::vector<am_sinkID_t>& listSinkID);
- am_Error_e getListSourcesOfDomain(am_domainID_t domainID, std::vector<am_sourceID_t>& listSourceID);
- am_Error_e getListCrossfadersOfDomain(am_domainID_t domainID, std::vector<am_crossfaderID_t>& listCrossfadersID);
- am_Error_e getListGatewaysOfDomain(am_domainID_t domainID, std::vector<am_gatewayID_t>& listGatewaysID);
- am_Error_e getListMainConnections(std::vector<am_MainConnection_s>& listMainConnections);
- am_Error_e getListDomains(std::vector<am_Domain_s>& listDomains);
- am_Error_e getListConnections(std::vector<am_Connection_s>& listConnections);
- am_Error_e getListSinks(std::vector<am_Sink_s>& listSinks);
- am_Error_e getListSources(std::vector<am_Source_s>& listSources);
- am_Error_e getListSourceClasses(std::vector<am_SourceClass_s>& listSourceClasses);
- am_Error_e getListHandles(std::vector<am_Handle_s>& listHandles);
- am_Error_e getListCrossfaders(std::vector<am_Crossfader_s>& listCrossfaders);
- am_Error_e getListGateways(std::vector<am_Gateway_s>& listGateways);
- am_Error_e getListSinkClasses(std::vector<am_SinkClass_s>& listSinkClasses);
- am_Error_e getListSystemProperties(std::vector<am_SystemProperty_s>& listSystemProperties);
- void setCommandReady();
- void setCommandRundown();
- void setRoutingReady();
- void setRoutingRundown();
- void confirmControllerReady(am_Error_e error);
- void confirmControllerRundown(am_Error_e error);
- am_Error_e getSocketHandler(CAmSocketHandler*& socketHandler);
-private:
- IAmControlReceive *mpIAmControlReceiver;
- CAmSerializer mCAmSerializer;
-
-};
-
-} /* namespace am */
-#endif /* IAMCONTROLRECEIVERSHADOW_H_ */
diff --git a/PluginControlInterface/src/CAmControlSenderBase.cpp b/PluginControlInterface/src/CAmControlSenderBase.cpp
deleted file mode 100644
index 9d5aa8b..0000000
--- a/PluginControlInterface/src/CAmControlSenderBase.cpp
+++ /dev/null
@@ -1,958 +0,0 @@
-/**
- * Copyright (c) 2012 BMW
- *
- * \author Christian Mueller, christian.ei.mueller@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 "CAmControlSenderBase.h"
-#include <cassert>
-#include <algorithm>
-#include "shared/CAmDltWrapper.h"
-#include "control/IAmControlReceive.h"
-
-using namespace am;
-
-extern "C" IAmControlSend* PluginControlInterfaceFactory()
-{
- return (new CAmControlSenderBase());
-}
-
-extern "C" void destroyControlPluginInterface(IAmControlSend* controlSendInterface)
-{
- delete controlSendInterface;
-}
-
-CAmControlSenderBase::CAmControlSenderBase() :
- mControlReceiveInterface(NULL), //
- mListOpenConnections(), //
- mListOpenDisconnections(), //
- mListOpenVolumeChanges(),//
- mConnectSf (SFC_RAMP_DOWN), //
- mNaviSf(NAVC_RAMP_DOWN), //
- mTrafficSf(TA_RAMP_DOWN),//
- mConnectData(), //
- mStateflow(SF_NONE)
-{
-}
-
-CAmControlSenderBase::~CAmControlSenderBase()
-{
-}
-
-am_Error_e CAmControlSenderBase::startupController(IAmControlReceive *controlreceiveinterface)
-{
- assert(controlreceiveinterface);
- mControlReceiveInterface = controlreceiveinterface;
- am_sourceClass_t sourceClassID;
- am_SourceClass_s sourceClass;
- sourceClass.name="player";
- sourceClass.sourceClassID=1;
- mControlReceiveInterface->enterSourceClassDB(sourceClassID,sourceClass);
- sourceClass.name="navi";
- sourceClass.sourceClassID=2;
- mControlReceiveInterface->enterSourceClassDB(sourceClassID,sourceClass);
- sourceClass.name="ta";
- sourceClass.sourceClassID=3;
- mControlReceiveInterface->enterSourceClassDB(sourceClassID,sourceClass);
- //here is a good place to insert SystemProperties into the database...
- //and might be a good place to insert the Source and Sink CLasses as well
- return E_NOT_USED;
-}
-
-void CAmControlSenderBase::setControllerReady()
-{
- //here is a good place to insert Source and SinkClasses into the database...
- mControlReceiveInterface->setRoutingReady();
- mControlReceiveInterface->setCommandReady();
-}
-
-am_Error_e CAmControlSenderBase::hookUserConnectionRequest(const am_sourceID_t sourceID, const am_sinkID_t sinkID, am_mainConnectionID_t & mainConnectionID)
-{
- if (mStateflow!=SF_NONE)
- return (E_NOT_POSSIBLE);
-
- std::vector<am_Route_s> listRoutes;
- std::vector<am_connectionID_t> listConnectionIDs;
- am_SourceClass_s sourceClass, tempSourceClass;
- bool exististingConnection(false);
- mControlReceiveInterface->getRoute(false, sourceID, sinkID, listRoutes);
- if (listRoutes.empty())
- return (E_NOT_POSSIBLE);
-
- std::vector<am_MainConnection_s> listAllMainConnections;
- mControlReceiveInterface->getListMainConnections(listAllMainConnections);
- mControlReceiveInterface->getSourceClassInfoDB(sourceID, sourceClass);
-
- //go through all connections
- std::vector<am_MainConnection_s>::iterator itAll(listAllMainConnections.begin());
- for (; itAll != listAllMainConnections.end(); ++itAll)
- {
- if (itAll->sinkID == sinkID && itAll->sourceID == sourceID)
- return (E_ALREADY_EXISTS);
-
- //check if there is already an existing connection
- mControlReceiveInterface->getSourceClassInfoDB(itAll->sourceID, tempSourceClass);
- if (tempSourceClass.sourceClassID == 1)
- {
- mConnectData.currentMainConnection=itAll->mainConnectionID;
- exististingConnection=true;
- mConnectData.oldSourceID=itAll->sourceID;
- }
- }
-
- am_MainConnection_s mainConnectionData;
- mainConnectionData.mainConnectionID = 0;
- mainConnectionData.sinkID = sinkID;
- mainConnectionData.sourceID = sourceID;
- mainConnectionData.connectionState = CS_CONNECTING;
- mainConnectionData.delay = 0;
-
- mControlReceiveInterface->enterMainConnectionDB(mainConnectionData, mainConnectionID);
- mConnectData.newMainConnection=mainConnectionID;
- mConnectData.sourceID=sourceID;
- mConnectData.sinkID=sinkID;
-
- if(sourceClass.sourceClassID==1)
- {
- if(exististingConnection)
- mConnectSf=SFC_RAMP_DOWN;
- else
- mConnectSf=SFC_CONNECT;
-
- mStateflow=SF_CONNECT;
- }
- else if (sourceClass.sourceClassID==2)
- {
- if(exististingConnection)
- mConnectSf=SFC_RAMP_DOWN;
- else
- mConnectSf=SFC_CONNECT;
-
- mStateflow=SF_NAVI;
- }
- else if (sourceClass.sourceClassID==3)
- {
- if(exististingConnection)
- mConnectSf=SFC_RAMP_DOWN;
- else
- mConnectSf=SFC_CONNECT;
-
- mStateflow=SF_TA;
- }
-
- callStateFlowHandler();
- return (E_OK);
-}
-
-am_Error_e CAmControlSenderBase::hookUserDisconnectionRequest(const am_mainConnectionID_t connectionID)
-{
- if (mStateflow==SF_NAVI)
- {
- mNaviSf=NAVC_RAMP_DOWN_AGAIN;
- callStateFlowHandler();
- return (E_OK);
- }
- if (mStateflow==SF_TA)
- {
- mTrafficSf=TA_RAMP_DOWN_AGAIN;
- callStateFlowHandler();
- return (E_OK);
- }
- else if (mStateflow!=SF_NONE)
- {
- return (E_NOT_POSSIBLE);
- }
- disconnect(connectionID);
- return (E_OK);
-}
-
-am_Error_e CAmControlSenderBase::hookUserSetMainSinkSoundProperty(const am_sinkID_t sinkID, const am_MainSoundProperty_s & soundProperty)
-{
- if (mStateflow!=SF_NONE)
- return (E_NOT_POSSIBLE);
-
- if (sinkID == 0)
- return (E_NON_EXISTENT);
-
- mainSinkSoundPropertySet set;
- set.sinkID = sinkID;
- set.mainSoundProperty = soundProperty;
- am_SoundProperty_s sp;
- std::vector<mainSinkSoundPropertySet>::iterator it(mListMainSoundPropertyChanges.begin());
- for (; it != mListMainSoundPropertyChanges.end(); ++it)
- {
- if (it->sinkID == sinkID)
- return E_NOT_POSSIBLE;
- }
-
-//I know this is bad - just for the reference, ok?
- sp.type = static_cast<am_CustomSoundPropertyType_t>(soundProperty.type);
- sp.value = (soundProperty.value - 5) * 30;
- am_Error_e error;
- if ((error = mControlReceiveInterface->setSinkSoundProperty(set.handle, sinkID, sp)) != E_OK)
- {
- return error;
- }
- mListMainSoundPropertyChanges.push_back(set);
- return E_OK;
-}
-
-am_Error_e CAmControlSenderBase::hookUserSetMainSourceSoundProperty(const am_sourceID_t sourceID, const am_MainSoundProperty_s & soundProperty)
-{
- (void) sourceID;
- (void) soundProperty;
- return E_NOT_USED;
-}
-
-am_Error_e CAmControlSenderBase::hookUserSetSystemProperty(const am_SystemProperty_s & property)
-{
- (void) property;
- return E_NOT_USED;
-}
-
-am_Error_e CAmControlSenderBase::hookUserVolumeChange(const am_sinkID_t SinkID, const am_mainVolume_t newVolume)
-{
- if (mStateflow!=SF_NONE)
- return (E_NOT_POSSIBLE);
-
- assert(SinkID!=0);
- mainVolumeSet set;
- set.sinkID = SinkID;
- set.mainVolume = newVolume;
- am_Error_e error;
-
- std::vector<mainVolumeSet>::iterator it(mListOpenVolumeChanges.begin());
- for (; it != mListOpenVolumeChanges.end(); ++it)
- {
- if (it->sinkID == SinkID)
- return E_NOT_POSSIBLE;
- }
-
- am_Sink_s sinkData;
- mControlReceiveInterface->getSinkInfoDB(SinkID, sinkData);
-
- if (sinkData.mainVolume == newVolume)
- return E_NO_CHANGE;
-
- if ((error = mControlReceiveInterface->setSinkVolume(set.handle, SinkID, (newVolume-10)*6, RAMP_UNKNOWN, 20)) != E_OK)
- {
- return error;
- }
- mListOpenVolumeChanges.push_back(set);
- return E_OK;
-}
-
-am_Error_e CAmControlSenderBase::hookUserVolumeStep(const am_sinkID_t SinkID, const int16_t increment)
-{
- if (mStateflow!=SF_NONE)
- return (E_NOT_POSSIBLE);
-
- assert(SinkID!=0);
- mainVolumeSet set;
- set.sinkID = SinkID;
- am_Error_e error;
- am_Sink_s sink;
- std::vector<mainVolumeSet>::iterator it(mListOpenVolumeChanges.begin());
- for (; it != mListOpenVolumeChanges.end(); ++it)
- {
- if (it->sinkID == SinkID)
- return E_NOT_POSSIBLE;
- }
- mControlReceiveInterface->getSinkInfoDB(SinkID, sink);
- set.mainVolume = sink.mainVolume + increment;
- if ((error = mControlReceiveInterface->setSinkVolume(set.handle, SinkID, (set.mainVolume-10)*6, RAMP_UNKNOWN, 20)) != E_OK)
- {
- return error;
- }
- mListOpenVolumeChanges.push_back(set);
- return E_OK;
-}
-
-am_Error_e CAmControlSenderBase::hookUserSetSinkMuteState(const am_sinkID_t sinkID, const am_MuteState_e muteState)
-{
- if (mStateflow!=SF_NONE)
- return (E_NOT_POSSIBLE);
-
- assert(sinkID!=0);
-
- mainVolumeSet set;
- set.sinkID = sinkID;
- am_Error_e error;
- am_Sink_s sink;
- mControlReceiveInterface->getSinkInfoDB(sinkID, sink);
-
- if (muteState == MS_MUTED)
- {
- set.mainVolume = sink.mainVolume;
- if ((error = mControlReceiveInterface->setSinkVolume(set.handle, sinkID, 0, RAMP_GENIVI_DIRECT, 20)) != E_OK)
- {
- return error;
- }
- }
- else
- {
- set.mainVolume = sink.mainVolume;
- if ((error = mControlReceiveInterface->setSinkVolume(set.handle, sinkID, set.mainVolume, RAMP_GENIVI_DIRECT, 20)) != E_OK)
- {
- return error;
- }
- }
- mListOpenVolumeChanges.push_back(set);
- mControlReceiveInterface->changeSinkMuteStateDB(muteState, sinkID);
- return (E_OK);
-}
-
-am_Error_e CAmControlSenderBase::hookSystemRegisterDomain(const am_Domain_s & domainData, am_domainID_t & domainID)
-{
-//this application does not do anything with it -> but some product might want to take influence here
- return mControlReceiveInterface->enterDomainDB(domainData, domainID);
-}
-
-am_Error_e CAmControlSenderBase::hookSystemDeregisterDomain(const am_domainID_t domainID)
-{
-//this application does not do anything with it -> but some product might want to take influence here
- return mControlReceiveInterface->removeDomainDB(domainID);
-}
-
-void CAmControlSenderBase::hookSystemDomainRegistrationComplete(const am_domainID_t domainID)
-{
- (void) domainID;
-}
-
-am_Error_e CAmControlSenderBase::hookSystemRegisterSink(const am_Sink_s & sinkData, am_sinkID_t & sinkID)
-{
-//this application does not do anything with it -> but some product might want to take influence here
- return mControlReceiveInterface->enterSinkDB(sinkData, sinkID);
-}
-
-am_Error_e CAmControlSenderBase::hookSystemDeregisterSink(const am_sinkID_t sinkID)
-{
-//this application does not do anything with it -> but some product might want to take influence here
- return mControlReceiveInterface->removeSinkDB(sinkID);
-}
-
-am_Error_e CAmControlSenderBase::hookSystemRegisterSource(const am_Source_s & sourceData, am_sourceID_t & sourceID)
-{
-//this application does not do anything with it -> but some product might want to take influence here
- return mControlReceiveInterface->enterSourceDB(sourceData, sourceID);
-}
-
-am_Error_e CAmControlSenderBase::hookSystemDeregisterSource(const am_sourceID_t sourceID)
-{
-//this application does not do anything with it -> but some product might want to take influence here
- return mControlReceiveInterface->removeSourceDB(sourceID);
-}
-
-am_Error_e CAmControlSenderBase::hookSystemRegisterGateway(const am_Gateway_s & gatewayData, am_gatewayID_t & gatewayID)
-{
-//this application does not do anything with it -> but some product might want to take influence here
- return mControlReceiveInterface->enterGatewayDB(gatewayData, gatewayID);
-}
-
-am_Error_e CAmControlSenderBase::hookSystemRegisterConverter(const am_Converter_s & converterData, am_converterID_t & converterID)
-{
-//this application does not do anything with it -> but some product might want to take influence here
- return mControlReceiveInterface->enterConverterDB(converterData, converterID);
-}
-
-am_Error_e CAmControlSenderBase::hookSystemDeregisterGateway(const am_gatewayID_t gatewayID)
-{
-//this application does not do anything with it -> but some product might want to take influence here
- return mControlReceiveInterface->removeGatewayDB(gatewayID);
-}
-
-am_Error_e CAmControlSenderBase::hookSystemDeregisterConverter(const am_converterID_t converterID)
-{
- return mControlReceiveInterface->removeConverterDB(converterID);
-}
-
-am_Error_e CAmControlSenderBase::hookSystemRegisterCrossfader(const am_Crossfader_s & crossfaderData, am_crossfaderID_t & crossfaderID)
-{
-//this application does not do anything with it -> but some product might want to take influence here
- return mControlReceiveInterface->enterCrossfaderDB(crossfaderData, crossfaderID);
-}
-
-am_Error_e CAmControlSenderBase::hookSystemDeregisterCrossfader(const am_crossfaderID_t crossfaderID)
-{
-//this application does not do anything with it -> but some product might want to take influence here
- return mControlReceiveInterface->removeCrossfaderDB(crossfaderID);
-}
-
-void CAmControlSenderBase::hookSystemSinkVolumeTick(const am_Handle_s handle, const am_sinkID_t sinkID, const am_volume_t volume)
-{
- (void) handle;
- (void) sinkID;
- (void) volume;
-}
-
-void CAmControlSenderBase::hookSystemSourceVolumeTick(const am_Handle_s handle, const am_sourceID_t sourceID, const am_volume_t volume)
-{
- (void) handle;
- (void) sourceID;
- (void) volume;
-}
-
-void CAmControlSenderBase::hookSystemInterruptStateChange(const am_sourceID_t sourceID, const am_InterruptState_e interruptState)
-{
- (void) sourceID;
- (void) interruptState;
-}
-
-void CAmControlSenderBase::hookSystemSinkAvailablityStateChange(const am_sinkID_t sinkID, const am_Availability_s & availability)
-{
- (void) sinkID;
- (void) availability;
-}
-
-void CAmControlSenderBase::hookSystemSourceAvailablityStateChange(const am_sourceID_t sourceID, const am_Availability_s & availability)
-{
- (void) sourceID;
- (void) availability;
-}
-
-void CAmControlSenderBase::hookSystemDomainStateChange(const am_domainID_t domainID, const am_DomainState_e state)
-{
- (void) domainID;
- (void) state;
-}
-
-void CAmControlSenderBase::hookSystemReceiveEarlyData(const std::vector<am_EarlyData_s> & data)
-{
- (void) data;
-}
-
-void CAmControlSenderBase::hookSystemSpeedChange(const am_speed_t speed)
-{
- (void) speed;
-}
-
-void CAmControlSenderBase::hookSystemTimingInformationChanged(const am_mainConnectionID_t mainConnectionID, const am_timeSync_t time)
-{
- (void) mainConnectionID;
- (void) time;
-}
-
-void CAmControlSenderBase::cbAckConnect(const am_Handle_s handle, const am_Error_e errorID)
-{
- (void) errorID;
-//\todo:error checking
- std::vector<mainConnectionSet>::iterator it(mListOpenConnections.begin());
- for (; it != mListOpenConnections.end(); ++it)
- {
- std::vector<handleStatus>::iterator hit;
- handleStatus status;
- status.status = true;
- status.handle = handle;
- hit = std::find_if(it->listHandleStaus.begin(), it->listHandleStaus.end(), findHandle(status));
- if (hit == it->listHandleStaus.end())
- continue;
- hit->status = true;
- if (it->listHandleStaus.end() == std::find_if(it->listHandleStaus.begin(), it->listHandleStaus.end(), checkHandle(status)))
- {
- mControlReceiveInterface->changeMainConnectionStateDB(it->connectionID, CS_CONNECTED);
- mListOpenConnections.erase(it);
- break;
- }
- }
- callStateFlowHandler();
-}
-
-void CAmControlSenderBase::cbAckDisconnect(const am_Handle_s handle, const am_Error_e errorID)
-{
- (void) errorID;
-//\todo:error checking
- std::vector<mainConnectionSet>::iterator it(mListOpenDisconnections.begin());
- for (; it != mListOpenDisconnections.end(); ++it)
- {
- std::vector<handleStatus>::iterator hit;
- handleStatus status;
- status.status = true;
- status.handle = handle;
- hit = std::find_if(it->listHandleStaus.begin(), it->listHandleStaus.end(), findHandle(status));
- if (hit == it->listHandleStaus.end())
- continue;
- hit->status = true;
- if (it->listHandleStaus.end() == std::find_if(it->listHandleStaus.begin(), it->listHandleStaus.end(), checkHandle(status)))
- {
- mControlReceiveInterface->removeMainConnectionDB(it->connectionID);
- mListOpenDisconnections.erase(it);
- break;
- }
- }
- callStateFlowHandler();
-}
-
-void CAmControlSenderBase::cbAckCrossFade(const am_Handle_s handle, const am_HotSink_e hostsink, const am_Error_e error)
-{
- (void) handle;
- (void) hostsink;
- (void) error;
-}
-
-void CAmControlSenderBase::cbAckSetSinkVolumeChange(const am_Handle_s handle, const am_volume_t volume, const am_Error_e error)
-{
- (void) error;
- (void) volume;
- //\todo:error checking
- std::vector<mainVolumeSet>::iterator it(mListOpenVolumeChanges.begin());
- for (; it != mListOpenVolumeChanges.end(); ++it)
- {
- if (handle.handle == it->handle.handle)
- {
- mControlReceiveInterface->changeSinkMainVolumeDB(it->mainVolume, it->sinkID);
- mListOpenVolumeChanges.erase(it);
- break;
- }
- }
- callStateFlowHandler();
-}
-
-void CAmControlSenderBase::cbAckSetSourceVolumeChange(const am_Handle_s handle, const am_volume_t voulme, const am_Error_e error)
-{
- (void) error;
- (void) voulme;
- (void) handle;
- callStateFlowHandler();
-}
-
-void CAmControlSenderBase::cbAckSetSourceState(const am_Handle_s handle, const am_Error_e error)
-{
- (void) error;
- (void) handle;
- callStateFlowHandler();
-}
-
-void CAmControlSenderBase::cbAckSetSourceSoundProperty(const am_Handle_s handle, const am_Error_e error)
-{
- (void) error;
- (void) handle;
-}
-
-void CAmControlSenderBase::cbAckSetSinkSoundProperty(const am_Handle_s handle, const am_Error_e error)
-{
- (void) error;
-//\todo:error checking
- std::vector<mainSinkSoundPropertySet>::iterator it(mListMainSoundPropertyChanges.begin());
- for (; it != mListMainSoundPropertyChanges.end(); ++it)
- {
- if (handle.handle == it->handle.handle)
- {
- mControlReceiveInterface->changeMainSinkSoundPropertyDB(it->mainSoundProperty, it->sinkID);
- mListMainSoundPropertyChanges.erase(it);
- break;
- }
- }
-}
-
-void CAmControlSenderBase::cbAckSetSourceSoundProperties(const am_Handle_s handle, const am_Error_e error)
-{
- (void) error;
- (void) handle;
-}
-
-void CAmControlSenderBase::cbAckSetSinkSoundProperties(const am_Handle_s handle, const am_Error_e error)
-{
- (void) error;
- (void) handle;
-}
-
-void CAmControlSenderBase::setControllerRundown(const int16_t signal)
-{
- logInfo("CAmControlSenderBase::setControllerRundown() was called signal=",signal);
- if (signal==2)
- mControlReceiveInterface->confirmControllerRundown(E_UNKNOWN);
-
- mControlReceiveInterface->confirmControllerRundown(E_OK);
-}
-
-am_Error_e CAmControlSenderBase::getConnectionFormatChoice(const am_sourceID_t sourceID, const am_sinkID_t sinkID, const am_Route_s listRoute, const std::vector<am_CustomAvailabilityReason_t> listPossibleConnectionFormats, std::vector<am_CustomConnectionFormat_t> & listPrioConnectionFormats)
-{
- (void) sourceID;
- (void) sinkID;
- (void) listRoute;
-//ok, this is cheap. In a real product you have your preferences, right?
- listPrioConnectionFormats = listPossibleConnectionFormats;
- return (E_OK);
-}
-
-void CAmControlSenderBase::getInterfaceVersion(std::string & version) const
-{
- version = ControlSendVersion;
-}
-
-
-void CAmControlSenderBase::disconnect(am_mainConnectionID_t connectionID)
-{
-
- am_MainConnection_s mainConnection;
- am_Error_e error;
- if ((error = mControlReceiveInterface->getMainConnectionInfoDB(connectionID, mainConnection)) != E_OK)
- {
- logError("CAmControlSenderBase::disconnect Could not getInfor for mainconnection Error: ", error);
- return;
- }
-
- std::vector<am_connectionID_t>::iterator it(mainConnection.listConnectionID.begin());
- std::vector<handleStatus> listHandleStaus;
- for (; it != mainConnection.listConnectionID.end(); ++it)
- {
- handleStatus status;
- status.status = false;
- if ((error = mControlReceiveInterface->disconnect(status.handle, *it)))
- {
- logError("Could not disconnect, Error", error);
- }
- listHandleStaus.push_back(status);
- }
- mainConnectionSet set;
- set.connectionID = connectionID;
- set.listHandleStaus = listHandleStaus;
- mListOpenDisconnections.push_back(set);
-}
-
-void CAmControlSenderBase::connect(am_sourceID_t sourceID, am_sinkID_t sinkID, am_mainConnectionID_t mainConnectionID)
-{
- std::vector<am_Route_s> listRoutes;
- std::vector<am_connectionID_t> listConnectionIDs;
- am_SourceClass_s sourceClass, tempSourceClass;
- am_Handle_s handle;
- mControlReceiveInterface->getRoute(false, sourceID, sinkID, listRoutes);
- if (listRoutes.empty())
- logError("CAmControlSenderBase::connect not possible");
-
- std::vector<handleStatus> listHandleStaus;
- std::vector<am_RoutingElement_s>::iterator it(listRoutes[0].route.begin());
- for (; it != listRoutes[0].route.end(); ++it)
- {
- am_connectionID_t connectionID;
- mControlReceiveInterface->connect(handle, connectionID, it->connectionFormat, it->sourceID, it->sinkID);
- handleStatus status;
- status.handle = handle;
- status.status = false;
- listHandleStaus.push_back(status);
- listConnectionIDs.push_back(connectionID);
- }
- mainConnectionSet set;
- set.connectionID = mainConnectionID;
- set.listHandleStaus = listHandleStaus;
- mControlReceiveInterface->changeMainConnectionRouteDB(mainConnectionID,listConnectionIDs);
- mListOpenConnections.push_back(set);
-}
-
-void CAmControlSenderBase::callStateFlowHandler()
-{
- logInfo("CAmControlSenderBase::callStateFlowHandler() called, state ",mStateflow);
-
- switch(mStateflow)
- {
- case SF_CONNECT:
- callConnectHandler();
- break;
- case SF_TA:
- callTAHandler();
- break;
- case SF_NAVI:
- callNaviHandler();
- break;
- default:
- break;
-
- }
-}
-
-void CAmControlSenderBase::callConnectHandler()
-{
- logInfo("CAmControlSenderBase::callConnectHandler() called, state ",mConnectSf);
-
- am_Handle_s handle;
- am_Sink_s sinkData;
- switch (mConnectSf)
- {
- case SFC_RAMP_DOWN:
- mControlReceiveInterface->setSinkVolume(handle, mConnectData.sinkID, -60, RAMP_GENIVI_EXP_INV, 4000);
- mConnectSf = SFC_SOURCE_STATE_OFF;
- break;
- case SFC_SOURCE_STATE_OFF:
- mControlReceiveInterface->setSourceState(handle, mConnectData.oldSourceID, SS_OFF);
- mConnectSf = SFC_DISCONNECT;
- break;
- case SFC_DISCONNECT:
- disconnect(mConnectData.currentMainConnection);
- mConnectSf = SFC_CONNECT;
- break;
- case SFC_CONNECT:
- connect(mConnectData.sourceID, mConnectData.sinkID, mConnectData.newMainConnection);
- mConnectSf = SFC_SOURCE_STATE_ON;
- break;
- case SFC_SOURCE_STATE_ON:
- mControlReceiveInterface->setSourceState(handle, mConnectData.sourceID, SS_ON);
- mConnectSf = SFC_RAMP_UP;
- break;
- case SFC_RAMP_UP:
- mControlReceiveInterface->getSinkInfoDB(mConnectData.sinkID, sinkData);
- if (mControlReceiveInterface->setSinkVolume(handle, mConnectData.sinkID, (sinkData.mainVolume-10)*6, RAMP_GENIVI_EXP_INV, 4000)==E_NO_CHANGE)
- mStateflow=SF_NONE;
- mConnectSf=SFC_FINISHED;
- break;
- case SFC_FINISHED:
- mStateflow=SF_NONE;
- break;
- default:
- break;
- }
-}
-
-void CAmControlSenderBase::callNaviHandler()
-{
- logInfo("CAmControlSenderBase::callNaviHandler() called, state ",mConnectSf);
-
- am_Handle_s handle;
- am_Source_s sourceData;
- am_Sink_s sinkData;
- switch (mNaviSf)
- {
- case NAVC_RAMP_DOWN:
- mControlReceiveInterface->setSourceVolume(handle, mConnectData.oldSourceID, -13, RAMP_UNKNOWN, 2000);
- mNaviSf = NAVC_CONNECT;
- break;
- case NAVC_CONNECT:
- connect(mConnectData.sourceID, mConnectData.sinkID, mConnectData.newMainConnection);
- mNaviSf = NAVC_SOURCE_STATE_ON;
- break;
- case NAVC_SOURCE_STATE_ON:
- mControlReceiveInterface->setSourceState(handle, mConnectData.sourceID, SS_ON);
- mNaviSf = NAVC_RAMP_UP;
- break;
- case NAVC_RAMP_UP:
- mControlReceiveInterface->getSinkInfoDB(mConnectData.sinkID, sinkData);
- mControlReceiveInterface->setSinkVolume(handle, mConnectData.sinkID, (sinkData.mainVolume-10)*60+2, RAMP_UNKNOWN, 2000);
- mNaviSf=NAVC_WAIT_STATE;
- break;
- case NAVC_WAIT_STATE:
- mNaviSf=NAVC_RAMP_DOWN_AGAIN;
- break;
- case NAVC_RAMP_DOWN_AGAIN:
- mControlReceiveInterface->setSinkVolume(handle, mConnectData.sinkID, (sinkData.mainVolume-10)*60, RAMP_UNKNOWN, 2000);
- mNaviSf=NAVC_SOURCE_VOLUME_BACK;
- break;
- case NAVC_SOURCE_VOLUME_BACK:
- mControlReceiveInterface->setSourceVolume(handle, mConnectData.oldSourceID, 0, RAMP_UNKNOWN, 2000);
- mNaviSf=NAVC_SOURCE_ACTIVITY_BACK;
- break;
- case NAVC_SOURCE_ACTIVITY_BACK:
- mControlReceiveInterface->setSourceState(handle, mConnectData.sourceID, SS_OFF);
- mNaviSf=NAVC_DISCONNECT;
- break;
- case NAVC_DISCONNECT:
- disconnect(mConnectData.newMainConnection);
- mNaviSf=NAVC_FINISHED;
- break;
- case NAVC_FINISHED:
- mStateflow=SF_NONE;
- break;
- default:
- break;
- }
-}
-
-void CAmControlSenderBase::confirmCommandReady(const am_Error_e error)
-{
- (void) error;
- logInfo("ControlSenderPlugin got Command Ready confirmed");
-}
-
-void CAmControlSenderBase::confirmRoutingReady(const am_Error_e error)
-{
- (void)error;
- logInfo("ControlSenderPlugin got Routing Ready confirmed");
-}
-
-void CAmControlSenderBase::confirmCommandRundown(const am_Error_e error)
-{
- (void)error;
- logInfo("ControlSenderPlugin got Command Rundown confirmed");
-}
-
-void CAmControlSenderBase::confirmRoutingRundown(const am_Error_e error)
-{
- (void)error;
- logInfo("ControlSenderPlugin got Routing Rundown confirmed");
-}
-
-void CAmControlSenderBase::hookSystemNodeStateChanged(const NsmNodeState_e NodeStateId)
-{
- (void) NodeStateId;
- //here you can process informations about the notestate
-}
-
-void CAmControlSenderBase::hookSystemNodeApplicationModeChanged(const NsmApplicationMode_e ApplicationModeId)
-{
- (void) ApplicationModeId;
-}
-
-
-void CAmControlSenderBase::cbAckSetSinkNotificationConfiguration(const am_Handle_s handle, const am_Error_e error)
-{
- (void) handle;
- (void) error;
-}
-
-void CAmControlSenderBase::cbAckSetSourceNotificationConfiguration(const am_Handle_s handle, const am_Error_e error)
-{
- (void) handle;
- (void) error;
-}
-
-
-NsmErrorStatus_e CAmControlSenderBase::hookSystemLifecycleRequest(const uint32_t Request, const uint32_t RequestId)
-{
- (void) Request;
- (void) RequestId;
- logInfo("CAmControlSenderBase::hookSystemLifecycleRequest request=",Request," requestID=",RequestId);
- return (NsmErrorStatus_Error);
-}
-
-am_Error_e CAmControlSenderBase::hookSystemUpdateSink(const am_sinkID_t sinkID, const am_sinkClass_t sinkClassID, const std::vector<am_SoundProperty_s>& listSoundProperties, const std::vector<am_CustomConnectionFormat_t>& listConnectionFormats, const std::vector<am_MainSoundProperty_s>& listMainSoundProperties)
-{
- (void) sinkID;
- (void) sinkClassID;
- (void) listMainSoundProperties;
- (void) listConnectionFormats;
- (void) listSoundProperties;
- return (E_NOT_USED);
-}
-
-am_Error_e CAmControlSenderBase::hookSystemUpdateSource(const am_sourceID_t sourceID, const am_sourceClass_t sourceClassID, const std::vector<am_SoundProperty_s>& listSoundProperties, const std::vector<am_CustomConnectionFormat_t>& listConnectionFormats, const std::vector<am_MainSoundProperty_s>& listMainSoundProperties)
-{
- (void) sourceID;
- (void) sourceClassID;
- (void) listSoundProperties;
- (void) listMainSoundProperties;
- (void) listConnectionFormats;
- return (E_NOT_USED);
-}
-
-am_Error_e CAmControlSenderBase::hookSystemUpdateGateway(const am_gatewayID_t gatewayID, const std::vector<am_CustomConnectionFormat_t>& listSourceConnectionFormats, const std::vector<am_CustomConnectionFormat_t>& listSinkConnectionFormats, const std::vector<bool>& convertionMatrix)
-{
- (void) gatewayID;
- (void) listSourceConnectionFormats;
- (void) listSinkConnectionFormats;
- (void) convertionMatrix;
- return (E_NOT_USED);
-}
-
-am_Error_e CAmControlSenderBase::hookSystemUpdateConverter(const am_converterID_t converterID, const std::vector<am_CustomConnectionFormat_t>& listSourceConnectionFormats, const std::vector<am_CustomConnectionFormat_t>& listSinkConnectionFormats, const std::vector<bool>& convertionMatrix)
-{
- (void) converterID;
- (void) listSourceConnectionFormats;
- (void) listSinkConnectionFormats;
- (void) convertionMatrix;
- return (E_NOT_USED);
-}
-
-void CAmControlSenderBase::cbAckSetVolumes(const am_Handle_s handle, const std::vector<am_Volumes_s>& listVolumes, const am_Error_e error)
-{
- (void) handle;
- (void) listVolumes;
- (void) error;
-}
-
-void CAmControlSenderBase::hookSinkNotificationDataChanged(const am_sinkID_t sinkID, const am_NotificationPayload_s& payload)
-{
- (void) sinkID;
- (void) payload;
-}
-
-void CAmControlSenderBase::hookSourceNotificationDataChanged(const am_sourceID_t sourceID, const am_NotificationPayload_s& payload)
-{
- (void) sourceID;
- (void) payload;
-}
-
-am_Error_e CAmControlSenderBase::hookUserSetMainSinkNotificationConfiguration(const am_sinkID_t sinkID, const am_NotificationConfiguration_s& notificationConfiguration)
-{
- (void) sinkID;
- (void) notificationConfiguration;
- return (E_NOT_USED);
-}
-
-am_Error_e CAmControlSenderBase::hookUserSetMainSourceNotificationConfiguration(const am_sourceID_t sourceID, const am_NotificationConfiguration_s& notificationConfiguration)
-{
- (void) sourceID;
- (void) notificationConfiguration;
- return (E_NOT_USED);
-}
-
-void CAmControlSenderBase::hookSystemSessionStateChanged(const std::string& sessionName, const NsmSeat_e seatID, const NsmSessionState_e sessionStateID)
-{
- (void) sessionName;
- (void) seatID;
- (void) sessionStateID;
-}
-
-void CAmControlSenderBase::callTAHandler()
-{
- logInfo("CAmControlSenderBase::callTAHandler() called, state ",mConnectSf);
-
- am_Handle_s handle;
- am_Source_s sourceData;
- am_Sink_s sinkData;
- switch (mTrafficSf)
- {
- case TA_RAMP_DOWN:
- mControlReceiveInterface->setSourceState(handle, mConnectData.oldSourceID, SS_PAUSED);
- mTrafficSf = TA_CONNECT;
- break;
- case TA_CONNECT:
- connect(mConnectData.sourceID, mConnectData.sinkID, mConnectData.newMainConnection);
- mTrafficSf = TA_SOURCE_STATE_ON;
- break;
- case TA_SOURCE_STATE_ON:
- mControlReceiveInterface->setSourceState(handle, mConnectData.sourceID, SS_ON);
- mTrafficSf = TA_RAMP_UP;
- break;
- case TA_RAMP_UP:
- mControlReceiveInterface->getSinkInfoDB(mConnectData.sinkID, sinkData);
- mControlReceiveInterface->setSinkVolume(handle, mConnectData.sinkID, (sinkData.mainVolume-10)*60+2, RAMP_UNKNOWN, 2000);
- mTrafficSf=TA_WAIT_STATE;
- break;
- case TA_WAIT_STATE:
- mTrafficSf=TA_RAMP_DOWN_AGAIN;
- break;
- case TA_RAMP_DOWN_AGAIN:
- mControlReceiveInterface->setSinkVolume(handle, mConnectData.sinkID, (sinkData.mainVolume-10)*60, RAMP_UNKNOWN, 2000);
- mTrafficSf=TA_SOURCE_STATE_OFF;
- break;
- case TA_SOURCE_STATE_OFF:
- mControlReceiveInterface->setSourceState(handle, mConnectData.oldSourceID, SS_ON);
- mTrafficSf=TA_SOURCE_STATE_OLD_OFF;
- break;
- case TA_SOURCE_STATE_OLD_OFF:
- mControlReceiveInterface->setSourceState(handle, mConnectData.sourceID, SS_OFF);
- mTrafficSf=TA_DISCONNECT;
- break;
- case TA_DISCONNECT:
- disconnect(mConnectData.newMainConnection);
- mTrafficSf=TA_FINISHED;
- break;
- case TA_FINISHED:
- mStateflow=SF_NONE;
- break;
- default:
- break;
- }
-}
-
-
-
diff --git a/PluginControlInterface/src/IAmControlReceiverShadow.cpp b/PluginControlInterface/src/IAmControlReceiverShadow.cpp
deleted file mode 100644
index 649d621..0000000
--- a/PluginControlInterface/src/IAmControlReceiverShadow.cpp
+++ /dev/null
@@ -1,523 +0,0 @@
-/**
- * Copyright (c) 2012 BMW
- *
- * \author Christian Mueller, christian.ei.mueller@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 "IAmControlReceiverShadow.h"
-#include "control/IAmControlReceive.h"
-
-namespace am
-{
-
-IAmControlReceiverShadow::IAmControlReceiverShadow(IAmControlReceive *iReceiveInterface, CAmSocketHandler *iSocketHandler) :
- mpIAmControlReceiver(iReceiveInterface), //
- mCAmSerializer(iSocketHandler)
-{
-}
-
-IAmControlReceiverShadow::~IAmControlReceiverShadow()
-{
-
-}
-
-am_Error_e IAmControlReceiverShadow::getRoute(bool onlyfree, am_sourceID_t sourceID, am_sinkID_t sinkID, std::vector<am_Route_s> & returnList)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, const bool, const am_sourceID_t, const am_sinkID_t, std::vector<am_Route_s> &, bool, am_sourceID_t, am_sinkID_t, std::vector<am_Route_s> >(mpIAmControlReceiver, &IAmControlReceive::getRoute, error, onlyfree, sourceID, sinkID, returnList);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::connect(am_Handle_s & handle, am_connectionID_t & connectionID, am_CustomConnectionFormat_t format, am_sourceID_t sourceID, am_sinkID_t sinkID)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, am_Handle_s &, am_connectionID_t &, const am_CustomConnectionFormat_t, const am_sourceID_t, const am_sinkID_t, am_Handle_s, am_connectionID_t, am_CustomConnectionFormat_t, am_sourceID_t, am_sinkID_t>(mpIAmControlReceiver, &IAmControlReceive::connect, error, handle, connectionID, format, sourceID, sinkID);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::disconnect(am_Handle_s & handle, am_connectionID_t connectionID)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, am_Handle_s &, const am_connectionID_t, am_Handle_s, am_connectionID_t>(mpIAmControlReceiver, &IAmControlReceive::disconnect, error, handle, connectionID);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::crossfade(am_Handle_s & handle, am_HotSink_e hotSource, am_crossfaderID_t crossfaderID, am_CustomRampType_t rampType, am_time_t rampTime)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, am_Handle_s &, const am_HotSink_e, const am_crossfaderID_t, const am_CustomRampType_t, const am_time_t, am_Handle_s, am_HotSink_e, am_crossfaderID_t, am_CustomRampType_t, am_time_t>(mpIAmControlReceiver, &IAmControlReceive::crossfade, error, handle, hotSource, crossfaderID, rampType, rampTime);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::abortAction(am_Handle_s handle)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, const am_Handle_s, am_Handle_s>(mpIAmControlReceiver, &IAmControlReceive::abortAction, error, handle);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::setSourceState(am_Handle_s & handle, am_sourceID_t sourceID, am_SourceState_e state)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, am_Handle_s&, const am_sourceID_t, const am_SourceState_e, am_Handle_s, am_sourceID_t, am_SourceState_e>(mpIAmControlReceiver, &IAmControlReceive::setSourceState, error, handle, sourceID, state);
- return (error);
-
-}
-
-am_Error_e IAmControlReceiverShadow::setSinkVolume(am_Handle_s & handle, am_sinkID_t sinkID, am_volume_t volume, am_CustomRampType_t ramp, am_time_t time)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, am_Handle_s&, const am_sinkID_t, const am_volume_t, const am_CustomRampType_t, const am_time_t, am_Handle_s, am_sinkID_t, am_volume_t, am_CustomRampType_t, am_time_t>(mpIAmControlReceiver, &IAmControlReceive::setSinkVolume, error, handle, sinkID, volume, ramp, time);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::setSourceVolume(am_Handle_s & handle, am_sourceID_t sourceID, am_volume_t volume, am_CustomRampType_t rampType, am_time_t time)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, am_Handle_s&, const am_sourceID_t, const am_volume_t, const am_CustomRampType_t, const am_time_t, am_Handle_s, am_sourceID_t, am_volume_t, am_CustomRampType_t, am_time_t>(mpIAmControlReceiver, &IAmControlReceive::setSourceVolume, error, handle, sourceID, volume, rampType, time);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::setSinkSoundProperties(am_Handle_s & handle, am_sinkID_t sinkID, std::vector<am_SoundProperty_s> & soundProperty)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, am_Handle_s &, const am_sinkID_t, const std::vector<am_SoundProperty_s> &, am_Handle_s, am_sinkID_t, std::vector<am_SoundProperty_s> >(mpIAmControlReceiver, &IAmControlReceive::setSinkSoundProperties, error, handle, sinkID, soundProperty);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::setSinkSoundProperty(am_Handle_s & handle, am_sinkID_t sinkID, am_SoundProperty_s & soundProperty)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, am_Handle_s &, const am_sinkID_t, const am_SoundProperty_s &, am_Handle_s, am_sinkID_t, am_SoundProperty_s>(mpIAmControlReceiver, &IAmControlReceive::setSinkSoundProperty, error, handle, sinkID, soundProperty);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::setSourceSoundProperties(am_Handle_s & handle, am_sourceID_t sourceID, std::vector<am_SoundProperty_s> & soundProperty)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, am_Handle_s &, const am_sourceID_t, const std::vector<am_SoundProperty_s> &, am_Handle_s, am_sourceID_t, std::vector<am_SoundProperty_s> >(mpIAmControlReceiver, &IAmControlReceive::setSourceSoundProperties, error, handle, sourceID, soundProperty);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::setSourceSoundProperty(am_Handle_s & handle, am_sourceID_t sourceID, am_SoundProperty_s & soundProperty)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, am_Handle_s &, const am_sourceID_t, const am_SoundProperty_s &, am_Handle_s, am_sourceID_t, am_SoundProperty_s>(mpIAmControlReceiver, &IAmControlReceive::setSourceSoundProperty, error, handle, sourceID, soundProperty);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::setDomainState(am_domainID_t domainID, am_DomainState_e domainState)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, const am_domainID_t, const am_DomainState_e, am_domainID_t, am_DomainState_e>(mpIAmControlReceiver, &IAmControlReceive::setDomainState, error, domainID, domainState);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::enterDomainDB(am_Domain_s & domainData, am_domainID_t & domainID)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, const am_Domain_s&, am_domainID_t &, am_Domain_s, am_domainID_t>(mpIAmControlReceiver, &IAmControlReceive::enterDomainDB, error, domainData, domainID);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::enterMainConnectionDB(am_MainConnection_s & mainConnectionData, am_mainConnectionID_t & connectionID)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, const am_MainConnection_s &, am_mainConnectionID_t&, am_MainConnection_s, am_mainConnectionID_t>(mpIAmControlReceiver, &IAmControlReceive::enterMainConnectionDB, error, mainConnectionData, connectionID);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::enterSinkDB(am_Sink_s & sinkData, am_sinkID_t & sinkID)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, const am_Sink_s &, am_sinkID_t&, am_Sink_s, am_sinkID_t>(mpIAmControlReceiver, &IAmControlReceive::enterSinkDB, error, sinkData, sinkID);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::enterCrossfaderDB(am_Crossfader_s & crossfaderData, am_crossfaderID_t & crossfaderID)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, const am_Crossfader_s &, am_crossfaderID_t &, am_Crossfader_s, am_crossfaderID_t>(mpIAmControlReceiver, &IAmControlReceive::enterCrossfaderDB, error, crossfaderData, crossfaderID);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::enterGatewayDB(am_Gateway_s & gatewayData, am_gatewayID_t & gatewayID)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, const am_Gateway_s &, am_gatewayID_t &, am_Gateway_s, am_gatewayID_t>(mpIAmControlReceiver, &IAmControlReceive::enterGatewayDB, error, gatewayData, gatewayID);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::enterSourceDB(am_Source_s & sourceData, am_sourceID_t & sourceID)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, const am_Source_s &, am_sourceID_t &, am_Source_s, am_sourceID_t>(mpIAmControlReceiver, &IAmControlReceive::enterSourceDB, error, sourceData, sourceID);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::enterSinkClassDB(am_SinkClass_s & sinkClass, am_sinkClass_t & sinkClassID)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, const am_SinkClass_s &, am_sinkClass_t &, am_SinkClass_s, am_sinkClass_t>(mpIAmControlReceiver, &IAmControlReceive::enterSinkClassDB, error, sinkClass, sinkClassID);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::enterSourceClassDB(am_sourceClass_t & sourceClassID, am_SourceClass_s & sourceClass)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, am_sourceClass_t &, const am_SourceClass_s &, am_sourceClass_t, am_SourceClass_s>(mpIAmControlReceiver, &IAmControlReceive::enterSourceClassDB, error, sourceClassID, sourceClass);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::changeSinkClassInfoDB(am_SinkClass_s & sinkClass)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, const am_SinkClass_s &, am_SinkClass_s>(mpIAmControlReceiver, &IAmControlReceive::changeSinkClassInfoDB, error, sinkClass);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::changeSourceClassInfoDB(am_SourceClass_s & sourceClass)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, const am_SourceClass_s &, am_SourceClass_s>(mpIAmControlReceiver, &IAmControlReceive::changeSourceClassInfoDB, error, sourceClass);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::enterSystemPropertiesListDB(std::vector<am_SystemProperty_s> & listSystemProperties)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, const std::vector<am_SystemProperty_s> &, std::vector<am_SystemProperty_s> >(mpIAmControlReceiver, &IAmControlReceive::enterSystemPropertiesListDB, error, listSystemProperties);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::changeMainConnectionRouteDB(am_mainConnectionID_t mainconnectionID, std::vector<am_connectionID_t> & listConnectionID)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, const am_mainConnectionID_t, const std::vector<am_connectionID_t> &, am_mainConnectionID_t, std::vector<am_connectionID_t> >(mpIAmControlReceiver, &IAmControlReceive::changeMainConnectionRouteDB, error, mainconnectionID, listConnectionID);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::changeMainConnectionStateDB(am_mainConnectionID_t mainconnectionID, am_ConnectionState_e connectionState)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, const am_mainConnectionID_t, const am_ConnectionState_e, am_mainConnectionID_t, am_ConnectionState_e>(mpIAmControlReceiver, &IAmControlReceive::changeMainConnectionStateDB, error, mainconnectionID, connectionState);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::changeSinkMainVolumeDB(am_mainVolume_t mainVolume, am_sinkID_t sinkID)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, const am_mainVolume_t, const am_sinkID_t, am_mainVolume_t, am_sinkID_t>(mpIAmControlReceiver, &IAmControlReceive::changeSinkMainVolumeDB, error, mainVolume, sinkID);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::getListMainConnections(std::vector<am_MainConnection_s> & listMainConnections)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, std::vector<am_MainConnection_s> &, std::vector<am_MainConnection_s> >(mpIAmControlReceiver, &IAmControlReceive::getListMainConnections, error, listMainConnections);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::getListDomains(std::vector<am_Domain_s> & listDomains)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, std::vector<am_Domain_s> &, std::vector<am_Domain_s> >(mpIAmControlReceiver, &IAmControlReceive::getListDomains, error, listDomains);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::getListConnections(std::vector<am_Connection_s> & listConnections)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, std::vector<am_Connection_s>&, std::vector<am_Connection_s> >(mpIAmControlReceiver, &IAmControlReceive::getListConnections, error, listConnections);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::getListSinks(std::vector<am_Sink_s> & listSinks)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, std::vector<am_Sink_s> &, std::vector<am_Sink_s> >(mpIAmControlReceiver, &IAmControlReceive::getListSinks, error, listSinks);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::getListSources(std::vector<am_Source_s> & listSources)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, std::vector<am_Source_s> &, std::vector<am_Source_s> >(mpIAmControlReceiver, &IAmControlReceive::getListSources, error, listSources);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::getListSourceClasses(std::vector<am_SourceClass_s> & listSourceClasses)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, std::vector<am_SourceClass_s> &, std::vector<am_SourceClass_s> >(mpIAmControlReceiver, &IAmControlReceive::getListSourceClasses, error, listSourceClasses);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::getListHandles(std::vector<am_Handle_s> & listHandles)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, std::vector<am_Handle_s> &, std::vector<am_Handle_s> >(mpIAmControlReceiver, &IAmControlReceive::getListHandles, error, listHandles);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::getListCrossfaders(std::vector<am_Crossfader_s> & listCrossfaders)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, std::vector<am_Crossfader_s> &, std::vector<am_Crossfader_s> >(mpIAmControlReceiver, &IAmControlReceive::getListCrossfaders, error, listCrossfaders);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::getListGateways(std::vector<am_Gateway_s> & listGateways)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, std::vector<am_Gateway_s>&, std::vector<am_Gateway_s> >(mpIAmControlReceiver, &IAmControlReceive::getListGateways, error, listGateways);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::getListSinkClasses(std::vector<am_SinkClass_s> & listSinkClasses)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, std::vector<am_SinkClass_s> &, std::vector<am_SinkClass_s> >(mpIAmControlReceiver, &IAmControlReceive::getListSinkClasses, error, listSinkClasses);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::getListSystemProperties(std::vector<am_SystemProperty_s> & listSystemProperties)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, std::vector<am_SystemProperty_s> &, std::vector<am_SystemProperty_s> >(mpIAmControlReceiver, &IAmControlReceive::getListSystemProperties, error, listSystemProperties);
- return (error);
-}
-
-void IAmControlReceiverShadow::setCommandReady()
-{
- mCAmSerializer.asyncCall<IAmControlReceive>(mpIAmControlReceiver, &IAmControlReceive::setCommandReady);
-}
-
-void IAmControlReceiverShadow::setCommandRundown()
-{
- mCAmSerializer.asyncCall<IAmControlReceive>(mpIAmControlReceiver, &IAmControlReceive::setCommandRundown);
-}
-
-void IAmControlReceiverShadow::setRoutingReady()
-{
- mCAmSerializer.asyncCall<IAmControlReceive>(mpIAmControlReceiver, &IAmControlReceive::setRoutingReady);
-}
-
-void IAmControlReceiverShadow::setRoutingRundown()
-{
- mCAmSerializer.asyncCall<IAmControlReceive>(mpIAmControlReceiver, &IAmControlReceive::setRoutingRundown);
-}
-
-void am::IAmControlReceiverShadow::confirmControllerReady(am_Error_e error)
-{
- mCAmSerializer.asyncCall<IAmControlReceive,am_Error_e>(mpIAmControlReceiver,&IAmControlReceive::confirmControllerReady,error);
-}
-
-void am::IAmControlReceiverShadow::confirmControllerRundown(am_Error_e error)
-{
- mCAmSerializer.asyncCall<IAmControlReceive,am_Error_e>(mpIAmControlReceiver, &IAmControlReceive::confirmControllerRundown,error);
-}
-
-am_Error_e IAmControlReceiverShadow::getSocketHandler(CAmSocketHandler *& socketHandler)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, CAmSocketHandler*&, CAmSocketHandler*>(mpIAmControlReceiver, &IAmControlReceive::getSocketHandler, error, socketHandler);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::changeSinkAvailabilityDB(am_Availability_s& availability, am_sinkID_t sinkID)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, const am_Availability_s&, const am_sinkID_t, am_Availability_s, am_sinkID_t>(mpIAmControlReceiver, &IAmControlReceive::changeSinkAvailabilityDB, error, availability, sinkID);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::changDomainStateDB(am_DomainState_e domainState, am_domainID_t domainID)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, am_DomainState_e, const am_domainID_t, am_DomainState_e, am_domainID_t>(mpIAmControlReceiver, &IAmControlReceive::changDomainStateDB, error, domainState, domainID);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::changeSinkMuteStateDB(am_MuteState_e muteState, am_sinkID_t sinkID)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, am_MuteState_e, const am_sinkID_t, am_MuteState_e, am_sinkID_t>(mpIAmControlReceiver, &IAmControlReceive::changeSinkMuteStateDB, error, muteState, sinkID);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::changeMainSinkSoundPropertyDB(am_MainSoundProperty_s& soundProperty, am_sinkID_t sinkID)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, const am_MainSoundProperty_s&, const am_sinkID_t, am_MainSoundProperty_s, am_sinkID_t>(mpIAmControlReceiver, &IAmControlReceive::changeMainSinkSoundPropertyDB, error, soundProperty, sinkID);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::changeMainSourceSoundPropertyDB(am_MainSoundProperty_s& soundProperty, am_sourceID_t sourceID)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, const am_MainSoundProperty_s&, const am_sourceID_t, am_MainSoundProperty_s, am_sourceID_t>(mpIAmControlReceiver, &IAmControlReceive::changeMainSourceSoundPropertyDB, error, soundProperty, sourceID);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::changeSourceAvailabilityDB(am_Availability_s& availability, am_sourceID_t sourceID)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, const am_Availability_s&, const am_sourceID_t, am_Availability_s, am_sourceID_t>(mpIAmControlReceiver, &IAmControlReceive::changeSourceAvailabilityDB, error, availability, sourceID);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::changeSystemPropertyDB(am_SystemProperty_s& property)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, const am_SystemProperty_s&, am_SystemProperty_s>(mpIAmControlReceiver, &IAmControlReceive::changeSystemPropertyDB, error, property);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::removeMainConnectionDB(am_mainConnectionID_t mainConnectionID)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, const am_mainConnectionID_t, am_mainConnectionID_t>(mpIAmControlReceiver, &IAmControlReceive::removeMainConnectionDB, error, mainConnectionID);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::removeSinkDB(am_sinkID_t sinkID)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, const am_sinkID_t, am_sinkID_t>(mpIAmControlReceiver, &IAmControlReceive::removeSinkDB, error, sinkID);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::removeSourceDB(am_sourceID_t sourceID)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, const am_sourceID_t, am_sourceID_t>(mpIAmControlReceiver, &IAmControlReceive::removeSourceDB, error, sourceID);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::removeGatewayDB(am_gatewayID_t gatewayID)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, const am_gatewayID_t, am_gatewayID_t>(mpIAmControlReceiver, &IAmControlReceive::removeGatewayDB, error, gatewayID);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::removeCrossfaderDB(am_crossfaderID_t crossfaderID)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, const am_crossfaderID_t, am_crossfaderID_t>(mpIAmControlReceiver, &IAmControlReceive::removeCrossfaderDB, error, crossfaderID);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::removeDomainDB(am_domainID_t domainID)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, const am_domainID_t, am_domainID_t>(mpIAmControlReceiver, &IAmControlReceive::removeDomainDB, error, domainID);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::removeSinkClassDB(am_sinkClass_t sinkClassID)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, const am_sinkClass_t, am_sinkClass_t>(mpIAmControlReceiver, &IAmControlReceive::removeSinkClassDB, error, sinkClassID);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::removeSourceClassDB(am_sourceClass_t sourceClassID)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, const am_sourceClass_t, am_sourceClass_t>(mpIAmControlReceiver, &IAmControlReceive::removeSourceClassDB, error, sourceClassID);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::getSourceClassInfoDB(am_sourceID_t sourceID, am_SourceClass_s& classInfo)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, const am_sourceID_t, am_SourceClass_s&, am_sourceID_t, am_SourceClass_s>(mpIAmControlReceiver, &IAmControlReceive::getSourceClassInfoDB, error, sourceID, classInfo);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::getSinkClassInfoDB(am_sinkID_t sinkID, am_SinkClass_s& sinkClass)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, const am_sinkID_t, am_SinkClass_s&, am_sinkID_t, am_SinkClass_s>(mpIAmControlReceiver, &IAmControlReceive::getSinkClassInfoDB, error, sinkID, sinkClass);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::getSinkInfoDB(am_sinkID_t sinkID, am_Sink_s& sinkData)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, const am_sinkID_t, am_Sink_s&, am_sinkID_t, am_Sink_s>(mpIAmControlReceiver, &IAmControlReceive::getSinkInfoDB, error, sinkID, sinkData);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::getSourceInfoDB(am_sourceID_t sourceID, am_Source_s& sourceData)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, const am_sourceID_t, am_Source_s&, am_sourceID_t, am_Source_s>(mpIAmControlReceiver, &IAmControlReceive::getSourceInfoDB, error, sourceID, sourceData);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::getGatewayInfoDB(am_gatewayID_t gatewayID, am_Gateway_s& gatewayData)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, const am_gatewayID_t, am_Gateway_s&, am_gatewayID_t, am_Gateway_s>(mpIAmControlReceiver, &IAmControlReceive::getGatewayInfoDB, error, gatewayID, gatewayData);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::getCrossfaderInfoDB(am_crossfaderID_t crossfaderID, am_Crossfader_s& crossfaderData)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, const am_crossfaderID_t, am_Crossfader_s&, am_crossfaderID_t, am_Crossfader_s>(mpIAmControlReceiver, &IAmControlReceive::getCrossfaderInfoDB, error, crossfaderID, crossfaderData);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::getMainConnectionInfoDB(am_mainConnectionID_t mainConnectionID, am_MainConnection_s& mainConnectionData)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, const am_mainConnectionID_t, am_MainConnection_s&, am_mainConnectionID_t, am_MainConnection_s>(mpIAmControlReceiver, &IAmControlReceive::getMainConnectionInfoDB, error, mainConnectionID, mainConnectionData);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::getListSinksOfDomain(am_domainID_t domainID, std::vector<am_sinkID_t>& listSinkID)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, const am_domainID_t, std::vector<am_sinkID_t>&, am_domainID_t, std::vector<am_sinkID_t> >(mpIAmControlReceiver, &IAmControlReceive::getListSinksOfDomain, error, domainID, listSinkID);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::getListSourcesOfDomain(am_domainID_t domainID, std::vector<am_sourceID_t>& listSourceID)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, const am_domainID_t, std::vector<am_sourceID_t>&, am_domainID_t, std::vector<am_sourceID_t> >(mpIAmControlReceiver, &IAmControlReceive::getListSourcesOfDomain, error, domainID, listSourceID);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::getListCrossfadersOfDomain(am_domainID_t domainID, std::vector<am_crossfaderID_t>& listCrossfadersID)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, const am_domainID_t, std::vector<am_crossfaderID_t>&, am_domainID_t, std::vector<am_crossfaderID_t> >(mpIAmControlReceiver, &IAmControlReceive::getListCrossfadersOfDomain, error, domainID, listCrossfadersID);
- return (error);
-}
-
-am_Error_e IAmControlReceiverShadow::getListGatewaysOfDomain(am_domainID_t domainID, std::vector<am_gatewayID_t>& listGatewaysID)
-{
- am_Error_e error;
- mCAmSerializer.syncCall<IAmControlReceive, am_Error_e, const am_domainID_t, std::vector<am_gatewayID_t>&, am_domainID_t, std::vector<am_gatewayID_t> >(mpIAmControlReceiver, &IAmControlReceive::getListGatewaysOfDomain, error, domainID, listGatewaysID);
- return (error);
-}
-
-
-
-} /* namespace am */
diff --git a/PluginControlInterface/test/CAmControlReceiverShadowTest.cpp b/PluginControlInterface/test/CAmControlReceiverShadowTest.cpp
deleted file mode 100644
index 3eed9f2..0000000
--- a/PluginControlInterface/test/CAmControlReceiverShadowTest.cpp
+++ /dev/null
@@ -1,135 +0,0 @@
-/**
- * Copyright (c) 2012 BMW
- *
- * \author Christian Mueller, christian.ei.mueller@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 "CAmControlReceiverShadowTest.h"
-
-using namespace testing;
-using namespace am;
-
-CAmControlReceiverShadowTest::CAmControlReceiverShadowTest() :
- psocketHandler(), //
- pMockReceive(), //
- pShadow(&pMockReceive, &psocketHandler), //
- ptimerCallback(this, &CAmControlReceiverShadowTest::timerCallback)
-{
- DefaultValue<am_Error_e>::Set(E_OK); // Sets the default value to be returned.
-}
-
-CAmControlReceiverShadowTest::~CAmControlReceiverShadowTest()
-{
-}
-
-void CAmControlReceiverShadowTest::SetUp()
-{
- timespec t;
- t.tv_nsec = 1000000;
- t.tv_sec = 0;
-
- sh_timerHandle_t handle;
-
- IAmShTimerCallBack *buf = &ptimerCallback;
- //lets use a timeout so the test will finish
- psocketHandler.addTimer(t, buf, handle, (void*) NULL);
-}
-
-void CAmControlReceiverShadowTest::timerCallback(sh_timerHandle_t handle, void* userData)
-{
- (void)handle;
- (void)userData;
- psocketHandler.stop_listening();
-}
-
-void CAmControlReceiverShadowTest::TearDown()
-{
-}
-
-void* run_the_loop(void* socketHandlerPtr)
-{
- CAmSocketHandler* socketHandler = static_cast<CAmSocketHandler*>(socketHandlerPtr);
- socketHandler->start_listenting();
- return (NULL);
-}
-
-TEST_F(CAmControlReceiverShadowTest,getRoute)
-{
- pthread_t ptestThread;
- bool onlyfree(true);
- am_sourceID_t sourceID(1);
- am_sinkID_t sinkID(2);
- am_Route_s route;
- am_RoutingElement_s routingElement;
- std::vector<am_RoutingElement_s> route_;
- std::vector<am_Route_s> returnList, List;
- routingElement.sinkID = 1;
- routingElement.sourceID = 2;
- routingElement.domainID = 3;
- routingElement.connectionFormat = CF_GENIVI_ANALOG;
- route_.push_back(routingElement);
- route.sinkID = 1;
- route.sourceID = 2;
- route.route = route_;
- returnList.push_back(route);
- EXPECT_CALL(pMockReceive,getRoute(onlyfree,sourceID,sinkID,_)).WillOnce(DoAll(SetArgReferee<3>(returnList),Return(E_OK)));
- pthread_create(&ptestThread, NULL, run_the_loop, (void*) &psocketHandler);
- ASSERT_EQ(E_OK, pShadow.getRoute(onlyfree, sourceID, sinkID, List));
- pthread_join(ptestThread, NULL);
-}
-
-TEST_F(CAmControlReceiverShadowTest,connect)
-{
- pthread_t ptestThread;
- am_Handle_s handle, handleReturn;
- handle.handle = 1;
- handle.handleType = H_CONNECT;
- am_connectionID_t connectionID(3), connectionIDReturn;
- am_CustomAvailabilityReason_t connectionFormat(CF_GENIVI_ANALOG);
- am_sourceID_t sourceID(1);
- am_sinkID_t sinkID(2);
-
- EXPECT_CALL(pMockReceive, connect(_,_, connectionFormat, sourceID, sinkID)).WillOnce(DoAll(SetArgReferee<0>(handle),SetArgReferee<1>(connectionID),Return(E_OK)));
- pthread_create(&ptestThread, NULL, run_the_loop, (void*) &psocketHandler);
- ASSERT_EQ(E_OK,pShadow.connect(handleReturn,connectionIDReturn, connectionFormat, sourceID, sinkID));
- ASSERT_EQ(handleReturn.handle,handle.handle);
- ASSERT_EQ(handleReturn.handleType,handle.handleType);
- ASSERT_EQ(connectionIDReturn,connectionID);
- pthread_join(ptestThread, NULL);
-}
-
-TEST_F(CAmControlReceiverShadowTest,disconnect)
-{
- pthread_t ptestThread;
- am_Handle_s handle, handleReturn;
- handle.handle = 1;
- handle.handleType = H_CONNECT;
- am_connectionID_t connectionID(3);
-
- EXPECT_CALL(pMockReceive, disconnect(_,connectionID)).WillOnce(DoAll(SetArgReferee<0>(handle),Return(E_OK)));
- pthread_create(&ptestThread, NULL, run_the_loop, (void*) &psocketHandler);
- ASSERT_EQ(E_OK,pShadow.disconnect(handleReturn,connectionID));
- ASSERT_EQ(handleReturn.handle,handle.handle);
- ASSERT_EQ(handleReturn.handleType,handle.handleType);
- pthread_join(ptestThread, NULL);
-}
-
-//todo: implement more tests !
-
-int main(int argc, char **argv)
-{
- ::testing::InitGoogleTest(&argc, argv);
- return RUN_ALL_TESTS();
-}
-
diff --git a/PluginControlInterface/test/CAmControlReceiverShadowTest.h b/PluginControlInterface/test/CAmControlReceiverShadowTest.h
deleted file mode 100644
index a544c39..0000000
--- a/PluginControlInterface/test/CAmControlReceiverShadowTest.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
- * Copyright (c) 2012 BMW
- *
- * \author Christian Mueller, christian.ei.mueller@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 CAMCONTROLRECEIVERSHADOWTEST_H_
-#define CAMCONTROLRECEIVERSHADOWTEST_H_
-
-#include "gtest/gtest.h"
-#include "gmock/gmock.h"
-#include "MockIAmControlReceive.h"
-#include "shared/CAmSocketHandler.h"
-#include "shared/CAmSerializer.h"
-#include "../include/IAmControlReceiverShadow.h"
-
-namespace am
-{
-
-class CAmControlReceiverShadowTest: public ::testing::Test
-{
-public:
- CAmSocketHandler psocketHandler;
- MockIAmControlReceive pMockReceive;
- IAmControlReceiverShadow pShadow;
- void timerCallback(sh_timerHandle_t handle, void* userData);
- TAmShTimerCallBack<CAmControlReceiverShadowTest> ptimerCallback;
- CAmControlReceiverShadowTest();
- ~CAmControlReceiverShadowTest();
- void SetUp();
- void TearDown();
-};
-
-} /* namespace am */
-#endif /* CAMCONTROLRECEIVERSHADOWTEST_H_ */
diff --git a/PluginControlInterface/test/CMakeLists.txt b/PluginControlInterface/test/CMakeLists.txt
deleted file mode 100644
index 3dc5d08..0000000
--- a/PluginControlInterface/test/CMakeLists.txt
+++ /dev/null
@@ -1,98 +0,0 @@
-# Copyright (c) 2012 GENIVI Alliance
-# Copyright (c) 2012 BMW
-#
-# author Christian Mueller, christian.ei.mueller@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.6)
-
-PROJECT(AmControlReceiverShadowTest)
-
-set(EXECUTABLE_OUTPUT_PATH ${TEST_EXECUTABLE_OUTPUT_PATH})
-
-FIND_PACKAGE (Threads)
-FIND_PACKAGE(PkgConfig)
-
-
-IF(WITH_DLT)
- pkg_check_modules(DLT REQUIRED automotive-dlt>=2.2.0)
-ENDIF(WITH_DLT)
-
-INCLUDE_DIRECTORIES(
- ${STD_INCLUDE_DIRS}
- ${CMAKE_SOURCE_DIR}
- ${CMAKE_CURRENT_BINARY_DIR}
- ${AUDIO_INCLUDE_FOLDER}
- ${CMAKE_SOURCE_DIR}
- ${DLT_INCLUDE_DIRS}
- ${INCLUDE_FOLDER}
- ${DBUS_INCLUDE_DIR}
- ${DBUS_ARCH_INCLUDE_DIR}
- ${GOOGLE_TEST_INCLUDE_DIR}
- ${GMOCK_INCLUDE_DIR}
- "../../AudioManagerDaemon/include"
- "../include"
-)
-
-file(GLOB CONTROL_RECEIVER_PLUGIN_INTERFACE_SRCS_CXX
- "../../AudioManagerDaemon/src/CAmSocketHandler.cpp"
- "../../AudioManagerDaemon/src/CAmDltWrapper.cpp"
- "../../AudioManagerDaemon/src/CAmDatabaseObserver.cpp"
- "../../AudioManagerDaemon/src/CAmCommandSender.cpp"
- "../../AudioManagerDaemon/src/CAmTelnetServer.cpp"
- "../../AudioManagerDaemon/src/CAmTelnetMenuHelper.cpp"
- "../../AudioManagerDaemon/src/CAmRoutingSender.cpp"
- "../../AudioManagerDaemon/src/CAmRoutingReceiver.cpp"
- "../../AudioManagerDaemon/src/CAmCommandReceiver.cpp"
- "../../AudioManagerDaemon/src/CAmControlSender.cpp"
- "../../AudioManagerDaemon/src/CAmControlReceiver.cpp"
- "../../AudioManagerDaemon/src/CAmRouter.cpp"
- "../src/IAmControlReceiverShadow.cpp"
- "CAmControlReceiverShadowTest.cpp"
-)
-
-IF(WITH_DATABASE_STORAGE)
- SET (CONTROL_RECEIVER_PLUGIN_INTERFACE_SRCS_CXX
- ${CONTROL_RECEIVER_PLUGIN_INTERFACE_SRCS_CXX}
- "../../AudioManagerDaemon/src/CAmDatabaseHandlerSQLite.cpp")
-ELSE(WITH_DATABASE_STORAGE)
- SET (CONTROL_RECEIVER_PLUGIN_INTERFACE_SRCS_CXX
- ${CONTROL_RECEIVER_PLUGIN_INTERFACE_SRCS_CXX}
- "../../AudioManagerDaemon/src/CAmDatabaseHandlerMap.cpp")
-ENDIF(WITH_DATABASE_STORAGE)
-
-ADD_EXECUTABLE(AmControlReceiverShadowTest ${CONTROL_RECEIVER_PLUGIN_INTERFACE_SRCS_CXX})
-
-
-TARGET_LINK_LIBRARIES(AmControlReceiverShadowTest
- ${DLT_LIBRARIES}
- ${CMAKE_DL_LIBS}
- ${CMAKE_THREAD_LIBS_INIT}
- ${DBUS_LIBRARIES}
- ${SQLITE_LIBRARIES}
- gtest
- gmock
- rt
-)
-
-ADD_DEPENDENCIES(AmControlReceiverShadowTest gtest gmock)
-
-INSTALL(TARGETS AmControlReceiverShadowTest
- DESTINATION "~/AudioManagerTest/"
- PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
- COMPONENT tests
-)
-
-SET(ADD_DEPEND "audiomanager-bin" "dlt" "libdbus-1-3(>=1.2.16)" "libpthread-stubs0")
-set_property(GLOBAL APPEND PROPERTY tests_prop "${ADD_DEPEND}")
-
diff --git a/PluginRoutingInterfaceAsync/CMakeLists.txt b/PluginRoutingInterfaceAsync/CMakeLists.txt
deleted file mode 100644
index ece397d..0000000
--- a/PluginRoutingInterfaceAsync/CMakeLists.txt
+++ /dev/null
@@ -1,82 +0,0 @@
-# Copyright (c) 2012 BMW
-#
-# author Christian Mueller, christian.ei.mueller@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.6)
-
-PROJECT(PluginRoutingInterfaceAsync)
-
-OPTION (WITH_ROUTING_INTERFACE_ASYNC
- "build with routing interface async plugin" ON)
-
-IF (WITH_ROUTING_INTERFACE_ASYNC)
-
-set(LIBRARY_OUTPUT_PATH ${PLUGINS_OUTPUT_PATH}/routing)
-set(DOC_OUTPUT_PATH ${DOC_OUTPUT_PATH}/RoutingAsync)
-set(INCLUDE_FOLDER "include")
-
-FILE(READ "${AUDIO_INCLUDE_FOLDER}/routing/IAmRoutingSend.h" VERSION_BUFFER LIMIT 6000)
-STRING(REGEX MATCH "RoutingSendVersion*.[^0-9]*[0-9].[0-9]*[0-9]" LIB_INTERFACE_VERSION_STRING ${VERSION_BUFFER})
-STRING(REGEX REPLACE "RoutingSendVersion*.." "" LIB_INTERFACE_VERSION ${LIB_INTERFACE_VERSION_STRING})
-MESSAGE(STATUS "Building against routing interface version ${LIB_INTERFACE_VERSION}")
-
-find_package( Threads )
-FIND_PACKAGE(DBUS REQUIRED)
-
-INCLUDE_DIRECTORIES(
- ${CMAKE_SOURCE_DIR}
- ${CMAKE_CURRENT_BINARY_DIR}
- ${AUDIO_INCLUDE_FOLDER}
- ${PROJECT_INCLUDE_FOLDER}
- ${INCLUDE_FOLDER}
- ${DBUS_INCLUDE_DIR}
- ${DBUS_ARCH_INCLUDE_DIR}
-)
-
-# all source files go here
-file(GLOB PLUGINDBUS_SRCS_CXX "src/*.cpp")
-
-
-add_library(PluginRoutingInterfaceAsync MODULE ${PLUGINDBUS_SRCS_CXX})
-
-TARGET_LINK_LIBRARIES(PluginRoutingInterfaceAsync
- ${DLT_LIBRARIES}
- ${DBUS_LIBRARIES}
- ${CMAKE_THREAD_LIBS_INIT}
-)
-
-IF(WITH_TESTS)
- add_subdirectory (test)
-ENDIF(WITH_TESTS)
-
-#IF(WITH_DOCUMENTATION)
-# file(MAKE_DIRECTORY ${DOC_OUTPUT_PATH})
-# configure_file(${DOXY_FILE} ${DOC_OUTPUT_PATH}/Doxyfile @ONLY IMMEDIATE)
-# add_custom_target (PluginRoutingInterfaceAsyncDocs ALL
-# COMMAND ${DOXYGEN_EXECUTABLE} ${DOC_OUTPUT_PATH}/Doxyfile WORKING_DIRECTORY ${DOC_OUTPUT_PATH}
-# SOURCES ${PROJECT_BINARY_DIR} ${DOC_OUTPUT_PATH}/Doxyfile
-# )
-#ENDIF(WITH_DOCUMENTATION)
-
-
-INSTALL(TARGETS PluginRoutingInterfaceAsync
- DESTINATION "lib/${LIB_INSTALL_SUFFIX}/routing"
- PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
- COMPONENT sampleplugins
-)
-
-SET(ADD_DEPEND "audiomanager-bin" "dlt" "libdbus-1-3(>=1.2.16)" "libpthread-stubs0")
-set_property(GLOBAL APPEND PROPERTY sampleplugins_prop "${ADD_DEPEND}")
-
-ENDIF (WITH_ROUTING_INTERFACE_ASYNC)
diff --git a/PluginRoutingInterfaceAsync/include/CAmRoutingSenderAsync.h b/PluginRoutingInterfaceAsync/include/CAmRoutingSenderAsync.h
deleted file mode 100644
index 22fded2..0000000
--- a/PluginRoutingInterfaceAsync/include/CAmRoutingSenderAsync.h
+++ /dev/null
@@ -1,392 +0,0 @@
-/**
- * Copyright (c) 2012 BMW
- *
- * \author Christian Mueller, christian.ei.mueller@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 ROUTINGSENDER_H_
-#define ROUTINGSENDER_H_
-
-#include "routing/IAmRoutingSend.h"
-#include "IAmRoutingReceiverShadow.h"
-#include <semaphore.h>
-#include <memory.h>
-#include <map>
-
-namespace am
-{
-
-class CAmWorkerThreadPool;
-
-/**
- * Base class for workers implements everything that is needed to implement a workerthread
- * inherit from this class when adding new workers
- */
-class CAmWorker
-{
-public:
- CAmWorker(CAmWorkerThreadPool* pool);
- virtual ~CAmWorker()
- {};
- /**
- * needs to be overwritten, this function is called when the worker should start to work
- */
- void virtual start2work()=0;
-
- /**
- * needs to be overwritten, this function is called when the worker thread is canceled. Should be used for
- * clean up and sending important messages
- */
- void virtual cancelWork()=0;
- /**
- * waits for a semaphore with a timeout. This leaves the Threadpool the chance to interrupt the processing
- * You should call whenever waiting on some event, even with time=0 in order to make sure that cancel events are
- * received
- * @param time time until timeout in timespec format
- * @return true if thread is canceled. Then just return start2work function so that the thread is given back to the pool
- */
- bool timedWait(timespec time);
-
- /**
- * the semaphore for cancellation is set by the thread automatically...
- * @param cancel
- */
- void setCancelSempaphore(sem_t* cancel);
- CAmWorkerThreadPool* pPool;
-private:
- sem_t* mCancelSem; //<! semaphore for cancellation
-};
-
-/**
- * This class handles the threadpool
- */
-class CAmWorkerThreadPool
-{
-public:
- /**
- * creates the pool. Give the max number of threads as argument
- * @param numThreads max number of threads
- */
- CAmWorkerThreadPool(int numThreads);
- virtual ~CAmWorkerThreadPool();
-
- /**
- * assigns a thread to a worker class and starts working.
- * @param worker
- * @return the actual assigned workerID or -1 in case no thread is free
- */
- int16_t startWork(CAmWorker* worker);
- /**
- * cancels a thread
- * @param workerID thread to be canceled
- * @return true if thread was found, false if not
- */
- bool cancelWork(int workerID);
-
- /**
- * the workers call this function upon completion of their task
- * @param threadID
- */
- void finishedWork(pthread_t threadID);
-
-private:
- static void* CAmWorkerThread(void* data);
- int mNumThreads;
- struct threadInfo_s
- {
- uint16_t workerID;
- pthread_t threadID;
- bool busy;
- sem_t block;
- sem_t cancel;
- CAmWorker *worker;
- };
- std::vector<threadInfo_s> mListWorkers; //<! list of all workers
- static pthread_mutex_t mBlockingMutex; //<! mutex to block the acces of the list
-};
-
-class CAmRoutingSenderAsync: public IAmRoutingSend
-{
-public:
- CAmRoutingSenderAsync();
- virtual ~CAmRoutingSenderAsync();
- am_Error_e startupInterface(IAmRoutingReceive* routingreceiveinterface) ;
- 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_CustomConnectionFormat_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) ;
-
- /**
- * threadafe insert of route and connectionID
- * @param connectionID
- * @param route
- */
- void insertConnectionSafe(am_connectionID_t connectionID, am_RoutingElement_s route);
-
- /**
- * threadsafe removal of a connection
- * @param
- */
- void removeConnectionSafe(am_connectionID_t);
-
- /**
- * threadsafe remove of a handle
- * @param handle
- */
- void removeHandleSafe(uint16_t handle);
-
- /**
- * threadsafe update of Sinkvolume
- * @param sinkID
- * @param volume
- */
- void updateSinkVolumeSafe(am_sinkID_t sinkID, am_volume_t volume);
-
- /**
- * threadsafe update of SourceVolume
- * @param sourceID
- * @param volume
- */
- void updateSourceVolumeSafe(am_sourceID_t sourceID, am_volume_t volume);
-
- /**
- * threadsafe update of sourceState
- * @param sourceID
- * @param state
- */
- void updateSourceStateSafe(am_sourceID_t sourceID, am_SourceState_e state);
-
- /**
- * threadsafe update of sinkSoundProperty
- * @param sinkID
- * @param soundProperty
- */
- void updateSinkSoundPropertySafe(am_sinkID_t sinkID, am_SoundProperty_s soundProperty);
-
- /**
- * threadsafe update of sourceSoundProperty
- * @param sourceID
- * @param soundProperty
- */
- void updateSourceSoundPropertySafe(am_sourceID_t sourceID, am_SoundProperty_s soundProperty);
-
- /**
- * threadsafe update of domainstate
- * @param domainID
- * @param domainState
- */
- void updateDomainstateSafe(am_domainID_t domainID, am_DomainState_e domainState);
-
- void updateDomainListSafe(std::vector<am_Domain_s> listDomains);
-
- void updateSourceListSafe(std::vector<am_Source_s> listSource);
-
- void updateSinkListSafe(std::vector<am_Sink_s> listSinks);
-
-private:
- /**
- * Extra thread that handles dbus stimulation for interrupt tests
- * This is a very very very basic implementation of the dbus interface
- * there is not failure handling, nothing.
- * it is used just for testing, not intended to be used otherwise...
- * @param data
- */
- std::vector<am_Domain_s> createDomainTable();
- std::vector<am_Sink_s> createSinkTable();
- std::vector<am_Source_s> createSourceTable();
- std::vector<am_Gateway_s> createGatewayTable();
- IAmRoutingReceiverShadow* mShadow;
- IAmRoutingReceive* mReceiveInterface;
- CAmSocketHandler *mSocketHandler;
- std::vector<am_Domain_s> mDomains;
- std::vector<am_Sink_s> mSinks;
- std::vector<am_Source_s> mSources;
- std::vector<am_Gateway_s> mGateways;
- std::map<uint16_t, int16_t> mMapHandleWorker;
- std::map<am_connectionID_t, am_RoutingElement_s> mMapConnectionIDRoute;
- CAmWorkerThreadPool mPool;
- pthread_t mInterruptThread;
- static pthread_mutex_t mMapConnectionMutex;
- static pthread_mutex_t mMapHandleWorkerMutex;
- static pthread_mutex_t mSinksMutex;
- static pthread_mutex_t mSourcesMutex;
- static pthread_mutex_t mDomainsMutex;
-};
-
-/**
- * worker to for connection
- */
-class asycConnectWorker: public CAmWorker
-{
-public:
- asycConnectWorker(CAmRoutingSenderAsync * asyncSender, CAmWorkerThreadPool* pool, IAmRoutingReceiverShadow* shadow, const am_Handle_s handle, const am_connectionID_t connectionID, const am_sourceID_t sourceID, const am_sinkID_t sinkID, const am_CustomConnectionFormat_t connectionFormat);
- void start2work();
- void cancelWork();
-private:
- CAmRoutingSenderAsync * mAsyncSender;
- IAmRoutingReceiverShadow *mShadow;
- am_Handle_s mHandle;
- am_connectionID_t mConnectionID;
- am_sourceID_t mSourceID;
- am_sinkID_t mSinkID;
- am_CustomConnectionFormat_t mConnectionFormat;
-};
-
-/**
- * worker for disconnecting
- */
-class asycDisConnectWorker: public CAmWorker
-{
-public:
- asycDisConnectWorker(CAmRoutingSenderAsync * asyncSender, CAmWorkerThreadPool* pool, IAmRoutingReceiverShadow* shadow, const am_Handle_s handle, const am_connectionID_t connectionID);
- void start2work();
- void cancelWork();
-private:
- CAmRoutingSenderAsync * mAsyncSender;
- IAmRoutingReceiverShadow *mShadow;
- am_Handle_s mHandle;
- am_connectionID_t mConnectionID;
- am_CustomConnectionFormat_t mConnectionFormat;
-};
-
-/**
- * worker to for connection
- */
-
-#include <semaphore.h>
-#include <sys/signalfd.h>
-#include <signal.h>
-
-class asyncSetSinkVolumeWorker: public CAmWorker
-{
-public:
- asyncSetSinkVolumeWorker(CAmRoutingSenderAsync * asyncSender, CAmWorkerThreadPool* pool, IAmRoutingReceiverShadow* shadow, const am_volume_t currentVolume, 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);
- void start2work();
- void cancelWork();
-private:
- CAmRoutingSenderAsync * mAsyncSender;
- IAmRoutingReceiverShadow *mShadow;
- am_volume_t mCurrentVolume;
- am_Handle_s mHandle;
- am_sinkID_t mSinkID;
- am_volume_t mVolume;
- am_CustomRampType_t mRamp;
- am_time_t mTime;
-};
-
-class asyncSetSourceVolumeWorker: public CAmWorker
-{
-public:
- asyncSetSourceVolumeWorker(CAmRoutingSenderAsync * asyncSender, CAmWorkerThreadPool* pool, IAmRoutingReceiverShadow* shadow, const am_volume_t currentVolume, 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);
- void start2work();
- void cancelWork();
-private:
- CAmRoutingSenderAsync * mAsyncSender;
- IAmRoutingReceiverShadow *mShadow;
- am_volume_t mCurrentVolume;
- am_Handle_s mHandle;
- am_sourceID_t mSourceID;
- am_volume_t mVolume;
- am_CustomRampType_t mRamp;
- am_time_t mTime;
-};
-
-class asyncSetSourceStateWorker: public CAmWorker
-{
-public:
- asyncSetSourceStateWorker(CAmRoutingSenderAsync * asyncSender, CAmWorkerThreadPool* pool, IAmRoutingReceiverShadow* shadow, const am_Handle_s handle, const am_sourceID_t sourceID, const am_SourceState_e state);
- void start2work();
- void cancelWork();
-private:
- CAmRoutingSenderAsync * mAsyncSender;
- IAmRoutingReceiverShadow *mShadow;
- am_Handle_s mHandle;
- am_sourceID_t mSourceID;
- am_SourceState_e mSourcestate;
-};
-
-class asyncSetSinkSoundPropertyWorker: public CAmWorker
-{
-public:
- asyncSetSinkSoundPropertyWorker(CAmRoutingSenderAsync * asyncSender, CAmWorkerThreadPool* pool, IAmRoutingReceiverShadow* shadow, const am_Handle_s handle, const am_SoundProperty_s soundProperty, const am_sinkID_t sinkID);
- void start2work();
- void cancelWork();
-private:
- CAmRoutingSenderAsync * mAsyncSender;
- IAmRoutingReceiverShadow *mShadow;
- am_Handle_s mHandle;
- am_sinkID_t mSinkID;
- am_SoundProperty_s mSoundProperty;
-};
-
-class asyncSetSourceSoundPropertyWorker: public CAmWorker
-{
-public:
- asyncSetSourceSoundPropertyWorker(CAmRoutingSenderAsync * asyncSender, CAmWorkerThreadPool* pool, IAmRoutingReceiverShadow* shadow, const am_Handle_s handle, const am_SoundProperty_s soundProperty, const am_sourceID_t sourceID);
- void start2work();
- void cancelWork();
-private:
- CAmRoutingSenderAsync * mAsyncSender;
- IAmRoutingReceiverShadow *mShadow;
- am_Handle_s mHandle;
- am_sourceID_t mSourceID;
- am_SoundProperty_s mSoundProperty;
-};
-
-class asyncDomainStateChangeWorker: public CAmWorker
-{
-public:
- asyncDomainStateChangeWorker(CAmRoutingSenderAsync * asyncSender, CAmWorkerThreadPool* pool, IAmRoutingReceiverShadow* shadow, const am_domainID_t domainID, const am_DomainState_e domainState);
- void start2work();
- void cancelWork();
-private:
- CAmRoutingSenderAsync * mAsyncSender;
- IAmRoutingReceiverShadow *mShadow;
- am_domainID_t mDomainID;
- am_DomainState_e mDomainState;
-};
-
-class syncRegisterWorker: public CAmWorker
-{
-public:
- syncRegisterWorker(CAmRoutingSenderAsync * asyncSender, CAmWorkerThreadPool* pool, IAmRoutingReceiverShadow* shadow, const std::vector<am_Domain_s> domains, const std::vector<am_Sink_s> sinks, const std::vector<am_Source_s> sources, const uint16_t handle);
- void start2work();
- void cancelWork();
-private:
- CAmRoutingSenderAsync * mAsyncSender;
- IAmRoutingReceiverShadow *mShadow;
- std::vector<am_Domain_s> mListDomains;
- std::vector<am_Sink_s> mListSinks;
- std::vector<am_Source_s> mListSources;
- uint16_t mHandle;
-};
-
-}
-
-#endif /* ROUTINGSENDER_H_ */
diff --git a/PluginRoutingInterfaceAsync/include/IAmRoutingReceiverShadow.h b/PluginRoutingInterfaceAsync/include/IAmRoutingReceiverShadow.h
deleted file mode 100644
index 48056f1..0000000
--- a/PluginRoutingInterfaceAsync/include/IAmRoutingReceiverShadow.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/**
- * Copyright (c) 2012 BMW
- *
- * \author Christian Mueller, christian.ei.mueller@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 ROUTINGRECEIVERASYNCSHADOW_H_
-#define ROUTINGRECEIVERASYNCSHADOW_H_
-
-#include "routing/IAmRoutingReceive.h"
-#include "shared/CAmSerializer.h"
-#include "shared/CAmSocketHandler.h"
-
-namespace am
-{
-
-/**
- * Threadsafe shadow of the RoutingReceiverInterface
- * Register and deregister Functions are sychronous so they do not show up here...
- */
-class IAmRoutingReceiverShadow
-{
-public:
- IAmRoutingReceiverShadow(IAmRoutingReceive* iReceiveInterface,CAmSocketHandler* iSocketHandler);
- virtual ~IAmRoutingReceiverShadow();
- void ackConnect(const am_Handle_s handle, const am_connectionID_t connectionID, const am_Error_e error);
- void ackDisconnect(const am_Handle_s handle, const am_connectionID_t connectionID, const am_Error_e error);
- void ackSetSinkVolumeChange(const am_Handle_s handle, const am_volume_t volume, const am_Error_e error);
- void ackSetSourceVolumeChange(const am_Handle_s handle, const am_volume_t volume, const am_Error_e error);
- void ackSetSourceState(const am_Handle_s handle, const am_Error_e error);
- void ackSetSinkSoundProperty(const am_Handle_s handle, const am_Error_e error);
- void ackSetSourceSoundProperty(const am_Handle_s handle, const am_Error_e error);
- void ackCrossFading(const am_Handle_s handle, const am_HotSink_e hotSink, const am_Error_e error);
- void ackSourceVolumeTick(const am_Handle_s handle, const am_sourceID_t sourceID, const am_volume_t volume);
- void ackSinkVolumeTick(const am_Handle_s handle, const am_sinkID_t sinkID, const am_volume_t volume);
- void hookInterruptStatusChange(const am_sourceID_t sourceID, const am_InterruptState_e interruptState);
- void hookSinkAvailablityStatusChange(const am_sinkID_t sinkID, const am_Availability_s& availability);
- void hookSourceAvailablityStatusChange(const am_sourceID_t sourceID, const am_Availability_s& availability);
- void hookDomainStateChange(const am_domainID_t domainID, const am_DomainState_e domainState);
- void hookTimingInformationChanged(const am_connectionID_t connectionID, const am_timeSync_t delay);
- am_Error_e registerDomain(const am_Domain_s& domainData, am_domainID_t& domainID) ;
- am_Error_e registerGateway(const am_Gateway_s& gatewayData, am_gatewayID_t& gatewayID) ;
- am_Error_e registerSink(const am_Sink_s& sinkData, am_sinkID_t& sinkID) ;
- am_Error_e deregisterSink(const am_sinkID_t sinkID) ;
- am_Error_e registerSource(const am_Source_s& sourceData, am_sourceID_t& sourceID) ;
- am_Error_e deregisterSource(const am_sourceID_t sourceID) ;
- am_Error_e registerCrossfader(const am_Crossfader_s& crossfaderData, am_crossfaderID_t& crossfaderID) ;
- void confirmRoutingReady(uint16_t starupHandle, am_Error_e error);
- void confirmRoutingRundown(uint16_t rundownHandle,am_Error_e error);
-
-private:
-
- CAmSocketHandler *mSocketHandler;
- IAmRoutingReceive *mRoutingReceiveInterface;
- CAmSerializer mSerializer;
-};
-
-} /* namespace am */
-#endif /* ROUTINGRECEIVERASYNCSHADOW_H_ */
diff --git a/PluginRoutingInterfaceAsync/src/CAmRoutingSenderAsync.cpp b/PluginRoutingInterfaceAsync/src/CAmRoutingSenderAsync.cpp
deleted file mode 100644
index 58499b0..0000000
--- a/PluginRoutingInterfaceAsync/src/CAmRoutingSenderAsync.cpp
+++ /dev/null
@@ -1,1328 +0,0 @@
-/**
- * Copyright (c) 2012 BMW
- *
- * \author Christian Mueller, christian.ei.mueller@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 "CAmRoutingSenderAsync.h"
-#include <algorithm>
-#include <vector>
-#include <poll.h>
-#include <errno.h>
-#include <time.h>
-#include <cassert>
-#include <sstream>
-#include <string>
-#include <dbus/dbus.h>
-#include "shared/CAmDltWrapper.h"
-
-#define MAX_NS 1000000000L
-
-using namespace am;
-
-DLT_DECLARE_CONTEXT(PluginRoutingAsync)
-
-extern "C" IAmRoutingSend* PluginRoutingInterfaceAsyncFactory()
-{
- return (new CAmRoutingSenderAsync());
-}
-
-extern "C" void destroyRoutingPluginInterfaceAsync(IAmRoutingSend* routingSendInterface)
-{
- delete routingSendInterface;
-}
-
-pthread_mutex_t CAmRoutingSenderAsync::mMapConnectionMutex = PTHREAD_MUTEX_INITIALIZER;
-pthread_mutex_t CAmRoutingSenderAsync::mMapHandleWorkerMutex = PTHREAD_MUTEX_INITIALIZER;
-pthread_mutex_t CAmRoutingSenderAsync::mSinksMutex= PTHREAD_MUTEX_INITIALIZER;
-pthread_mutex_t CAmRoutingSenderAsync::mSourcesMutex= PTHREAD_MUTEX_INITIALIZER;
-pthread_mutex_t CAmRoutingSenderAsync::mDomainsMutex= PTHREAD_MUTEX_INITIALIZER;
-pthread_mutex_t CAmWorkerThreadPool::mBlockingMutex = PTHREAD_MUTEX_INITIALIZER;
-
-void *CAmWorkerThreadPool::CAmWorkerThread(void* data)
-{
- threadInfo_s *myInfo=(threadInfo_s*)data;
- while (1)
- {
- sem_wait(&myInfo->block);
- pthread_mutex_lock(&mBlockingMutex);
- CAmWorker* actWorker=myInfo->worker;
- pthread_mutex_unlock(&mBlockingMutex);
- actWorker->setCancelSempaphore(&myInfo->cancel);
- actWorker->start2work();
- actWorker->pPool->finishedWork(myInfo->threadID);
- }
- return NULL;
-}
-
-CAmWorkerThreadPool::CAmWorkerThreadPool(int numThreads):
-mNumThreads(numThreads)
-{
- int workerID=0;
- mListWorkers.resize(mNumThreads);
- for (int i=0;i<mNumThreads;i++)
- {
- sem_init(&mListWorkers[i].block,0,0);
- sem_init(&mListWorkers[i].cancel,0,0);
- mListWorkers[i].busy=false;
- mListWorkers[i].workerID=++workerID;
- pthread_create(&mListWorkers[i].threadID,NULL,&CAmWorkerThreadPool::CAmWorkerThread,(void*)&mListWorkers[i]);
- }
-}
-
-int16_t CAmWorkerThreadPool::startWork(CAmWorker *worker)
-{
- pthread_mutex_lock(&mBlockingMutex);
- std::vector<threadInfo_s>::iterator it=mListWorkers.begin();
- for(;it!=mListWorkers.end();++it)
- {
- if(!it->busy)
- {
- it->worker=worker;
- it->busy=true;
- pthread_mutex_unlock(&mBlockingMutex);
- sem_post(&it->block);
- return ((int)it->workerID);
- }
- }
- pthread_mutex_unlock(&mBlockingMutex);
- return (-1);
-}
-
-bool CAmWorkerThreadPool::cancelWork(int workerID)
-{
- std::vector<threadInfo_s>::iterator it=mListWorkers.begin();
- for(;it!=mListWorkers.end();++it)
- {
- if(it->workerID==workerID && it->busy)
- {
- sem_post(&it->cancel);
- return (true);
- }
- }
- return (false);
-}
-
-void CAmWorkerThreadPool::finishedWork(pthread_t threadID)
-{
- pthread_mutex_lock(&mBlockingMutex);
- std::vector<threadInfo_s>::iterator it=mListWorkers.begin();
- for(;it!=mListWorkers.end();++it)
- {
- if(it->threadID==threadID)
- {
- it->busy=false;
- delete it->worker;
- break;
- }
- }
- pthread_mutex_unlock(&mBlockingMutex);
-}
-
-CAmWorkerThreadPool::~CAmWorkerThreadPool()
-{
- for (int i=0;i<mNumThreads;i++)
- {
- pthread_cancel(mListWorkers[i].threadID);
- }
-}
-
-CAmWorker::CAmWorker(CAmWorkerThreadPool *pool):
-pPool(pool), mCancelSem ( ) { }
-void CAmWorker ::setCancelSempaphore ( sem_t * cancel )
-{
- mCancelSem=cancel;
-}
-
-bool CAmWorker::timedWait(timespec timer)
-{
- timespec temp;
- if (clock_gettime(0, &temp) == -1)
- {
- logError("Worker::timedWait error on getting time");
- }
- temp.tv_nsec += timer.tv_nsec;
- temp.tv_sec += timer.tv_sec;
-
- if (temp.tv_nsec >= MAX_NS)
- {
- temp.tv_sec++;
- temp.tv_nsec = temp.tv_nsec - MAX_NS;
- }
- //if(sem_wait(mCancelSem)==-1)
- if (sem_timedwait(mCancelSem, &temp) == -1)
- {
- //a timeout happened
- if (errno == ETIMEDOUT)
- {
- logInfo("Worker::timedWait timed out - no bug !");
- return (false);
- }
- else //failure in waiting, nevertheless, we quit the thread...
- {
- logError("Worker::timedWait semaphore waiting error");
- return (true);
- }
- }
- logError("Worker::timedWait semaphore waiting error");
- this->cancelWork();
- return (true);
-}
-
-CAmRoutingSenderAsync::CAmRoutingSenderAsync() :
- mReceiveInterface(0), //
- mDomains(createDomainTable()), //
- mSinks(createSinkTable()), //
- mSources(createSourceTable()), //
- mGateways(createGatewayTable()), //
- mMapHandleWorker(), //
- mMapConnectionIDRoute(), //
- mPool(10),
- mInterruptThread(0)
-{
-}
-
-CAmRoutingSenderAsync::~CAmRoutingSenderAsync()
-{
- delete mShadow;
-}
-
-am_Error_e CAmRoutingSenderAsync::startupInterface(IAmRoutingReceive *routingreceiveinterface)
-{
- //first, create the Shadow:
- assert(routingreceiveinterface!=0);
- mReceiveInterface = routingreceiveinterface;
- CAmSocketHandler* handler;
- routingreceiveinterface->getSocketHandler(handler);
- mShadow = new IAmRoutingReceiverShadow(routingreceiveinterface, handler);
- return E_OK;
-}
-
-void CAmRoutingSenderAsync::setRoutingReady(const uint16_t handle)
-{
- syncRegisterWorker *worker = new syncRegisterWorker(this, &mPool, mShadow, mDomains, mSinks, mSources, handle);
-
- if ((mPool.startWork(worker)) == -1)
- {
- logError("AsyncRoutingSender::asyncConnect not enough threads!");
- delete worker;
- }
-
- //gateways
-// std::vector<am_Gateway_s>::iterator gatewayIter=mGateways.begin();
-// for(;gatewayIter!=mGateways.end();++gatewayIter)
-// {
-// am_gatewayID_t gatewayID;
-// gatewayIter->domainSinkID=mDomains[0].domainID;
-// gatewayIter->domainSourceID=mDomains[1].domainID;
-// gatewayIter->controlDomainID=mDomains[0].domainID;
-// if((eCode=mReceiveInterface->registerGateway(*gatewayIter,gatewayID))!=E_OK)
-// {
-// logError("AsyncRoutingSender::routingInterfacesReady error on registering gateway, failed with",eCode));
-// }
-// gatewayIter->gatewayID=gatewayID;
-// }
-
- //create thread for interrupts, but only if we are testing - otherwise we get 100% cpu load:
- //todo: find a solution for the 100% dbus load to uncomment this and make interrupt tests work
- //pthread_create(&mInterruptThread,NULL,&AsyncRoutingSender::InterruptEvents,&mShadow);
-}
-
-void CAmRoutingSenderAsync::setRoutingRundown(const uint16_t handle)
-{
- assert(mReceiveInterface!=0);
- mShadow->confirmRoutingRundown(handle,E_OK);
-}
-
-am_Error_e CAmRoutingSenderAsync::asyncAbort(const am_Handle_s handle)
-{
- assert(mReceiveInterface!=0);
- assert(handle.handle!=0);
-
- //first check if we know the handle
- pthread_mutex_lock(&mMapHandleWorkerMutex);
- std::map<uint16_t, int16_t>::iterator iter = mMapHandleWorker.begin();
- if (mMapHandleWorker.find(handle.handle) == mMapHandleWorker.end())
- {
- pthread_mutex_unlock(&mMapHandleWorkerMutex);
- return (E_NON_EXISTENT);
- }
- pthread_mutex_unlock(&mMapHandleWorkerMutex);
-
- //ok, cancel the action:
- if (mPool.cancelWork(iter->second))
- return (E_OK);
- return (E_UNKNOWN);
-}
-
-am_Error_e CAmRoutingSenderAsync::asyncConnect(const am_Handle_s handle, const am_connectionID_t connectionID, const am_sourceID_t sourceID, const am_sinkID_t sinkID, const am_CustomConnectionFormat_t connectionFormat)
-{
- assert(mReceiveInterface!=0);
- assert(handle.handle!=0);
- assert(handle.handleType==H_CONNECT);
- assert(connectionID!=0);
- assert(sinkID!=0);
- assert(sourceID!=0);
-
- //check if we can take the job
- am_Sink_s sink;
- am_Source_s source;
- int16_t work = -1;
-
- //find the sink
- std::vector<am_Sink_s>::iterator sinkIter = mSinks.begin();
- for (; sinkIter != mSinks.end(); ++sinkIter)
- {
- if (sinkIter->sinkID == sinkID)
- {
- sink = *sinkIter;
- break;
- }
- }
- if (sinkIter == mSinks.end())
- return (E_NON_EXISTENT); //not found!
-
- //find the source
- std::vector<am_Source_s>::iterator sourceIter = mSources.begin();
- for (; sourceIter != mSources.end(); ++sourceIter)
- {
- if (sourceIter->sourceID == sourceID)
- {
- source = *sourceIter;
- break;
- }
- }
- if (sourceIter == mSources.end())
- return (E_NON_EXISTENT); //not found!
-
- //check the format
- if (std::find(source.listConnectionFormats.begin(), source.listConnectionFormats.end(), connectionFormat) == source.listConnectionFormats.end())
- return (E_WRONG_FORMAT);
- if (std::find(sink.listConnectionFormats.begin(), sink.listConnectionFormats.end(), connectionFormat) == sink.listConnectionFormats.end())
- return (E_WRONG_FORMAT);
-
- //the operation is ok, lets create a worker, assign it to a task in the task pool
- asycConnectWorker *worker = new asycConnectWorker(this, &mPool, mShadow, handle, connectionID, sourceID, sinkID, connectionFormat);
- if ((work = mPool.startWork(worker)) == -1)
- {
- logError("AsyncRoutingSender::asyncConnect not enough threads!");
- delete worker;
- return (E_NOT_POSSIBLE);
- }
-
- //save the handle related to the workerID
- pthread_mutex_lock(&mMapHandleWorkerMutex);
- mMapHandleWorker.insert(std::make_pair(+handle.handle, work));
- pthread_mutex_unlock(&mMapHandleWorkerMutex);
-
- return (E_OK);
-}
-
-am_Error_e CAmRoutingSenderAsync::asyncDisconnect(const am_Handle_s handle, const am_connectionID_t connectionID)
-{
- assert(mReceiveInterface!=0);
- assert(handle.handle!=0);
- assert(handle.handleType==H_DISCONNECT);
- assert(connectionID!=0);
-
- //check if we can take the job
- int16_t work = -1;
-
- pthread_mutex_lock(&mMapConnectionMutex);
- if (mMapConnectionIDRoute.find(connectionID) == mMapConnectionIDRoute.end())
- {
- pthread_mutex_unlock(&mMapConnectionMutex);
- return (E_NON_EXISTENT);
- }
- pthread_mutex_unlock(&mMapConnectionMutex);
-
- //the operation is ok, lets create a worker, assign it to a task in the task pool
- asycDisConnectWorker *worker = new asycDisConnectWorker(this, &mPool, mShadow, handle, connectionID);
- if ((work = mPool.startWork(worker)) == -1)
- {
- logError("AsyncRoutingSender::asyncDisconnect not enough threads!");
- delete worker;
- return (E_NOT_POSSIBLE);
- }
-
- //save the handle related to the workerID
- pthread_mutex_lock(&mMapHandleWorkerMutex);
- mMapHandleWorker.insert(std::make_pair(+handle.handle, work));
- pthread_mutex_unlock(&mMapHandleWorkerMutex);
-
- return (E_OK);
-}
-
-am_Error_e CAmRoutingSenderAsync::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)
-{
- assert(mReceiveInterface!=0);
- assert(handle.handle!=0);
- assert(handle.handleType==H_SETSINKVOLUME);
- assert(sinkID!=0);
-
- //check if we can take the job
- am_Sink_s sink;
- int16_t work = -1;
-
- //find the sink
- pthread_mutex_lock(&mSinksMutex);
- std::vector<am_Sink_s>::iterator sinkIter = mSinks.begin();
- for (; sinkIter != mSinks.end(); ++sinkIter)
- {
- if (sinkIter->sinkID == sinkID)
- {
- sink = *sinkIter;
- break;
- }
- }
- pthread_mutex_unlock(&mSinksMutex);
- if (sinkIter == mSinks.end())
- return (E_NON_EXISTENT); //not found!
-
- asyncSetSinkVolumeWorker *worker = new asyncSetSinkVolumeWorker(this, &mPool, mShadow, sinkIter->volume, handle, sinkID, volume, ramp, time);
- if ((work = mPool.startWork(worker)) == -1)
- {
- logError("AsyncRoutingSender::asyncSetSinkVolume not enough threads!");
- delete worker;
- return (E_NOT_POSSIBLE);
- }
-
- //save the handle related to the workerID
- pthread_mutex_lock(&mMapHandleWorkerMutex);
- mMapHandleWorker.insert(std::make_pair(+handle.handle, work));
- pthread_mutex_unlock(&mMapHandleWorkerMutex);
-
- return (E_OK);
-}
-
-am_Error_e CAmRoutingSenderAsync::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)
-{
- assert(mReceiveInterface!=0);
- assert(handle.handle!=0);
- assert(handle.handleType==H_SETSOURCEVOLUME);
- assert(sourceID!=0);
-
- //check if we can take the job
- am_Source_s source;
- int16_t work = -1;
-
- //find the sink
- pthread_mutex_lock(&mSourcesMutex);
- std::vector<am_Source_s>::iterator sourceIter = mSources.begin();
- for (; sourceIter != mSources.end(); ++sourceIter)
- {
- if (sourceIter->sourceID == sourceID)
- {
- source = *sourceIter;
- break;
- }
- }
- pthread_mutex_unlock(&mSourcesMutex);
- if (sourceIter == mSources.end())
- return (E_NON_EXISTENT); //not found!
-
- asyncSetSourceVolumeWorker *worker = new asyncSetSourceVolumeWorker(this, &mPool, mShadow, sourceIter->volume, handle, sourceID, volume, ramp, time);
- if ((work = mPool.startWork(worker)) == -1)
- {
- logError("AsyncRoutingSender::asyncSetSourceVolume not enough threads!");
- delete worker;
- return (E_NOT_POSSIBLE);
- }
-
- //save the handle related to the workerID
- pthread_mutex_lock(&mMapHandleWorkerMutex);
- mMapHandleWorker.insert(std::make_pair(+handle.handle, work));
- pthread_mutex_unlock(&mMapHandleWorkerMutex);
-
- return (E_OK);
-}
-
-am_Error_e CAmRoutingSenderAsync::asyncSetSourceState(const am_Handle_s handle, const am_sourceID_t sourceID, const am_SourceState_e state)
-{
- assert(mReceiveInterface!=0);
- assert(handle.handle!=0);
- assert(handle.handleType==H_SETSOURCESTATE);
- assert(sourceID!=0);
-
- //check if we can take the job
- am_Source_s source;
- int16_t work = -1;
-
- //find the source
- pthread_mutex_lock(&mSourcesMutex);
- std::vector<am_Source_s>::iterator sourceIter = mSources.begin();
- for (; sourceIter != mSources.end(); ++sourceIter)
- {
- if (sourceIter->sourceID == sourceID)
- {
- source = *sourceIter;
- break;
- }
- }
- pthread_mutex_unlock(&mSourcesMutex);
- if (sourceIter == mSources.end())
- return (E_NON_EXISTENT); //not found!
-
- asyncSetSourceStateWorker *worker = new asyncSetSourceStateWorker(this, &mPool, mShadow, handle, sourceID, state);
- if ((work = mPool.startWork(worker)) == -1)
- {
- logError("AsyncRoutingSender::asyncSetSourceState not enough threads!");
- delete worker;
- return (E_NOT_POSSIBLE);
- }
-
- //save the handle related to the workerID
- pthread_mutex_lock(&mMapHandleWorkerMutex);
- mMapHandleWorker.insert(std::make_pair(+handle.handle, work));
- pthread_mutex_unlock(&mMapHandleWorkerMutex);
-
- return (E_OK);
-}
-
-am_Error_e CAmRoutingSenderAsync::asyncSetSinkSoundProperty(const am_Handle_s handle, const am_sinkID_t sinkID, const am_SoundProperty_s & soundProperty)
-{
- assert(mReceiveInterface!=0);
- assert(handle.handle!=0);
- assert(handle.handleType==H_SETSINKSOUNDPROPERTY);
- assert(sinkID!=0);
-
- //check if we can take the job
- am_Sink_s sink;
- int16_t work = -1;
-
- //find the sink
- pthread_mutex_lock(&mSinksMutex);
- std::vector<am_Sink_s>::iterator sinkIter = mSinks.begin();
- for (; sinkIter != mSinks.end(); ++sinkIter)
- {
- if (sinkIter->sinkID == sinkID)
- {
- sink = *sinkIter;
- break;
- }
- }
- pthread_mutex_unlock(&mSinksMutex);
- if (sinkIter == mSinks.end())
- return (E_NON_EXISTENT); //not found!
-
- asyncSetSinkSoundPropertyWorker *worker = new asyncSetSinkSoundPropertyWorker(this, &mPool, mShadow, handle, soundProperty, sinkID);
- if ((work = mPool.startWork(worker)) == -1)
- {
- logError("AsyncRoutingSender::asyncSetSinkSoundProperty not enough threads!");
- delete worker;
- return (E_NOT_POSSIBLE);
- }
-
- //save the handle related to the workerID
- pthread_mutex_lock(&mMapHandleWorkerMutex);
- mMapHandleWorker.insert(std::make_pair(+handle.handle, work));
- pthread_mutex_unlock(&mMapHandleWorkerMutex);
-
- return (E_OK);
-}
-
-am_Error_e CAmRoutingSenderAsync::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)
-{
- //todo: implement crossfader
- (void) handle;
- (void) crossfaderID;
- (void) hotSink;
- (void) rampType;
- (void) time;
- return (E_NOT_USED);
-}
-
-am_Error_e CAmRoutingSenderAsync::setDomainState(const am_domainID_t domainID, const am_DomainState_e domainState)
-{
- assert(mReceiveInterface!=0);
- assert(domainID!=0);
-
- //check if we can take the job
- am_Domain_s domain;
- int16_t work = -1;
-
- //find the sink
- pthread_mutex_lock(&mDomainsMutex);
- std::vector<am_Domain_s>::iterator domainIter = mDomains.begin();
- for (; domainIter != mDomains.end(); ++domainIter)
- {
- if (domainIter->domainID == domainID)
- {
- domain = *domainIter;
- break;
- }
- }
- pthread_mutex_unlock(&mDomainsMutex);
- if (domainIter == mDomains.end())
- return (E_NON_EXISTENT); //not found!
-
- asyncDomainStateChangeWorker *worker = new asyncDomainStateChangeWorker(this, &mPool, mShadow, domainID, domainState);
- if ((work = mPool.startWork(worker)) == -1)
- {
- logError("AsyncRoutingSender::setDomainState not enough threads!");
- delete worker;
- return (E_NOT_POSSIBLE);
- }
-
- return (E_OK);
-
-}
-
-am_Error_e CAmRoutingSenderAsync::asyncSetSourceSoundProperty(const am_Handle_s handle, const am_sourceID_t sourceID, const am_SoundProperty_s & soundProperty)
-{
- assert(mReceiveInterface!=0);
- assert(handle.handle!=0);
- assert(handle.handleType==H_SETSOURCESOUNDPROPERTY);
- assert(sourceID!=0);
-
- //check if we can take the job
- am_Source_s source;
- int16_t work = -1;
-
- //find the source
- pthread_mutex_lock(&mSourcesMutex);
- std::vector<am_Source_s>::iterator sourceIter = mSources.begin();
- for (; sourceIter != mSources.end(); ++sourceIter)
- {
- if (sourceIter->sourceID == sourceID)
- {
- source = *sourceIter;
- break;
- }
- }
- pthread_mutex_unlock(&mSourcesMutex);
- if (sourceIter == mSources.end())
- return (E_NON_EXISTENT); //not found!
-
- asyncSetSourceSoundPropertyWorker *worker = new asyncSetSourceSoundPropertyWorker(this, &mPool, mShadow, handle, soundProperty, sourceID);
- if ((work = mPool.startWork(worker)) == -1)
- {
- logError("AsyncRoutingSender::asyncSetSourceState not enough threads!");
- delete worker;
- return (E_NOT_POSSIBLE);
- }
-
- //save the handle related to the workerID
- pthread_mutex_lock(&mMapHandleWorkerMutex);
- mMapHandleWorker.insert(std::make_pair(+handle.handle, work));
- pthread_mutex_unlock(&mMapHandleWorkerMutex);
-
- return (E_OK);
-}
-
-am_Error_e CAmRoutingSenderAsync::returnBusName(std::string & BusName) const
-{
- BusName = "RoutingAsync";
- return (E_OK);
-}
-
-std::vector<am_Domain_s> CAmRoutingSenderAsync::createDomainTable()
-{
- //just write two domains into the table and return it
- std::vector<am_Domain_s> table;
- am_Domain_s item;
- item.busname = "RoutingAsync";
- item.domainID = 0;
- item.early = false;
- item.name = "AsyncDomain1";
- item.nodename = "AsyncNode1";
- item.state = DS_CONTROLLED;
- table.push_back(item);
- item.busname = "RoutingAsync";
- item.domainID = 0;
- item.early = false;
- item.name = "AsyncDomain2";
- item.nodename = "AsyncNode2";
- item.state = DS_CONTROLLED;
- table.push_back(item);
- return (table);
-}
-
-std::vector<am_Sink_s> CAmRoutingSenderAsync::createSinkTable()
-{
- //create a bunch full of sinks
- std::vector<am_Sink_s> table;
- am_Sink_s item;
- am_SoundProperty_s sp;
- sp.type = SP_GENIVI_BASS;
- sp.value = 0;
-
- std::vector<am_MainSoundProperty_s> listMainSoundProperties;
- am_MainSoundProperty_s msp;
- msp.type = MSP_GENIVI_BASS;
- msp.value = 5;
- listMainSoundProperties.push_back(msp);
- msp.type = MSP_GENIVI_MID;
- listMainSoundProperties.push_back(msp);
- msp.type = MSP_GENIVI_TREBLE;
- listMainSoundProperties.push_back(msp);
- for (int16_t i = 0; i <= 10; i++)
- {
- std::stringstream temp;
- temp << i;
- item.domainID = 0; //we cannot know this when the table is created !
- item.name = "mySink" + temp.str();
- item.sinkID = i; //take fixed ids to make thins easy
- item.sinkClassID = 1;
- item.volume = 0;
- item.available.availability = A_AVAILABLE;
- item.available.availabilityReason = AR_UNKNOWN;
- item.listSoundProperties.push_back(sp);
- item.listMainSoundProperties = listMainSoundProperties;
- item.visible = true;
- item.listConnectionFormats.push_back(CF_GENIVI_ANALOG);
- item.muteState = MS_MUTED;
- item.mainVolume = 0;
- table.push_back(item);
- }
- return (table);
-}
-
-std::vector<am_Source_s> CAmRoutingSenderAsync::createSourceTable()
-{
- //create a bunch full of sources
- std::vector<am_Source_s> table;
- am_Source_s item;
- item.listConnectionFormats.push_back(CF_GENIVI_ANALOG);
- item.sourceClassID = 1;
- item.volume = 0;
- item.visible = true;
- item.available.availability = A_AVAILABLE;
- item.available.availabilityReason = AR_UNKNOWN;
- item.sourceState = SS_OFF;
- item.interruptState = am_InterruptState_e::IS_OFF;
- item.domainID = 0; //we cannot know this when the table is created !
- for (int16_t i = 0; i <= 10; i++)
- {
- std::stringstream temp;
- temp << i;
- item.name = "mySource" + temp.str();
- item.sourceID = i; //take fixed ids to make thins easy
- table.push_back(item);
- }
- return (table);
-}
-
-void CAmRoutingSenderAsync::insertConnectionSafe(am_connectionID_t connectionID, am_RoutingElement_s route)
-{
- pthread_mutex_lock(&mMapConnectionMutex);
- mMapConnectionIDRoute.insert(std::make_pair(connectionID, route));
- pthread_mutex_unlock(&mMapConnectionMutex);
-}
-
-void CAmRoutingSenderAsync::removeHandleSafe(uint16_t handle)
-{
- pthread_mutex_lock(&mMapHandleWorkerMutex);
- if (!mMapHandleWorker.erase(handle))
- {
- logError("AsyncRoutingSender::removeHandle could not remove handle");
- }
- pthread_mutex_unlock(&mMapHandleWorkerMutex);
-}
-
-void CAmRoutingSenderAsync::removeConnectionSafe(am_connectionID_t connectionID)
-{
- pthread_mutex_lock(&mMapConnectionMutex);
- if (!mMapConnectionIDRoute.erase(connectionID))
- {
- logError("AsyncRoutingSender::removeConnectionSafe could not remove connection");
- }
- pthread_mutex_unlock(&mMapConnectionMutex);
-}
-
-void CAmRoutingSenderAsync::updateSinkVolumeSafe(am_sinkID_t sinkID, am_volume_t volume)
-{
- pthread_mutex_lock(&mSinksMutex);
- std::vector<am_Sink_s>::iterator sinkIter = mSinks.begin();
- for (; sinkIter != mSinks.end(); ++sinkIter)
- {
- if (sinkIter->sinkID == sinkID)
- {
- sinkIter->volume = volume;
- break;
- }
- }
- pthread_mutex_unlock(&mSinksMutex);
-}
-
-void am::CAmRoutingSenderAsync::updateSourceVolumeSafe(am_sourceID_t sourceID, am_volume_t volume)
-{
- pthread_mutex_lock(&mSourcesMutex);
- std::vector<am_Source_s>::iterator sourceIter = mSources.begin();
- for (; sourceIter != mSources.end(); ++sourceIter)
- {
- if (sourceIter->sourceID == sourceID)
- {
- sourceIter->volume = volume;
- break;
- }
- }
- pthread_mutex_unlock(&mSourcesMutex);
-}
-
-void am::CAmRoutingSenderAsync::updateSourceStateSafe(am_sourceID_t sourceID, am_SourceState_e state)
-{
- pthread_mutex_lock(&mSourcesMutex);
- std::vector<am_Source_s>::iterator sourceIter = mSources.begin();
- for (; sourceIter != mSources.end(); ++sourceIter)
- {
- if (sourceIter->sourceID == sourceID)
- {
- sourceIter->sourceState = state;
- break;
- }
- }
- pthread_mutex_unlock(&mSourcesMutex);
-}
-
-void am::CAmRoutingSenderAsync::updateSinkSoundPropertySafe(am_sinkID_t sinkID, am_SoundProperty_s soundProperty)
-{
- pthread_mutex_lock(&mSinksMutex);
- std::vector<am_Sink_s>::iterator sinkIter = mSinks.begin();
- for (; sinkIter != mSinks.end(); ++sinkIter)
- {
- if (sinkIter->sinkID == sinkID)
- {
- std::vector<am_SoundProperty_s>::iterator spIterator = sinkIter->listSoundProperties.begin();
- for (; spIterator != sinkIter->listSoundProperties.end(); ++spIterator)
- {
- if (spIterator->type == soundProperty.type)
- {
- spIterator->value = soundProperty.value;
- break;
- }
- }
- }
- }
- pthread_mutex_unlock(&mSinksMutex);
-}
-
-void am::CAmRoutingSenderAsync::updateSourceSoundPropertySafe(am_sourceID_t sourceID, am_SoundProperty_s soundProperty)
-{
- pthread_mutex_lock(&mSourcesMutex);
- std::vector<am_Source_s>::iterator sourceIter = mSources.begin();
- for (; sourceIter != mSources.end(); ++sourceIter)
- {
- if (sourceIter->sourceID == sourceID)
- {
- std::vector<am_SoundProperty_s>::iterator spIterator = sourceIter->listSoundProperties.begin();
- for (; spIterator != sourceIter->listSoundProperties.end(); ++spIterator)
- {
- if (spIterator->type == soundProperty.type)
- {
- spIterator->value = soundProperty.value;
- break;
- }
- }
- }
- }
- pthread_mutex_unlock(&mSourcesMutex);
-}
-
-void am::CAmRoutingSenderAsync::updateDomainstateSafe(am_domainID_t domainID, am_DomainState_e domainState)
-{
- pthread_mutex_lock(&mDomainsMutex);
- std::vector<am_Domain_s>::iterator domainIter = mDomains.begin();
- for (; domainIter != mDomains.end(); ++domainIter)
- {
- if (domainIter->domainID == domainID)
- {
- domainIter->state = domainState;
- break;
- }
- }
- pthread_mutex_unlock(&mDomainsMutex);
-}
-
-void am::CAmRoutingSenderAsync::updateDomainListSafe(std::vector<am_Domain_s> listDomains)
-{
- pthread_mutex_lock(&mDomainsMutex);
- mDomains = listDomains;
- pthread_mutex_unlock(&mDomainsMutex);
-}
-
-void am::CAmRoutingSenderAsync::updateSourceListSafe(std::vector<am_Source_s> listSource)
-{
- pthread_mutex_lock(&mSourcesMutex);
- mSources = listSource;
- pthread_mutex_unlock(&mSourcesMutex);
-}
-
-void am::CAmRoutingSenderAsync::updateSinkListSafe(std::vector<am_Sink_s> listSinks)
-{
- pthread_mutex_lock(&mSinksMutex);
- mSinks = listSinks;
- pthread_mutex_unlock(&mSinksMutex);
-}
-
-void CAmRoutingSenderAsync::getInterfaceVersion(std::string & version) const
-{
- version = RoutingSendVersion;
-}
-
-am_Error_e CAmRoutingSenderAsync::asyncSetSourceSoundProperties(const am_Handle_s handle, const am_sourceID_t sourceID, const std::vector<am_SoundProperty_s> & listSoundProperties)
-{
- //todo: implement
- (void) handle;
- (void) sourceID;
- (void) listSoundProperties;
- return (E_NOT_USED);
-}
-
-am_Error_e CAmRoutingSenderAsync::asyncSetSinkSoundProperties(const am_Handle_s handle, const am_sinkID_t sinkID, const std::vector<am_SoundProperty_s> & listSoundProperties)
-{
- //todo: implement
- (void) handle;
- (void) sinkID;
- (void) listSoundProperties;
- return (E_NOT_USED);
-}
-
-am_Error_e am::CAmRoutingSenderAsync::asyncSetVolumes(const am_Handle_s handle, const std::vector<am_Volumes_s>& listVolumes)
-{
- (void)handle;
- (void)listVolumes;
- //todo: implement
- return (E_NOT_USED);
-}
-
-am_Error_e am::CAmRoutingSenderAsync::asyncSetSinkNotificationConfiguration(const am_Handle_s handle, const am_sinkID_t sinkID, const am_NotificationConfiguration_s& notificationConfiguration)
-{
- (void)handle;
- (void)sinkID;
- (void)notificationConfiguration;
- //todo: implement
- return (E_NOT_USED);
-}
-
-am_Error_e am::CAmRoutingSenderAsync::asyncSetSourceNotificationConfiguration(const am_Handle_s handle, const am_sourceID_t sourceID, const am_NotificationConfiguration_s& notificationConfiguration)
-{
- (void)handle;
- (void)sourceID;
- (void)notificationConfiguration;
- //todo: implement
- return (E_NOT_USED);
-}
-
-std::vector<am_Gateway_s> CAmRoutingSenderAsync::createGatewayTable()
-{
- std::vector<am_Gateway_s> table;
- am_Gateway_s item;
- item.name = "myGateway";
- item.sinkID = 2;
- item.sourceID = 2;
- table.push_back(item);
- return (table);
-}
-
-asycConnectWorker::asycConnectWorker(CAmRoutingSenderAsync * asyncSender, CAmWorkerThreadPool *pool, IAmRoutingReceiverShadow* shadow, const am_Handle_s handle, const am_connectionID_t connectionID, const am_sourceID_t sourceID, const am_sinkID_t sinkID, const am_CustomConnectionFormat_t connectionFormat) :
- CAmWorker(pool), //
- mAsyncSender(asyncSender), //
- mShadow(shadow), //
- mHandle(handle), //
- mConnectionID(connectionID), //
- mSourceID(sourceID), //
- mSinkID(sinkID), //
- mConnectionFormat(connectionFormat)
-{
-}
-
-void asycConnectWorker::start2work()
-{
- logInfo("Start connecting");
- timespec t;
- t.tv_nsec = 0;
- t.tv_sec = 1;
-
- //do something for one second
- if (timedWait(t))
- return;
- am_RoutingElement_s route;
- route.sinkID = mSinkID;
- route.sourceID = mSourceID;
- route.connectionFormat = mConnectionFormat;
-
- //enter new connectionID into the list
- mAsyncSender->insertConnectionSafe(mConnectionID, route);
-
- //send the ack
- mShadow->ackConnect(mHandle, mConnectionID, E_OK);
-
- //destroy the handle
- mAsyncSender->removeHandleSafe(mHandle.handle);
-}
-
-void asycConnectWorker::cancelWork()
-{
- mAsyncSender->removeHandleSafe(mHandle.handle);
- mShadow->ackConnect(mHandle, mConnectionID, E_ABORTED);
-}
-
-asycDisConnectWorker::asycDisConnectWorker(CAmRoutingSenderAsync *asyncSender, CAmWorkerThreadPool *pool, IAmRoutingReceiverShadow *shadow, const am_Handle_s handle, const am_connectionID_t connectionID) :
- CAmWorker(pool), //
- mAsyncSender(asyncSender), //
- mShadow(shadow), //
- mHandle(handle), //
- mConnectionID(connectionID), //
- mConnectionFormat(CF_UNKNOWN)
-{
-}
-
-void asycDisConnectWorker::start2work()
-{
- logInfo("Start disconnecting");
- timespec t;
- t.tv_nsec = 0;
- t.tv_sec = 1;
-
- //do something for one second
- if (timedWait(t))
- return;
- am_RoutingElement_s route;
-
- //enter new connectionID into the list
- mAsyncSender->insertConnectionSafe(mConnectionID, route);
-
- //send the ack
- mShadow->ackDisconnect(mHandle, mConnectionID, E_OK);
-
- //destroy the handle
- mAsyncSender->removeHandleSafe(mHandle.handle);
-
-}
-
-void asycDisConnectWorker::cancelWork()
-{
- mAsyncSender->removeHandleSafe(mHandle.handle);
- mShadow->ackDisconnect(mHandle, mConnectionID, E_ABORTED);
-}
-
-asyncSetSinkVolumeWorker::asyncSetSinkVolumeWorker(CAmRoutingSenderAsync *asyncSender, CAmWorkerThreadPool *pool, IAmRoutingReceiverShadow *shadow, const am_volume_t currentVolume, 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) :
- CAmWorker(pool), //
- mAsyncSender(asyncSender), //
- mShadow(shadow), //
- mCurrentVolume(currentVolume), //
- mHandle(handle), //
- mSinkID(sinkID), //
- mVolume(volume), //
- mRamp(ramp), //
- mTime(time)
-{
-}
-
-void asyncSetSinkVolumeWorker::start2work()
-{
- //todo: this implementation does not respect time and ramp....
- logInfo("Start setting sink volume");
- timespec t;
- t.tv_nsec = 10000000;
- t.tv_sec = 0;
-
- while (mCurrentVolume != mVolume)
- {
- if (mCurrentVolume < mVolume)
- mCurrentVolume++;
- else
- mCurrentVolume--;
- mShadow->ackSinkVolumeTick(mHandle, mSinkID, mCurrentVolume);
- if (timedWait(t))
- return;
- }
-
- //enter new connectionID into the list
- mAsyncSender->updateSinkVolumeSafe(mSinkID, mCurrentVolume);
-
- //send the ack
- mShadow->ackSetSinkVolumeChange(mHandle, mCurrentVolume, E_OK);
-
- //destroy the handle
- mAsyncSender->removeHandleSafe(mHandle.handle);
-}
-
-void asyncSetSinkVolumeWorker::cancelWork()
-{
- mAsyncSender->updateSinkVolumeSafe(mSinkID, mCurrentVolume);
- mAsyncSender->removeHandleSafe(mHandle.handle);
- mShadow->ackSetSinkVolumeChange(mHandle, mCurrentVolume, E_ABORTED);
-}
-
-asyncSetSourceVolumeWorker::asyncSetSourceVolumeWorker(CAmRoutingSenderAsync *asyncSender, CAmWorkerThreadPool *pool, IAmRoutingReceiverShadow *shadow, const am_volume_t currentVolume, 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) :
- CAmWorker(pool), //
- mAsyncSender(asyncSender), //
- mShadow(shadow), //
- mCurrentVolume(currentVolume), //
- mHandle(handle), //
- mSourceID(SourceID), //
- mVolume(volume), //
- mRamp(ramp), //
- mTime(time)
-{
-}
-
-void asyncSetSourceVolumeWorker::start2work()
-{
- //todo: this implementation does not respect time and ramp....
- logInfo("Start setting source volume");
- timespec t;
- t.tv_nsec = 10000000;
- t.tv_sec = 0;
-
- while (mCurrentVolume != mVolume)
- {
- if (mCurrentVolume < mVolume)
- mCurrentVolume++;
- else
- mCurrentVolume--;
- mShadow->ackSourceVolumeTick(mHandle, mSourceID, mCurrentVolume);
- if (timedWait(t))
- return;
- }
-
- //enter new connectionID into the list
- mAsyncSender->updateSourceVolumeSafe(mSourceID, mCurrentVolume);
-
- //send the ack
- mShadow->ackSetSourceVolumeChange(mHandle, mCurrentVolume, E_OK);
-
- //destroy the handle
- mAsyncSender->removeHandleSafe(mHandle.handle);
-}
-
-void asyncSetSourceVolumeWorker::cancelWork()
-{
- mAsyncSender->updateSourceVolumeSafe(mSourceID, mCurrentVolume);
- mAsyncSender->removeHandleSafe(mHandle.handle);
- mShadow->ackSetSourceVolumeChange(mHandle, mCurrentVolume, E_ABORTED);
-}
-
-asyncSetSourceStateWorker::asyncSetSourceStateWorker(CAmRoutingSenderAsync *asyncSender, CAmWorkerThreadPool *pool, IAmRoutingReceiverShadow *shadow, const am_Handle_s handle, const am_sourceID_t sourceID, const am_SourceState_e state) :
- CAmWorker(pool), //
- mAsyncSender(asyncSender), //
- mShadow(shadow), //
- mHandle(handle), //
- mSourceID(sourceID), //
- mSourcestate(state)
-{
-}
-
-void asyncSetSourceStateWorker::start2work()
-{
- logInfo("Start setting source state");
- timespec t;
- t.tv_nsec = 0;
- t.tv_sec = 1;
-
- //do something for one second
- if (timedWait(t))
- return;
-
- //enter new connectionID into the list
- mAsyncSender->updateSourceStateSafe(mSourceID, mSourcestate);
-
- //send the ack
- mShadow->ackSetSourceState(mHandle, E_OK);
-
- //destroy the handle
- mAsyncSender->removeHandleSafe(mHandle.handle);
-}
-
-void asyncSetSourceStateWorker::cancelWork()
-{
- //send the ack
- mShadow->ackSetSourceState(mHandle, E_ABORTED);
-
- //destroy the handle
- mAsyncSender->removeHandleSafe(mHandle.handle);
-}
-
-asyncSetSinkSoundPropertyWorker::asyncSetSinkSoundPropertyWorker(CAmRoutingSenderAsync *asyncSender, CAmWorkerThreadPool *pool, IAmRoutingReceiverShadow *shadow, const am_Handle_s handle, const am_SoundProperty_s soundProperty, const am_sinkID_t sinkID) :
- CAmWorker(pool), //
- mAsyncSender(asyncSender), //
- mShadow(shadow), //
- mHandle(handle), //
- mSinkID(sinkID), //
- mSoundProperty(soundProperty)
-{
-}
-
-void asyncSetSinkSoundPropertyWorker::start2work()
-{
- logInfo("Start setting sink sound property");
- timespec t;
- t.tv_nsec = 0;
- t.tv_sec = 1;
-
- //do something for one second
- if (timedWait(t))
- return;
-
- //enter new connectionID into the list
- mAsyncSender->updateSinkSoundPropertySafe(mSinkID, mSoundProperty);
-
- //send the ack
- mShadow->ackSetSinkSoundProperty(mHandle, E_OK);
-
- //destroy the handle
- mAsyncSender->removeHandleSafe(mHandle.handle);
-}
-
-void asyncSetSinkSoundPropertyWorker::cancelWork()
-{
- //send the ack
- mShadow->ackSetSinkSoundProperty(mHandle, E_OK);
-
- //destroy the handle
- mAsyncSender->removeHandleSafe(mHandle.handle);
-}
-
-asyncSetSourceSoundPropertyWorker::asyncSetSourceSoundPropertyWorker(CAmRoutingSenderAsync *asyncSender, CAmWorkerThreadPool *pool, IAmRoutingReceiverShadow *shadow, const am_Handle_s handle, const am_SoundProperty_s soundProperty, const am_sourceID_t sourceID) :
- CAmWorker(pool), //
- mAsyncSender(asyncSender), //
- mShadow(shadow), //
- mHandle(handle), //
- mSourceID(sourceID), //
- mSoundProperty(soundProperty)
-{
-}
-
-void asyncSetSourceSoundPropertyWorker::start2work()
-{
- logInfo("Start setting source sound property");
- timespec t;
- t.tv_nsec = 0;
- t.tv_sec = 1;
-
- //do something for one second
- if (timedWait(t))
- return;
-
- //enter new connectionID into the list
- mAsyncSender->updateSourceSoundPropertySafe(mSourceID, mSoundProperty);
-
- //send the ack
- mShadow->ackSetSourceSoundProperty(mHandle, E_OK);
-
- //destroy the handle
- mAsyncSender->removeHandleSafe(mHandle.handle);
-}
-
-void asyncSetSourceSoundPropertyWorker::cancelWork()
-{
- //send the ack
- mShadow->ackSetSourceSoundProperty(mHandle, E_OK);
-
- //destroy the handle
- mAsyncSender->removeHandleSafe(mHandle.handle);
-}
-
-asyncDomainStateChangeWorker::asyncDomainStateChangeWorker(CAmRoutingSenderAsync *asyncSender, CAmWorkerThreadPool *pool, IAmRoutingReceiverShadow *shadow, const am_domainID_t domainID, const am_DomainState_e domainState) :
- CAmWorker(pool), //
- mAsyncSender(asyncSender), //
- mShadow(shadow), //
- mDomainID(domainID), //
- mDomainState(domainState)
-{
-}
-
-void asyncDomainStateChangeWorker::start2work()
-{
- //todo: sendchanged data must be in here !
- logInfo("Start setting source sound property");
- timespec t;
- t.tv_nsec = 0;
- t.tv_sec = 1;
-
- //do something for one second
- if (timedWait(t))
- return;
-
- //enter new connectionID into the list
- mAsyncSender->updateDomainstateSafe(mDomainID, mDomainState);
- mShadow->hookDomainStateChange(mDomainID, mDomainState);
- //send the new status
-
-}
-
-void am::asyncDomainStateChangeWorker::cancelWork()
-{
- //send the new status
- mShadow->hookDomainStateChange(mDomainID, mDomainState);
-}
-
-syncRegisterWorker::syncRegisterWorker(CAmRoutingSenderAsync * asyncSender, CAmWorkerThreadPool* pool, IAmRoutingReceiverShadow* shadow, const std::vector<am_Domain_s> domains, const std::vector<am_Sink_s> sinks, const std::vector<am_Source_s> sources, const uint16_t handle) :
- CAmWorker(pool), //
- mAsyncSender(asyncSender), //
- mShadow(shadow), //
- mListDomains(domains), //
- mListSinks(sinks), //
- mListSources(sources), mHandle(handle)
-{
-}
-
-void syncRegisterWorker::start2work()
-{
- //todo: sendchanged data must be in here !
- logInfo("Start to register stuff");
-
- am_Error_e eCode;
-
- std::vector<am_Domain_s>::iterator domainIter = mListDomains.begin();
- for (; domainIter != mListDomains.end(); ++domainIter)
- {
- am_domainID_t domainID;
- if ((eCode = mShadow->registerDomain(*domainIter, domainID)) != E_OK)
- {
- logError("syncRegisterWorker::start2work error on registering domain, failed with", eCode);
- }
- domainIter->domainID = domainID;
- }
-
- mAsyncSender->updateDomainListSafe(mListDomains);
-
- //then sources
- std::vector<am_Source_s>::iterator sourceIter = mListSources.begin();
- for (; sourceIter != mListSources.end(); ++sourceIter)
- {
- am_sourceID_t sourceID;
- //set the correct domainID
- sourceIter->domainID = mListDomains[0].domainID;
- if ((eCode = mShadow->registerSource(*sourceIter, sourceID)) != E_OK)
- {
- logError("syncRegisterWorker::start2work error on registering source, failed with", eCode);
- }
- }
-
- mAsyncSender->updateSourceListSafe(mListSources);
-
- //sinks
- std::vector<am_Sink_s>::iterator sinkIter = mListSinks.begin();
- for (; sinkIter != mListSinks.end(); ++sinkIter)
- {
- am_sinkID_t sinkID;
- //set the correct domainID
- sinkIter->domainID = mListDomains[0].domainID;
- if ((eCode = mShadow->registerSink(*sinkIter, sinkID)) != E_OK)
- {
- logError("syncRegisterWorker::start2work error on registering sink, failed with", eCode);
- }
- }
-
- mAsyncSender->updateSinkListSafe(mListSinks);
- mShadow->confirmRoutingReady(mHandle,E_OK);
-}
-
-void syncRegisterWorker::cancelWork()
-{
-}
-
diff --git a/PluginRoutingInterfaceAsync/src/IAmRoutingReceiverShadow.cpp b/PluginRoutingInterfaceAsync/src/IAmRoutingReceiverShadow.cpp
deleted file mode 100644
index 71b0cc5..0000000
--- a/PluginRoutingInterfaceAsync/src/IAmRoutingReceiverShadow.cpp
+++ /dev/null
@@ -1,189 +0,0 @@
-/**
- * Copyright (c) 2012 BMW
- *
- * \author Christian Mueller, christian.ei.mueller@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 <cassert>
-#include <sys/socket.h>
-#include <sys/ioctl.h>
-#include <string.h>
-#include <netdb.h>
-#include <fcntl.h>
-#include <sys/un.h>
-#include <errno.h>
-#include <string>
-#include "shared/CAmDltWrapper.h"
-#include "shared/CAmSerializer.h"
-
-using namespace am;
-
-IAmRoutingReceiverShadow::IAmRoutingReceiverShadow(IAmRoutingReceive* iReceiveInterface, CAmSocketHandler* iSocketHandler) :
- mSocketHandler(iSocketHandler), //
- mRoutingReceiveInterface(iReceiveInterface), //
- mSerializer(iSocketHandler)
-{
-
-}
-
-IAmRoutingReceiverShadow::~IAmRoutingReceiverShadow()
-{
-}
-
-void IAmRoutingReceiverShadow::ackConnect(const am_Handle_s handle, const am_connectionID_t connectionID, const am_Error_e error)
-{
- mSerializer.asyncCall<IAmRoutingReceive, const am_Handle_s, const am_connectionID_t, const am_Error_e>(mRoutingReceiveInterface, &IAmRoutingReceive::ackConnect, handle, connectionID, error);
-}
-
-void IAmRoutingReceiverShadow::ackDisconnect(const am_Handle_s handle, const am_connectionID_t connectionID, const am_Error_e error)
-{
- mSerializer.asyncCall<IAmRoutingReceive, const am_Handle_s, const am_connectionID_t, const am_Error_e>(mRoutingReceiveInterface, &IAmRoutingReceive::ackDisconnect, handle, connectionID, error);
-}
-
-void IAmRoutingReceiverShadow::ackSetSinkVolumeChange(const am_Handle_s handle, const am_volume_t volume, const am_Error_e error)
-{
- mSerializer.asyncCall<IAmRoutingReceive, const am_Handle_s, const am_volume_t, const am_Error_e>(mRoutingReceiveInterface, &IAmRoutingReceive::ackSetSinkVolumeChange, handle, volume, error);
-}
-
-void IAmRoutingReceiverShadow::ackSetSourceVolumeChange(const am_Handle_s handle, const am_volume_t volume, const am_Error_e error)
-{
- mSerializer.asyncCall<IAmRoutingReceive, const am_Handle_s, const am_volume_t, const am_Error_e>(mRoutingReceiveInterface, &IAmRoutingReceive::ackSetSourceVolumeChange, handle, volume, error);
-}
-
-void IAmRoutingReceiverShadow::ackSetSourceState(const am_Handle_s handle, const am_Error_e error)
-{
- mSerializer.asyncCall<IAmRoutingReceive, const am_Handle_s, const am_Error_e>(mRoutingReceiveInterface, &IAmRoutingReceive::ackSetSourceState, handle, error);
-}
-
-void IAmRoutingReceiverShadow::ackSetSinkSoundProperty(const am_Handle_s handle, const am_Error_e error)
-{
- mSerializer.asyncCall<IAmRoutingReceive, const am_Handle_s, const am_Error_e>(mRoutingReceiveInterface, &IAmRoutingReceive::ackSetSinkSoundProperty, handle, error);
-}
-
-void IAmRoutingReceiverShadow::ackSetSourceSoundProperty(const am_Handle_s handle, const am_Error_e error)
-{
- mSerializer.asyncCall<IAmRoutingReceive, const am_Handle_s, const am_Error_e>(mRoutingReceiveInterface, &IAmRoutingReceive::ackSetSourceSoundProperty, handle, error);
-}
-
-void IAmRoutingReceiverShadow::ackCrossFading(const am_Handle_s handle, const am_HotSink_e hotSink, const am_Error_e error)
-{
- mSerializer.asyncCall<IAmRoutingReceive, const am_Handle_s, const am_HotSink_e, const am_Error_e>(mRoutingReceiveInterface, &IAmRoutingReceive::ackCrossFading, handle, hotSink, error);
-}
-
-void IAmRoutingReceiverShadow::ackSourceVolumeTick(const am_Handle_s handle, const am_sourceID_t sourceID, const am_volume_t volume)
-{
- mSerializer.asyncCall<IAmRoutingReceive, const am_Handle_s, const am_sourceID_t, const am_volume_t>(mRoutingReceiveInterface, &IAmRoutingReceive::ackSourceVolumeTick, handle, sourceID, volume);
-}
-
-void IAmRoutingReceiverShadow::ackSinkVolumeTick(const am_Handle_s handle, const am_sinkID_t sinkID, const am_volume_t volume)
-{
- mSerializer.asyncCall<IAmRoutingReceive, const am_Handle_s, const am_sinkID_t, const am_volume_t>(mRoutingReceiveInterface, &IAmRoutingReceive::ackSinkVolumeTick, handle, sinkID, volume);
-}
-
-void IAmRoutingReceiverShadow::hookInterruptStatusChange(const am_sourceID_t sourceID, const am_InterruptState_e interruptState)
-{
- mSerializer.asyncCall<IAmRoutingReceive, const am_sinkID_t, const am_InterruptState_e>(mRoutingReceiveInterface, &IAmRoutingReceive::hookInterruptStatusChange, sourceID, interruptState);
-}
-
-void IAmRoutingReceiverShadow::hookSinkAvailablityStatusChange(const am_sinkID_t sinkID, const am_Availability_s & availability)
-{
- mSerializer.asyncCall<IAmRoutingReceive, const am_sinkID_t, const am_Availability_s>(mRoutingReceiveInterface, &IAmRoutingReceive::hookSinkAvailablityStatusChange, sinkID, availability);
-}
-
-void IAmRoutingReceiverShadow::hookSourceAvailablityStatusChange(const am_sourceID_t sourceID, const am_Availability_s & availability)
-{
- mSerializer.asyncCall<IAmRoutingReceive, const am_sourceID_t, const am_Availability_s>(mRoutingReceiveInterface, &IAmRoutingReceive::hookSourceAvailablityStatusChange, sourceID, availability);
-}
-
-void IAmRoutingReceiverShadow::hookDomainStateChange(const am_domainID_t domainID, const am_DomainState_e domainState)
-{
- mSerializer.asyncCall<IAmRoutingReceive, const am_domainID_t, const am_DomainState_e>(mRoutingReceiveInterface, &IAmRoutingReceive::hookDomainStateChange, domainID, domainState);
-}
-
-void IAmRoutingReceiverShadow::hookTimingInformationChanged(const am_connectionID_t connectionID, const am_timeSync_t delay)
-{
- mSerializer.asyncCall<IAmRoutingReceive, const am_connectionID_t, const am_timeSync_t>(mRoutingReceiveInterface, &IAmRoutingReceive::hookTimingInformationChanged, connectionID, delay);
-}
-
-am_Error_e IAmRoutingReceiverShadow::registerDomain(const am_Domain_s & domainData, am_domainID_t & domainID)
-{
- am_Error_e error (E_UNKNOWN);
- am_Domain_s domainDataCopy(domainData);
- mSerializer.syncCall<IAmRoutingReceive, am_Error_e, const am_Domain_s&,am_domainID_t&, am_Domain_s, am_domainID_t>(mRoutingReceiveInterface, &IAmRoutingReceive::registerDomain, error, domainDataCopy, domainID);
- return (error);
-}
-
-am_Error_e am::IAmRoutingReceiverShadow::registerGateway(const am_Gateway_s & gatewayData, am_gatewayID_t & gatewayID)
-{
- am_Error_e error (E_UNKNOWN);
- am_Gateway_s gatewayDataCopy(gatewayData);
- mSerializer.syncCall<IAmRoutingReceive, am_Error_e, const am_Gateway_s&, am_gatewayID_t&, am_Gateway_s, am_gatewayID_t>(mRoutingReceiveInterface,&IAmRoutingReceive::registerGateway, error, gatewayDataCopy, gatewayID);
- return (error);
-}
-
-am_Error_e am::IAmRoutingReceiverShadow::registerSink(const am_Sink_s & sinkData, am_sinkID_t & sinkID)
-{
- am_Error_e error (E_UNKNOWN);
- am_Sink_s sinkDataCopy(sinkData);
- mSerializer.syncCall<IAmRoutingReceive, am_Error_e, const am_Sink_s&, am_sinkID_t&, am_Sink_s, am_sinkID_t>(mRoutingReceiveInterface,&IAmRoutingReceive::registerSink, error, sinkDataCopy, sinkID);
- return (error);
-}
-
-am_Error_e am::IAmRoutingReceiverShadow::deregisterSink(const am_sinkID_t sinkID)
-{
- am_Error_e error;
- am_sinkID_t s(sinkID); //no const values allowed in syncCalls due to reference !
- mSerializer.syncCall<IAmRoutingReceive, am_Error_e, am_sinkID_t>(mRoutingReceiveInterface, &IAmRoutingReceive::deregisterSink, error, s);
- return (error);
-}
-
-am_Error_e am::IAmRoutingReceiverShadow::registerSource(const am_Source_s & sourceData, am_sourceID_t & sourceID)
-{
- am_Error_e error (E_UNKNOWN);
- am_Source_s sourceDataCopy(sourceData);
- mSerializer.syncCall<IAmRoutingReceive, am_Error_e, const am_Source_s&, am_sourceID_t&, am_Source_s, am_sourceID_t>(mRoutingReceiveInterface,&IAmRoutingReceive::registerSource, error, sourceDataCopy, sourceID);
- return (error);
-}
-
-am_Error_e am::IAmRoutingReceiverShadow::deregisterSource(const am_sourceID_t sourceID)
-{
- am_Error_e error;
- am_sourceID_t s(sourceID); //no const values allowed in syncCalls due to reference !
- mSerializer.syncCall<IAmRoutingReceive, am_Error_e, am_sinkID_t>(mRoutingReceiveInterface, &IAmRoutingReceive::deregisterSource, error, s);
- return (error);
-}
-
-am_Error_e am::IAmRoutingReceiverShadow::registerCrossfader(const am_Crossfader_s & crossfaderData, am_crossfaderID_t & crossfaderID)
-{
- am_Error_e error (E_UNKNOWN);
- am_Crossfader_s crossfaderDataCopy(crossfaderData);
- mSerializer.syncCall<IAmRoutingReceive, am_Error_e, const am_Crossfader_s&, am_crossfaderID_t&, am_Crossfader_s, am_crossfaderID_t>(mRoutingReceiveInterface,&IAmRoutingReceive::registerCrossfader, error, crossfaderDataCopy, crossfaderID);
- return (error);
-}
-
-void am::IAmRoutingReceiverShadow::confirmRoutingReady(uint16_t starupHandle, am_Error_e error)
-{
- mSerializer.asyncCall<IAmRoutingReceive,uint16_t,am_Error_e>(mRoutingReceiveInterface,&IAmRoutingReceive::confirmRoutingReady,starupHandle,error);
-}
-
-void am::IAmRoutingReceiverShadow::confirmRoutingRundown(uint16_t rundownHandle, am_Error_e error)
-{
- mSerializer.asyncCall<IAmRoutingReceive,uint16_t,am_Error_e>(mRoutingReceiveInterface,&IAmRoutingReceive::confirmRoutingRundown,rundownHandle,error);
-}
-
-
-
-
-
diff --git a/PluginRoutingInterfaceAsync/test/CAmRoutingReceiverAsync.cpp b/PluginRoutingInterfaceAsync/test/CAmRoutingReceiverAsync.cpp
deleted file mode 100644
index 7afca5f..0000000
--- a/PluginRoutingInterfaceAsync/test/CAmRoutingReceiverAsync.cpp
+++ /dev/null
@@ -1,529 +0,0 @@
-/**
- * Copyright (c) 2012 BMW
- *
- * \author Christian Mueller, christian.ei.mueller@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 "CAmRoutingReceiverAsync.h"
-#include "config.h"
-#include "CAmRoutingReceiver.h"
-#include "TAmPluginTemplate.h"
-#include "MockIAmRoutingReceive.h"
-#include "shared/CAmDltWrapper.h"
-
-
-using namespace am;
-using namespace testing;
-
-static CAmEnvironment* env;
-
-am_domainID_t CAmEnvironment::mDomainIDCount = 0;
-
-
-CAmEnvironment::CAmEnvironment() :
- pSocketHandler(),
- pRouter(NULL),
- pReceiveInterface(NULL),
- ptimerCallback(this, &CAmEnvironment::timerCallback)
-{
- DefaultValue<am_Error_e>::Set(E_OK); // Sets the default value to be returned.
- env=this;
-}
-
-CAmEnvironment::~CAmEnvironment()
-{
-}
-
-void CAmEnvironment::SetUp()
-{
- logInfo("RoutingSendInterface Test started ");
-
- pReceiveInterface = new MockIAmRoutingReceive();
-
- std::vector<int> domainIDs;
- domainIDs.push_back(0);
- domainIDs.push_back(1);
-
- EXPECT_CALL(*env->pReceiveInterface,getSocketHandler(_)).WillOnce(DoAll(SetArgReferee<0>(&env->pSocketHandler), Return(E_OK)));
- EXPECT_CALL(*env->pReceiveInterface,registerDomain(_,_)).WillRepeatedly(Invoke(CAmEnvironment::handleDomainRegister));
- EXPECT_CALL(*env->pReceiveInterface,registerSource(_,_)).WillRepeatedly(Invoke(CAmEnvironment::handleSourceRegister));
- EXPECT_CALL(*env->pReceiveInterface,registerSink(_,_)).WillRepeatedly(Invoke(CAmEnvironment::handleSinkRegister));
- EXPECT_CALL(*env->pReceiveInterface,confirmRoutingReady(_,_)).Times(1);
-
- IAmRoutingSend* (*createFunc)();
- void* tempLibHandle = NULL;
- std::string libname("../plugins/routing/libPluginRoutingInterfaceAsync.so");
- createFunc = getCreateFunction<IAmRoutingSend*()>(libname, tempLibHandle);
- if (!createFunc)
- {
- libname = "/usr/lib/audioManager/routing/libPluginRoutingInterfaceAsync.so";
- createFunc = getCreateFunction<IAmRoutingSend*()>(libname, tempLibHandle);
-
- if(pReceiveInterface)
- delete pReceiveInterface, pReceiveInterface = NULL;
- fprintf(stderr, "RoutingSendInterface Test Entry point of RoutingPlugin not found\n");
- logError("RoutingSendInterface Test Entry point of RoutingPlugin not found");
- exit(1);
- }
-
- pRouter = createFunc();
- if (!pRouter)
- {
- if(pReceiveInterface)
- delete pReceiveInterface, pReceiveInterface = NULL;
- fprintf(stderr, "RoutingSendInterface Test RoutingPlugin initialization failed. Entry Function not callable\n");
- logError("RoutingSendInterface Test RoutingPlugin initialization failed. Entry Function not callable");
- exit(1);
- }
-
- pRouter->startupInterface(env->pReceiveInterface);
- pRouter->setRoutingReady(10);
-
- timespec t;
- t.tv_nsec = 500000000;
- t.tv_sec = 1;
-
- sh_timerHandle_t handle;
-
- //lets use a timeout so the test will finish
- env->pSocketHandler.addTimer(t, &ptimerCallback, handle, (void*) NULL);
- env->pSocketHandler.start_listenting();
-
-}
-
-void CAmEnvironment::TearDown()
-{
- if(pReceiveInterface)
- delete pReceiveInterface, pReceiveInterface = NULL;
- if(pRouter)
- delete pRouter, pRouter = NULL;
-}
-
-std::vector<std::string> CAmEnvironment::returnListPlugins()
-{
- std::vector<std::string> list;
- list.push_back(std::string(DEFAULT_PLUGIN_ROUTING_DIR));
- return (list);
-}
-
-am_Error_e CAmEnvironment::handleSourceRegister(const am_Source_s & sourceData, am_sourceID_t & sourceID)
-{
- sourceID = sourceData.sourceID;
- return (E_OK);
-}
-
-am_Error_e CAmEnvironment::handleSinkRegister(const am_Sink_s & sinkData, am_sinkID_t & sinkID)
-{
- sinkID = sinkData.sinkID;
- return (E_OK);
-}
-
-am_Error_e CAmEnvironment::handleDomainRegister(const am_Domain_s & domainData, am_domainID_t & domainID)
-{
- am_Domain_s domain = domainData;
- domainID = ++mDomainIDCount;
- domain.domainID = domainID;
- return (E_OK);
-}
-
-void CAmEnvironment::timerCallback(sh_timerHandle_t handle, void *userData)
-{
- (void) handle;
- (void) userData;
- env->pSocketHandler.restartTimer(handle);
- env->pSocketHandler.stop_listening();
-}
-
-
-CAmRoutingReceiverAsync::CAmRoutingReceiverAsync() :
- ptimerCallback(this, &CAmRoutingReceiverAsync::timerCallback)
-{
-}
-
-CAmRoutingReceiverAsync::~CAmRoutingReceiverAsync()
-{
-}
-
-void CAmRoutingReceiverAsync::timerCallback(sh_timerHandle_t handle, void *userData)
-{
- (void) handle;
- (void) userData;
- env->pSocketHandler.stop_listening();
-}
-
-void CAmRoutingReceiverAsync::SetUp()
-{
-// timespec t;
-// t.tv_nsec = 0;
-// t.tv_sec = 2;
-//
-// sh_timerHandle_t handle;
-//
-// shTimerCallBack *buf = &ptimerCallback;
-// //lets use a timeout so the test will finish
-// env->pSocketHandler.addTimer(t, buf, handle, (void*) NULL);
-}
-
-void CAmRoutingReceiverAsync::TearDown()
-{
-
-}
-
-
-TEST_F(CAmRoutingReceiverAsync,setDomainState)
-{
- am_domainID_t domainID = 1;
- am_DomainState_e state = DS_INDEPENDENT_RUNDOWN;
-
- EXPECT_CALL(*env->pReceiveInterface,hookDomainStateChange(_,DS_INDEPENDENT_RUNDOWN)).Times(1);
-
- ASSERT_EQ(E_OK, env->pRouter->setDomainState(domainID,state));
- env->pSocketHandler.start_listenting();
-}
-
-
-TEST_F(CAmRoutingReceiverAsync,setSourceSoundProperty)
-{
-
- am_Handle_s handle;
- handle.handle = 1;
- handle.handleType = H_SETSOURCESOUNDPROPERTY;
-
- am_sourceID_t sourceID = 3;
- am_SoundProperty_s property;
- property.type = SP_GENIVI_MID;
- property.value = 24;
-
- EXPECT_CALL(*env->pReceiveInterface,ackSetSourceSoundProperty(_,E_OK)).Times(1);
-
- ASSERT_EQ(E_OK, env->pRouter->asyncSetSourceSoundProperty(handle,sourceID,property));
- env->pSocketHandler.start_listenting();
-}
-
-TEST_F(CAmRoutingReceiverAsync,setSinkSoundProperty)
-{
-
- am_Handle_s handle;
- handle.handle = 1;
- handle.handleType = H_SETSINKSOUNDPROPERTY;
-
- am_sinkID_t sinkID = 1;
- am_SoundProperty_s property;
- property.type = SP_GENIVI_MID;
- property.value = 24;
-
- EXPECT_CALL(*env->pReceiveInterface,ackSetSinkSoundProperty(_,E_OK)).Times(1);
-
- ASSERT_EQ(E_OK, env->pRouter->asyncSetSinkSoundProperty(handle,sinkID,property));
- env->pSocketHandler.start_listenting();
-}
-
-TEST_F(CAmRoutingReceiverAsync,setSourceState)
-{
-
- am_Handle_s handle;
- handle.handle = 1;
- handle.handleType = H_SETSOURCESTATE;
-
- am_sourceID_t sourceID = 1;
- am_SourceState_e state = SS_OFF;
-
- EXPECT_CALL(*env->pReceiveInterface,ackSetSourceState(_,E_OK)).Times(1);
-
- ASSERT_EQ(E_OK, env->pRouter->asyncSetSourceState(handle,sourceID,state));
- env->pSocketHandler.start_listenting();
-}
-
-TEST_F(CAmRoutingReceiverAsync,setSourceVolume)
-{
-
- am_Handle_s handle;
- handle.handle = 1;
- handle.handleType = H_SETSOURCEVOLUME;
-
- am_sourceID_t sourceID = 3;
- am_volume_t volume = 3;
- am_CustomRampType_t ramp = RAMP_GENIVI_DIRECT;
- am_time_t myTime = 25;
-
- EXPECT_CALL(*env->pReceiveInterface,ackSourceVolumeTick(_,sourceID,_)).Times(AtLeast(1));
- EXPECT_CALL(*env->pReceiveInterface,ackSetSourceVolumeChange(_,volume,E_OK)).Times(1);
-
- ASSERT_EQ(E_OK, env->pRouter->asyncSetSourceVolume(handle,sourceID,volume,ramp,myTime));
- env->pSocketHandler.start_listenting();
-}
-
-TEST_F(CAmRoutingReceiverAsync,setSinkVolume)
-{
-
- am_Handle_s handle;
- handle.handle = 1;
- handle.handleType = H_SETSINKVOLUME;
-
- am_sinkID_t sinkID = 1;
- am_volume_t volume = 9;
- am_CustomRampType_t ramp = RAMP_GENIVI_DIRECT;
- am_time_t myTime = 25;
-
- EXPECT_CALL(*env->pReceiveInterface,ackSinkVolumeTick(_,sinkID,_)).Times(AtLeast(2));
- EXPECT_CALL(*env->pReceiveInterface,ackSetSinkVolumeChange(_,volume,E_OK)).Times(1);
-
- ASSERT_EQ(E_OK, env->pRouter->asyncSetSinkVolume(handle,sinkID,volume,ramp,myTime));
- env->pSocketHandler.start_listenting();
-}
-
-TEST_F(CAmRoutingReceiverAsync,setSinkVolumeAbort)
-{
-
- am_Handle_s handle;
- handle.handle = 1;
- handle.handleType = H_SETSINKVOLUME;
-
- am_sinkID_t sinkID = 2;
- am_volume_t volume = 25;
- am_CustomRampType_t ramp = RAMP_GENIVI_DIRECT;
- am_time_t myTime = 25;
-
- EXPECT_CALL(*env->pReceiveInterface, ackSinkVolumeTick(_,sinkID,_));
- EXPECT_CALL(*env->pReceiveInterface,ackSetSinkVolumeChange(_,AllOf(Ne(volume),Ne(0)),E_ABORTED)).Times(1);
-
- ASSERT_EQ(E_OK, env->pRouter->asyncSetSinkVolume(handle,sinkID,volume,ramp,myTime));
- sleep(0.5);
- ASSERT_EQ(E_OK, env->pRouter->asyncAbort(handle));
- env->pSocketHandler.start_listenting();
-}
-
-TEST_F(CAmRoutingReceiverAsync,disconnectNonExisting)
-{
-
- am_Handle_s handle;
- handle.handle = 1;
- handle.handleType = H_DISCONNECT;
-
- am_connectionID_t connectionID = 4;
-
- EXPECT_CALL(*env->pReceiveInterface,ackConnect(_,connectionID,E_OK)).Times(0);
- EXPECT_CALL(*env->pReceiveInterface,ackDisconnect(_,connectionID,E_OK)).Times(0);
- ASSERT_EQ(E_NON_EXISTENT, env->pRouter->asyncDisconnect(handle,connectionID));
- env->pSocketHandler.start_listenting();
-}
-
-TEST_F(CAmRoutingReceiverAsync,disconnectTooEarly)
-{
-
- am_Handle_s handle_c;
- handle_c.handle = 1;
- handle_c.handleType = H_CONNECT;
-
- am_Handle_s handle;
- handle.handle = 1;
- handle.handleType = H_DISCONNECT;
-
- am_connectionID_t connectionID = 4;
- am_sourceID_t sourceID = 2;
- am_sinkID_t sinkID = 1;
- am_CustomConnectionFormat_t format = CF_GENIVI_ANALOG;
-
- EXPECT_CALL(*env->pReceiveInterface, ackConnect(_,connectionID,E_OK));
- EXPECT_CALL(*env->pReceiveInterface,ackDisconnect(_,connectionID,E_OK)).Times(0);
- ASSERT_EQ(E_OK, env->pRouter->asyncConnect(handle_c,connectionID,sourceID,sinkID,format));
- ASSERT_EQ(E_NON_EXISTENT, env->pRouter->asyncDisconnect(handle,connectionID));
- env->pSocketHandler.start_listenting();
-}
-
-TEST_F(CAmRoutingReceiverAsync,disconnectAbort)
-{
-
- am_Handle_s handle_c;
- handle_c.handle = 1;
- handle_c.handleType = H_CONNECT;
-
- am_Handle_s handle;
- handle.handle = 1;
- handle.handleType = H_DISCONNECT;
-
- am_connectionID_t connectionID = 5;
- am_sourceID_t sourceID = 2;
- am_sinkID_t sinkID = 1;
- am_CustomConnectionFormat_t format = CF_GENIVI_ANALOG;
-
- EXPECT_CALL(*env->pReceiveInterface, ackConnect(_,connectionID,E_OK));
- EXPECT_CALL(*env->pReceiveInterface, ackDisconnect(_,connectionID,E_ABORTED));
- ASSERT_EQ(E_OK, env->pRouter->asyncConnect(handle_c,connectionID,sourceID,sinkID,format));
- sleep(2);
- ASSERT_EQ(E_OK, env->pRouter->asyncDisconnect(handle,connectionID));
- ASSERT_EQ(E_OK, env->pRouter->asyncAbort(handle));
- env->pSocketHandler.start_listenting();
-}
-
-TEST_F(CAmRoutingReceiverAsync,disconnect)
-{
-
- am_Handle_s handle_c;
- handle_c.handle = 1;
- handle_c.handleType = H_CONNECT;
-
- am_Handle_s handle;
- handle.handle = 1;
- handle.handleType = H_DISCONNECT;
-
- am_connectionID_t connectionID = 4;
- am_sourceID_t sourceID = 2;
- am_sinkID_t sinkID = 1;
- am_CustomConnectionFormat_t format = CF_GENIVI_ANALOG;
-
- EXPECT_CALL(*env->pReceiveInterface, ackConnect(_,connectionID,E_OK));
- EXPECT_CALL(*env->pReceiveInterface, ackDisconnect(_,connectionID,E_OK));
- ASSERT_EQ(E_OK, env->pRouter->asyncConnect(handle_c,connectionID,sourceID,sinkID,format));
- sleep(2);
- ASSERT_EQ(E_OK, env->pRouter->asyncDisconnect(handle,connectionID));
- env->pSocketHandler.start_listenting();
-}
-
-TEST_F(CAmRoutingReceiverAsync,connectAbortTooLate)
-{
-
- am_Handle_s handle;
- handle.handle = 1;
- handle.handleType = H_CONNECT;
-
- am_connectionID_t connectionID = 4;
- am_sourceID_t sourceID = 2;
- am_sinkID_t sinkID = 1;
- am_CustomConnectionFormat_t format = CF_GENIVI_ANALOG;
-
- EXPECT_CALL(*env->pReceiveInterface,ackConnect(_,connectionID,E_OK)).Times(1);
- ASSERT_EQ(E_OK, env->pRouter->asyncConnect(handle,connectionID,sourceID,sinkID,format));
- sleep(3);
- ASSERT_EQ(E_NON_EXISTENT, env->pRouter->asyncAbort(handle));
- env->pSocketHandler.start_listenting();
-}
-
-TEST_F(CAmRoutingReceiverAsync,connectAbort)
-{
-
- am_Handle_s handle;
- handle.handle = 1;
- handle.handleType = H_CONNECT;
-
- am_connectionID_t connectionID = 4;
- am_sourceID_t sourceID = 2;
- am_sinkID_t sinkID = 1;
- am_CustomConnectionFormat_t format = CF_GENIVI_ANALOG;
-
- EXPECT_CALL(*env->pReceiveInterface,ackConnect(_,connectionID,E_ABORTED)).Times(1);
- ASSERT_EQ(E_OK, env->pRouter->asyncConnect(handle,connectionID,sourceID,sinkID,format));
- sleep(0.5);
- ASSERT_EQ(E_OK, env->pRouter->asyncAbort(handle));
- env->pSocketHandler.start_listenting();
-}
-
-TEST_F(CAmRoutingReceiverAsync,connectWrongFormat)
-{
-
- am_Handle_s handle;
- handle.handle = 1;
- handle.handleType = H_CONNECT;
-
- am_connectionID_t connectionID = 4;
- am_sourceID_t sourceID = 2;
- am_sinkID_t sinkID = 1;
- am_CustomConnectionFormat_t format = CF_GENIVI_MONO;
-
- EXPECT_CALL(*env->pReceiveInterface,ackConnect(_,connectionID,E_OK)).Times(0);
- ASSERT_EQ(E_WRONG_FORMAT, env->pRouter->asyncConnect(handle,connectionID,sourceID,sinkID,format));
- env->pSocketHandler.start_listenting();
-}
-
-TEST_F(CAmRoutingReceiverAsync,connectWrongSink)
-{
-
- am_Handle_s handle;
- handle.handle = 1;
- handle.handleType = H_CONNECT;
-
- am_connectionID_t connectionID = 4;
- am_sourceID_t sourceID = 2;
- am_sinkID_t sinkID = 122;
- am_CustomConnectionFormat_t format = CF_GENIVI_ANALOG;
-
- EXPECT_CALL(*env->pReceiveInterface,ackConnect(_,connectionID,E_OK)).Times(0);
- ASSERT_EQ(E_NON_EXISTENT, env->pRouter->asyncConnect(handle,connectionID,sourceID,sinkID,format));
- env->pSocketHandler.start_listenting();
-}
-
-TEST_F(CAmRoutingReceiverAsync,connectWrongSource)
-{
- am_Handle_s handle;
- handle.handle = 1;
- handle.handleType = H_CONNECT;
-
- am_connectionID_t connectionID = 4;
- am_sourceID_t sourceID = 25;
- am_sinkID_t sinkID = 1;
- am_CustomConnectionFormat_t format = CF_GENIVI_ANALOG;
-
- EXPECT_CALL(*env->pReceiveInterface,ackConnect(_,connectionID,E_OK)).Times(0);
- ASSERT_EQ(E_NON_EXISTENT, env->pRouter->asyncConnect(handle,connectionID,sourceID,sinkID,format));
- env->pSocketHandler.start_listenting();
-}
-
-TEST_F(CAmRoutingReceiverAsync,connect)
-{
-
- am_Handle_s handle;
- handle.handle = 1;
- handle.handleType = H_CONNECT;
-
- am_connectionID_t connectionID = 4;
- am_sourceID_t sourceID = 2;
- am_sinkID_t sinkID = 1;
- am_CustomConnectionFormat_t format = CF_GENIVI_ANALOG;
-
- EXPECT_CALL(*env->pReceiveInterface, ackConnect(_,connectionID,E_OK));
- ASSERT_EQ(E_OK, env->pRouter->asyncConnect(handle,connectionID,sourceID,sinkID,format));
- env->pSocketHandler.start_listenting();
-}
-
-TEST_F(CAmRoutingReceiverAsync,connectNoMoreThreads)
-{
-
- am_Handle_s handle;
- handle.handle = 1;
- handle.handleType = H_CONNECT;
-
- am_connectionID_t connectionID = 1;
- am_sourceID_t sourceID = 2;
- am_sinkID_t sinkID = 1;
- am_CustomConnectionFormat_t format = CF_GENIVI_ANALOG;
-
- EXPECT_CALL(*env->pReceiveInterface,ackConnect(_,_,E_OK)).Times(10);
- for (int i = 0; i < 10; i++)
- {
- handle.handle++;
- connectionID++;
- ASSERT_EQ(E_OK, env->pRouter->asyncConnect(handle,connectionID,sourceID,sinkID,format));
- }
- ASSERT_EQ(E_NOT_POSSIBLE, env->pRouter->asyncConnect(handle,connectionID,sourceID,sinkID,format));
- env->pSocketHandler.start_listenting();
-}
-
-int main(int argc, char **argv)
-{
- ::testing::InitGoogleTest(&argc, argv);
- CAmEnvironment* const env = (CAmEnvironment*)::testing::AddGlobalTestEnvironment(new CAmEnvironment);
- (void) env;
- return RUN_ALL_TESTS();
-}
-
diff --git a/PluginRoutingInterfaceAsync/test/CAmRoutingReceiverAsync.h b/PluginRoutingInterfaceAsync/test/CAmRoutingReceiverAsync.h
deleted file mode 100644
index 0c478e7..0000000
--- a/PluginRoutingInterfaceAsync/test/CAmRoutingReceiverAsync.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/**
- * Copyright (c) 2012 BMW
- *
- * \author Christian Mueller, christian.ei.mueller@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 TESTROUTINGINTERFACEASYNC_H_
-#define TESTROUTINGINTERFACEASYNC_H_
-
-#include "gtest/gtest.h"
-#include "gmock/gmock.h"
-
-#include "MockIAmRoutingReceive.h"
-#include "shared/CAmSocketHandler.h"
-#include "shared/CAmSerializer.h"
-#include "routing/IAmRoutingSend.h"
-
-#define UNIT_TEST 1
-
-namespace am
-{
-
-class CAmEnvironment: public ::testing::Environment
-{
-public:
- CAmSocketHandler pSocketHandler;
- IAmRoutingSend* pRouter;
- MockIAmRoutingReceive *pReceiveInterface;
- static std::vector<std::string> returnListPlugins();
- static am_Error_e handleDomainRegister(const am_Domain_s& domainData, am_domainID_t& domainID);
- static am_Error_e handleSourceRegister(const am_Source_s& sourceData, am_sourceID_t& sourceID);
- static am_Error_e handleSinkRegister(const am_Sink_s& sinkData, am_sinkID_t& sinkID);
- void timerCallback(sh_timerHandle_t handle, void* userData);
- TAmShTimerCallBack<CAmEnvironment> ptimerCallback;
- CAmEnvironment();
- ~CAmEnvironment();
- // Override this to define how to set up the environment.
- void SetUp();
- // Override this to define how to tear down the environment.
- void TearDown();
-private:
- static am_domainID_t mDomainIDCount;
-};
-
-class CAmRoutingReceiverAsync: public ::testing::Test
-{
-public:
- CAmRoutingReceiverAsync();
- ~CAmRoutingReceiverAsync();
- void timerCallback(sh_timerHandle_t handle, void* userData);
- TAmShTimerCallBack<CAmRoutingReceiverAsync> ptimerCallback;
- void SetUp();
- void TearDown();
-private:
-};
-
-} /* namespace am */
-#endif /* TESTROUTINGINTERFACEASYNC_H_ */
diff --git a/PluginRoutingInterfaceAsync/test/CMakeLists.txt b/PluginRoutingInterfaceAsync/test/CMakeLists.txt
deleted file mode 100644
index 8df4bdd..0000000
--- a/PluginRoutingInterfaceAsync/test/CMakeLists.txt
+++ /dev/null
@@ -1,95 +0,0 @@
-# Copyright (c) 2012 GENIVI Alliance
-# Copyright (c) 2012 BMW
-#
-# author Christian Mueller, christian.ei.mueller@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.6)
-
-PROJECT(AmRoutingReceiverAsync)
-
-set(EXECUTABLE_OUTPUT_PATH ${TEST_EXECUTABLE_OUTPUT_PATH})
-
-FIND_PACKAGE(Threads)
-FIND_PACKAGE(PkgConfig)
-FIND_PACKAGE(DBUS REQUIRED)
-
-
-IF(WITH_DLT)
- pkg_check_modules(DLT REQUIRED automotive-dlt)
-ENDIF(WITH_DLT)
-
-IF(WITH_DATABASE_STORAGE)
- pkg_check_modules(SQLITE REQUIRED sqlite3)
-ENDIF(WITH_DATABASE_STORAGE)
-
-INCLUDE_DIRECTORIES(
- ${STD_INCLUDE_DIRS}
- ${CMAKE_SOURCE_DIR}
- ${CMAKE_CURRENT_BINARY_DIR}
- ${AUDIO_INCLUDE_FOLDER}
- ${CMAKE_SOURCE_DIR}
- ${INCLUDE_FOLDER}
- ${DBUS_INCLUDE_DIR}
- ${DBUS_ARCH_INCLUDE_DIR}
- ${GOOGLE_TEST_INCLUDE_DIR}
- ${GMOCK_INCLUDE_DIR}
- "../../AudioManagerDaemon/include"
- "../include"
-)
-
-IF(WITH_DLT)
-INCLUDE_DIRECTORIES(${INCLUDE_DIRECTORIES}
- ${DLT_INCLUDE_DIRS}
-)
-ENDIF(WITH_DLT)
-
-file(GLOB ASYNC_PLUGIN_INTERFACE_SRCS_CXX
- "../../AudioManagerDaemon/src/CAmSocketHandler.cpp"
- "../../AudioManagerDaemon/src/CAmDltWrapper.cpp"
- "../src/*.cpp"
- "CAmRoutingReceiverAsync.cpp"
-)
-
-
-ADD_EXECUTABLE(AmRoutingReceiveAsyncTest ${ASYNC_PLUGIN_INTERFACE_SRCS_CXX})
-
-TARGET_LINK_LIBRARIES(AmRoutingReceiveAsyncTest
- ${CMAKE_DL_LIBS}
- ${CMAKE_THREAD_LIBS_INIT}
- ${DBUS_LIBRARIES}
- ${SQLITE_LIBRARIES}
- rt
- gtest
- gmock
-)
-
-ADD_DEPENDENCIES(AmRoutingReceiveAsyncTest gtest gmock)
-
-IF(WITH_DLT)
- TARGET_LINK_LIBRARIES(AmRoutingReceiveAsyncTest
- ${DLT_LIBRARIES}
- )
-ENDIF(WITH_DLT)
-
-INSTALL(TARGETS AmRoutingReceiveAsyncTest
- DESTINATION "~/AudioManagerTest/"
- PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
- COMPONENT tests
-)
-
-SET(ADD_DEPEND "audiomanager-bin" "dlt" "libdbus-1-3(>=1.2.16)" "libpthread-stubs0")
-set_property(GLOBAL APPEND PROPERTY tests_prop "${ADD_DEPEND}")
-
-
diff --git a/PluginRoutingInterfaceAsync/test/MockIAmRoutingReceive.h b/PluginRoutingInterfaceAsync/test/MockIAmRoutingReceive.h
deleted file mode 100644
index 5bb4f2a..0000000
--- a/PluginRoutingInterfaceAsync/test/MockIAmRoutingReceive.h
+++ /dev/null
@@ -1,134 +0,0 @@
-/**
- * Copyright (c) 2012 BMW
- *
- * \author Christian Mueller, christian.ei.mueller@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 MOCKROUTINGINTERFACE_H_
-#define MOCKROUTINGINTERFACE_H_
-
-#include "routing/IAmRoutingReceive.h"
-
-namespace am {
-
-class MockIAmRoutingReceive : public IAmRoutingReceive {
-public:
- MOCK_CONST_METHOD1(getInterfaceVersion,
- void(std::string& version));
- MOCK_METHOD3(ackConnect,
- void(const am_Handle_s handle, const am_connectionID_t connectionID, const am_Error_e error));
- MOCK_METHOD3(ackDisconnect,
- void(const am_Handle_s handle, const am_connectionID_t connectionID, const am_Error_e error));
- MOCK_METHOD3(ackSetSinkVolumeChange,
- void(const am_Handle_s handle, const am_volume_t volume, const am_Error_e error));
- MOCK_METHOD3(ackSetSourceVolumeChange,
- void(const am_Handle_s handle, const am_volume_t volume, const am_Error_e error));
- MOCK_METHOD2(ackSetSourceState,
- void(const am_Handle_s handle, const am_Error_e error));
- MOCK_METHOD2(ackSetSinkSoundProperties,
- void(const am_Handle_s handle, const am_Error_e error));
- MOCK_METHOD2(ackSetSinkSoundProperty,
- void(const am_Handle_s handle, const am_Error_e error));
- MOCK_METHOD2(ackSetSourceSoundProperties,
- void(const am_Handle_s handle, const am_Error_e error));
- MOCK_METHOD2(ackSetSourceSoundProperty,
- void(const am_Handle_s handle, const am_Error_e error));
- MOCK_METHOD3(ackCrossFading,
- void(const am_Handle_s handle, const am_HotSink_e hotSink, const am_Error_e error));
- MOCK_METHOD3(ackSourceVolumeTick,
- void(const am_Handle_s handle, const am_sourceID_t sourceID, const am_volume_t volume));
- MOCK_METHOD3(ackSinkVolumeTick,
- void(const am_Handle_s handle, const am_sinkID_t sinkID, const am_volume_t volume));
- MOCK_METHOD2(peekDomain,
- am_Error_e(const std::string& name, am_domainID_t& domainID));
- MOCK_METHOD2(registerDomain,
- am_Error_e(const am_Domain_s& domainData, am_domainID_t& domainID));
- MOCK_METHOD1(deregisterDomain,
- am_Error_e(const am_domainID_t domainID));
- MOCK_METHOD2(registerGateway,
- am_Error_e(const am_Gateway_s& gatewayData, am_gatewayID_t& gatewayID));
- MOCK_METHOD2(registerConverter,
- am_Error_e(const am_Converter_s& converterData, am_converterID_t& converterID));
- MOCK_METHOD1(deregisterGateway,
- am_Error_e(const am_gatewayID_t gatewayID));
- MOCK_METHOD1(deregisterConverter,
- am_Error_e(const am_converterID_t converterID));
- MOCK_METHOD2(peekSink,
- am_Error_e(const std::string& name, am_sinkID_t& sinkID));
- MOCK_METHOD2(registerSink,
- am_Error_e(const am_Sink_s& sinkData, am_sinkID_t& sinkID));
- MOCK_METHOD1(deregisterSink,
- am_Error_e(const am_sinkID_t sinkID));
- MOCK_METHOD2(peekSource,
- am_Error_e(const std::string& name, am_sourceID_t& sourceID));
- MOCK_METHOD2(registerSource,
- am_Error_e(const am_Source_s& sourceData, am_sourceID_t& sourceID));
- MOCK_METHOD1(deregisterSource,
- am_Error_e(const am_sourceID_t sourceID));
- MOCK_METHOD2(registerCrossfader,
- am_Error_e(const am_Crossfader_s& crossfaderData, am_crossfaderID_t& crossfaderID));
- MOCK_METHOD1(deregisterCrossfader,
- am_Error_e(const am_crossfaderID_t crossfaderID));
- MOCK_METHOD2(peekSourceClassID,
- am_Error_e(const std::string& name, am_sourceClass_t& sourceClassID));
- MOCK_METHOD2(peekSinkClassID,
- am_Error_e(const std::string& name, am_sinkClass_t& sinkClassID));
- MOCK_METHOD2(hookInterruptStatusChange,
- void(const am_sourceID_t sourceID, const am_InterruptState_e interruptState));
- MOCK_METHOD1(hookDomainRegistrationComplete,
- void(const am_domainID_t domainID));
- MOCK_METHOD2(hookSinkAvailablityStatusChange,
- void(const am_sinkID_t sinkID, const am_Availability_s& availability));
- MOCK_METHOD2(hookSourceAvailablityStatusChange,
- void(const am_sourceID_t sourceID, const am_Availability_s& availability));
- MOCK_METHOD2(hookDomainStateChange,
- void(const am_domainID_t domainID, const am_DomainState_e domainState));
- MOCK_METHOD2(hookTimingInformationChanged,
- void(const am_connectionID_t connectionID, const am_timeSync_t delay));
- MOCK_METHOD1(sendChangedData,
- void(const std::vector<am_EarlyData_s>& earlyData));
- MOCK_CONST_METHOD1(getDBusConnectionWrapper,
- am_Error_e(CAmDbusWrapper*& dbusConnectionWrapper));
- MOCK_CONST_METHOD1(getSocketHandler,
- am_Error_e(CAmSocketHandler*& socketHandler));
- MOCK_METHOD2(confirmRoutingReady,
- void(const uint16_t handle, const am_Error_e error));
- MOCK_METHOD2(confirmRoutingRundown,
- void(const uint16_t handle, const am_Error_e error));
- MOCK_METHOD4(updateGateway,
- am_Error_e(const am_gatewayID_t gatewayID, const std::vector<am_CustomConnectionFormat_t>& listSourceFormats, const std::vector<am_CustomConnectionFormat_t>& listSinkFormats, const std::vector<bool>& convertionMatrix));
- MOCK_METHOD4(updateConverter,
- am_Error_e(const am_converterID_t converterID, const std::vector<am_CustomConnectionFormat_t>& listSourceFormats, const std::vector<am_CustomConnectionFormat_t>& listSinkFormats, const std::vector<bool>& convertionMatrix));
- MOCK_METHOD5(updateSink,
- am_Error_e(const am_sinkID_t sinkID, const am_sinkClass_t sinkClassID, const std::vector<am_SoundProperty_s>& listSoundProperties, const std::vector<am_CustomConnectionFormat_t>& listConnectionFormats, const std::vector<am_MainSoundProperty_s>& listMainSoundProperties));
- MOCK_METHOD5(updateSource,
- am_Error_e(const am_sourceID_t sourceID, const am_sourceClass_t sourceClassID, const std::vector<am_SoundProperty_s>& listSoundProperties, const std::vector<am_CustomConnectionFormat_t>& listConnectionFormats, const std::vector<am_MainSoundProperty_s>& listMainSoundProperties));
- MOCK_METHOD3(ackSetVolumes,
- void(const am_Handle_s handle, const std::vector<am_Volumes_s>& listvolumes, const am_Error_e error));
- MOCK_METHOD2(ackSinkNotificationConfiguration,
- void(const am_Handle_s handle, const am_Error_e error));
- MOCK_METHOD2(ackSourceNotificationConfiguration,
- void(const am_Handle_s handle, const am_Error_e error));
- MOCK_METHOD2(hookSinkNotificationDataChange,
- void(const am_sinkID_t sinkID, const am_NotificationPayload_s& payload));
- MOCK_METHOD2(hookSourceNotificationDataChange,
- void(const am_sourceID_t sourceID, const am_NotificationPayload_s& payload));
- MOCK_METHOD2(getDomainOfSource,
- am_Error_e(const am_sourceID_t sourceID, am_domainID_t& domainID));
- MOCK_METHOD2(getDomainOfSink,
- am_Error_e(const am_sinkID_t sinkID, am_domainID_t& domainID));
-};
-
-} // namespace am
-#endif /* MOCKROUTINGINTERFACE_H_ */
diff --git a/PluginRoutingInterfaceCAPI/CMakeLists.txt b/PluginRoutingInterfaceCAPI/CMakeLists.txt
deleted file mode 100644
index c7b9594..0000000
--- a/PluginRoutingInterfaceCAPI/CMakeLists.txt
+++ /dev/null
@@ -1,101 +0,0 @@
-# Copyright (c) 2012 GENIVI Alliance
-# Copyright (c) 2012 BMW
-#
-# 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/.
-#
-cmake_minimum_required(VERSION 2.6)
-
-PROJECT(PluginRoutingInterfaceCAPI)
-
-OPTION(WITH_ROUTING_INTERFACE_CAPI
- "build with routing iterface common-api plugin" ON)
-
-IF(WITH_ROUTING_INTERFACE_CAPI AND WITH_CAPI_WRAPPER)
-
-set(LIBRARY_OUTPUT_PATH ${PLUGINS_OUTPUT_PATH}/routing)
-set(DOC_OUTPUT_PATH ${DOC_OUTPUT_PATH}/RoutingPlugin)
-set(INCLUDE_FOLDER "include")
-
-SET(SHARED_FOLDER "${CMAKE_INSTALL_PREFIX}/share")
-FILE(READ "${AUDIO_INCLUDE_FOLDER}/routing/IAmRoutingSend.h" VERSION_BUFFER LIMIT 6000)
-STRING(REGEX MATCH "RoutingSendVersion*.[^0-9]*[0-9].[0-9]*[0-9]" LIB_INTERFACE_VERSION_STRING ${VERSION_BUFFER})
-STRING(REGEX REPLACE "RoutingSendVersion*.." "" LIB_INTERFACE_VERSION ${LIB_INTERFACE_VERSION_STRING})
-MESSAGE(STATUS "Building against routing interface version ${LIB_INTERFACE_VERSION}")
-
-INSERT_DBUS_CONF_IF_NEEDED("@ROUTING_INTERFACE_DBUS_CONF@"
- "${CMAKE_CURRENT_SOURCE_DIR}/fidl/PluginRoutingInterfaceCAPI_dbus.conf"
- ROUTING_INTERFACE_DBUS_CONF)
-
-set(ROUTING_INTERFACE_DBUS_CONF ${ROUTING_INTERFACE_DBUS_CONF} PARENT_SCOPE)
-
-
-CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/config.cmake ${CMAKE_CURRENT_SOURCE_DIR}/include/configRoutingCAPI.h )
-
-FIND_PACKAGE(CommonAPI REQUIRED)
-
-# Find the common-api sources.
-# The sources can be placed in the build directory (DESTINATION) or in the source tree (ALT_DESTINATION).
-# The ALT_DESTINATION is used as fall back if the DESTINATION directory dosen't contain the sources or you just don't want to use the generator.
-INCLUDE(CommonAPIGenerator)
-COMMON_API_GENERATE_SOUCRES(TARGET COMMON_API_ROUTING_INTERFACE
- FIDLS fidl/RoutingInterface.fidl # a list with fidls
- DESTINATION src-gen # a relative path to the build directory or an absolute path
- ALT_DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/src-gen # an alternative relative/absolute path with common-api sources, usually in the source tree
- DBUS)
-
-INCLUDE_DIRECTORIES(
- ${CMAKE_SOURCE_DIR}
- ${CMAKE_CURRENT_BINARY_DIR}
- ${AUDIO_INCLUDE_FOLDER}
- ${PROJECT_INCLUDE_FOLDER}
- ${COMMON_API_INCLUDE_DIRS}
- ${COMMON_API_DBUS_INCLUDE_DIRS}
- ${COMMON_API_ROUTING_INTERFACE_GEN_INCLUDE_DIR}
- ${INCLUDE_FOLDER}
-)
-
-# all source files go here
-file(GLOB PLUGINCAPI_SRCS_CXX "src/*.cpp" ${COMMON_API_ROUTING_INTERFACE_GEN_SOURCES})
-
-add_library(PluginRoutingInterfaceCAPI MODULE ${PLUGINCAPI_SRCS_CXX})
-
-TARGET_LINK_LIBRARIES(PluginRoutingInterfaceCAPI
- ${DLT_LIBRARIES}
- ${COMMON_API_LIBRARIES}
- ${COMMON_API_DBUS_LIBRARIES}
-)
-
-IF(WITH_TESTS)
- add_subdirectory (test)
-ENDIF(WITH_TESTS)
-
-#IF(WITH_DOCUMENTATION)
-# file(MAKE_DIRECTORY ${DOC_OUTPUT_PATH})
-# configure_file(${DOXY_FILE} ${DOC_OUTPUT_PATH}/Doxyfile @ONLY IMMEDIATE)
-# add_custom_target (PluginRoutingInterfaceCAPIDocs ALL
-# COMMAND ${DOXYGEN_EXECUTABLE} ${DOC_OUTPUT_PATH}/Doxyfile WORKING_DIRECTORY ${DOC_OUTPUT_PATH}
-# SOURCES ${PROJECT_BINARY_DIR} ${DOC_OUTPUT_PATH}/Doxyfile
-# )
-#ENDIF(WITH_DOCUMENTATION)
-
-INSTALL(TARGETS PluginRoutingInterfaceCAPI
- DESTINATION "lib/${LIB_INSTALL_SUFFIX}/routing"
- PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
- COMPONENT sampleplugins
-)
-
-SET(ADD_DEPEND "audiomanager-bin" "dlt")
-set_property(GLOBAL APPEND PROPERTY sampleplugins_prop "${ADD_DEPEND}")
-
-ENDIF(WITH_ROUTING_INTERFACE_CAPI AND WITH_CAPI_WRAPPER)
diff --git a/PluginRoutingInterfaceCAPI/cmake/config.cmake b/PluginRoutingInterfaceCAPI/cmake/config.cmake
deleted file mode 100644
index 20ce881..0000000
--- a/PluginRoutingInterfaceCAPI/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/PluginRoutingInterfaceCAPI/fidl/PluginRoutingInterfaceCAPI_dbus.conf b/PluginRoutingInterfaceCAPI/fidl/PluginRoutingInterfaceCAPI_dbus.conf
deleted file mode 100755
index 835d40c..0000000
--- a/PluginRoutingInterfaceCAPI/fidl/PluginRoutingInterfaceCAPI_dbus.conf
+++ /dev/null
@@ -1,8 +0,0 @@
-######################################### Routing interface configuration ########################################
-# PluginRoutingInterfaceCAPI_dbus.conf #
-# If you change something make sure you re-configure with 'ccmake..' which generates the *_dbus.conf file again. #
-##################################################################################################################
-[local:org.genivi.audiomanager.routinginterface:org.genivi.audiomanager]
-dbus_connection=org.genivi.audiomanager
-dbus_object=/org/genivi/audiomanager/RoutingControlObserver
-dbus_interface=org.genivi.audiomanager.RoutingControlObserver \ No newline at end of file
diff --git a/PluginRoutingInterfaceCAPI/fidl/RoutingInterface.fidl b/PluginRoutingInterfaceCAPI/fidl/RoutingInterface.fidl
deleted file mode 100755
index c0a3759..0000000
--- a/PluginRoutingInterfaceCAPI/fidl/RoutingInterface.fidl
+++ /dev/null
@@ -1,899 +0,0 @@
-package org.genivi.am
-import org.genivi.am.* from "../../AudioManagerDaemon/fidls/AudioManagerTypes.fidl"
-
-<**
- @description : This class implements everything from Audiomanager -&gt; RoutingAdapter
- @author : Christian Mueller
-**>
-
-interface RoutingControl {
- version {
- major 2
- minor 0
- }
-
- <**
- @description : aborts an asynchronous action.
-(at)return E_OK on success, E_UNKNOWN on error, E_NON_EXISTENT if handle was not found
- **>
- method asyncAbort {
- in {
- am_Handle_s handle
- }
- }
-
- <**
- @description : connects a source to a sink
-(at)return E_OK on success, E_UNKNOWN on error, E_WRONG_FORMAT in case am_ConnectionFormat_e does not match
- **>
- method asyncConnect {
- in {
- am_Handle_s handle
- am_connectionID_t connectionID
- am_sourceID_t sourceID
- am_sinkID_t sinkID
- am_CustomConnectionFormat_t connectionFormat
- }
- }
-
- <**
- @description : disconnect a connection with given connectionID
-(at)return E_OK on success, E_UNKNOWN on error, E_NON_EXISTENT if connection was not found
- **>
- method asyncDisconnect {
- in {
- am_Handle_s handle
- am_connectionID_t connectionID
- }
- }
-
- <**
- @description : this method is used to set the volume of a sink. This function is used to drive ramps, to mute or unmute or directly set the value. The difference is made through the ramptype.
-(at)return E_OK on success, E_UNKNOWN on error, E_OUT_OF_RANGE if new volume is out of range
- **>
- method asyncSetSinkVolume {
- in {
- am_Handle_s handle
- am_sinkID_t sinkID
- am_volume_t volume
- am_CustomRampType_t ramp
- am_time_t time
- }
- }
-
- <**
- @description : sets the volume of a source. This method is used to set the volume of a sink. This function is used to drive ramps, to mute or unmute or directly set the value. The difference is made through the ramptype.
-(at)return E_OK on success, E_UNKNOWN on error, E_OUT_OF_RANGE if volume is out of range.
-triggers the acknowledge ackSourceVolumeChange
- **>
- method asyncSetSourceVolume {
- in {
- am_Handle_s handle
- am_sourceID_t sourceID
- am_volume_t volume
- am_CustomRampType_t ramp
- am_time_t time
- }
- }
-
- <**
- @description : This function is used to set the source state of a particular source.
-(at)return E_OK on success, E_UNKNOWN on error
- **>
- method asyncSetSourceState {
- in {
- am_Handle_s handle
- am_sourceID_t sourceID
- am_SourceState_e ^state
- }
- }
-
- <**
- @description : this function sets the sinksoundproperty.
-(at)return E_OK on success, E_UNKNOWN on error, E_OUT_OF_RANGE in case the propery value is out of range
- **>
- method asyncSetSinkSoundProperties {
- in {
- am_Handle_s handle
- am_sinkID_t sinkID
- am_SoundProperty_L listSoundProperties
- }
- }
-
- <**
- @description : this function sets the sinksoundproperty.
-(at)return E_OK on success, E_UNKNOWN on error, E_OUT_OF_RANGE in case the propery value is out of range
- **>
- method asyncSetSinkSoundProperty {
- in {
- am_Handle_s handle
- am_sinkID_t sinkID
- am_SoundProperty_s soundProperty
- }
- }
-
- <**
- @description : this function sets the sourcesoundproperty.
-(at)return E_OK on success, E_UNKNOWN on error, E_OUT_OF_RANGE in case the propery value is out of range
- **>
- method asyncSetSourceSoundProperties {
- in {
- am_Handle_s handle
- am_sourceID_t sourceID
- am_SoundProperty_L listSoundProperties
- }
- }
-
- <**
- @description : this function sets the sourcesoundproperty.
-(at)return E_OK on success, E_UNKNOWN on error, E_OUT_OF_RANGE in case the propery value is out of range
- **>
- method asyncSetSourceSoundProperty {
- in {
- am_Handle_s handle
- am_sourceID_t sourceID
- am_SoundProperty_s soundProperty
- }
- }
-
- <**
- @description : this function triggers crossfading.
-(at)return E_OK on success, E_UNKNOWN on error
- **>
- method asyncCrossFade {
- in {
- am_Handle_s handle
- am_crossfaderID_t crossfaderID
- am_HotSink_e hotSink
- am_CustomRampType_t rampType
- am_time_t time
- }
- }
-
- <**
- @description : this function is used for early and late audio functions to set the domain state
-(at)return E_OK on success, E_UNKNOWN on error
- **>
- method setDomainState {
- in {
- am_domainID_t domainID
- am_DomainState_e domainState
- }
- out {
- am_Error_e ^error
- }
- }
- method asyncSetVolumes {
- in {
- am_Handle_s handle
- am_Volumes_L volumes
- }
- }
- method asyncSetSinkNotificationConfiguration {
- in {
- am_Handle_s handle
- am_sinkID_t sinkID
- am_NotificationConfiguration_s notificationConfiguration
- }
- }
- method asyncSetSourceNotificationConfiguration {
- in {
- am_Handle_s handle
- am_sourceID_t sourceID
- am_NotificationConfiguration_s notificationConfiguration
- }
- }
-
-}
-
-<**
- @description : Routing Receive sendInterface description.
- @author : Christian Mueller
-**>
-
-interface RoutingControlObserver {
- version {
- major 2
- minor 0
- }
-
- <**
- @description : This attribute signals to the clients the current routing state.
-A client should notify himself to this attribute in order to know the current state and act accordingly.
- **>
- attribute am_RoutingReady_e RoutingReady readonly
-
- <**
- @description : acknowledges a asyncConnect
- **>
- method ackConnect {
- in {
- am_Handle_s handle
- am_connectionID_t connectionID
-
- <**
- @description : E_OK on success, E_ABORTED if action was aborted, E_UNKNOWN on error
- **>
- am_Error_e ^error
- }
- }
-
- <**
- @description : acknowledges a asyncDisconnect
- **>
- method ackDisconnect {
- in {
- am_Handle_s handle
- am_connectionID_t connectionID
-
- <**
- @description : E_OK on success, E_ABORTED if action was aborted, E_UNKNOWN on error
- **>
- am_Error_e ^error
- }
- }
-
- <**
- @description : acknowledges a asyncsetSinkVolume
- **>
- method ackSetSinkVolumeChange {
- in {
- am_Handle_s handle
-
- <**
- @description : The current actual value that is set
- **>
- am_volume_t volume
-
- <**
- @description : E_OK on success, E_ABORTED if action was aborted, E_UNKNOWN on error
- **>
- am_Error_e ^error
- }
- }
-
- <**
- @description : acknowledges a asyncsetSourceVolume
- **>
- method ackSetSourceVolumeChange {
- in {
-
- <**
- @description : handle that belongs to the change
- **>
- am_Handle_s handle
-
- <**
- @description : the current volume
- **>
- am_volume_t volume
-
- <**
- @description : E_OK on success, E_ABORTED if action was aborted, E_UNKNOWN on error
- **>
- am_Error_e ^error
- }
- }
-
- <**
- @description : acknowlegde for asyncSetSourceState
- **>
- method ackSetSourceState {
- in {
- am_Handle_s handle
-
- <**
- @description : E_OK on success, E_ABORTED if action was aborted, E_UNKNOWN on error
- **>
- am_Error_e ^error
- }
- }
-
- <**
- @description : acknowledges asyncSetSinkSoundProperties
- **>
- method ackSetSinkSoundProperties {
- in {
- am_Handle_s handle
-
- <**
- @description : E_OK on success, E_ABORTED if action was aborted, E_UNKNOWN on error
- **>
- am_Error_e ^error
- }
- }
-
- <**
- @description : acknowledges asyncSetSinkSoundProperty
- **>
- method ackSetSinkSoundProperty {
- in {
- am_Handle_s handle
-
- <**
- @description : E_OK on success, E_ABORTED if action was aborted, E_UNKNOWN on error
- **>
- am_Error_e ^error
- }
- }
-
- <**
- @description : acknowledges asyncSetSourceSoundProperties
- **>
- method ackSetSourceSoundProperties {
- in {
- am_Handle_s handle
-
- <**
- @description : E_OK on success, E_ABORTED if action was aborted, E_UNKNOWN on error
- **>
- am_Error_e ^error
- }
- }
-
- <**
- @description : acknowledges asyncSetSourceSoundProperty
- **>
- method ackSetSourceSoundProperty {
- in {
- am_Handle_s handle
-
- <**
- @description : E_OK on success, E_ABORTED if action was aborted, E_UNKNOWN on error
- **>
- am_Error_e ^error
- }
- }
-
- <**
- @description : acknowledges asyncCrossFade
- **>
- method ackCrossFading {
- in {
- am_Handle_s handle
-
- <**
- @description : this is the current hot sink, HS_INTERMEDIATE is here when a crossfading action did not reach the end
- **>
- am_HotSink_e hotSink
-
- <**
- @description : E_OK on success, E_ABORTED if action was aborted, E_UNKNOWN on error
- **>
- am_Error_e ^error
- }
- }
-
- <**
- @description : acknowledges a volume tick. This can be used to display volumechanges during ramps
- **>
- method ackSourceVolumeTick {
- in {
- am_Handle_s handle
- am_sourceID_t sourceID
- am_volume_t volume
- }
- }
-
- <**
- @description : acknowledges a volume tick. This can be used to display volumechanges during ramps
- **>
- method ackSinkVolumeTick {
- in {
- am_Handle_s handle
- am_sinkID_t sinkID
- am_volume_t volume
- }
- }
-
- <**
- @description : This function returns the ID to the given domainName. If already a domain is registered with this name, it will return the corresponding ID, if not it will reserve an ID but not register the domain. The other parameters of the domain will be overwritten when the domain is registered.
-(at)return E_OK on success, E_UNKNOWN on error
- **>
- method peekDomain {
- in {
- String name
- }
- out {
- am_domainID_t domainID
- am_Error_e ^error
- }
- }
-
- <**
- @description : registers a domain
-(at)return E_OK on succes, E_ALREADY_EXISTENT if already registered E_UNKOWN on error
- **>
- method registerDomain {
- in {
-
- <**
- @description : domainID in am_Domain_s must be 0!
- **>
- am_Domain_s domainData
- String returnBusname
- String returnInterface
- }
- out {
- am_domainID_t domainID
- am_Error_e ^error
- }
- }
-
- <**
- @description : deregisters a domain. All sources, sinks, gateways and crossfaders from that domain will be removed as well.
-(at)return E_OK on succes, E_NON_EXISTENT if not found E_UNKOWN on error
- **>
- method deregisterDomain {
- in {
-
- <**
- @description : < the nonde of the bus
- **>
- am_domainID_t domainID
- }
- out {
- am_Error_e ^error
- }
- }
-
- <**
- @description : registers a gateway. (at)return E_OK on succes, E_ALREADY_EXISTENT if already registered E_UNKOWN on error
- **>
- method registerGateway {
- in {
-
- <**
- @description : In a fixed setup, the gatewayID must be below 100. In a dynamic setup, the gatewayID shall be 0. listSourceFormats and listSinkFormats are empty at registration time. Values are taken over when sources and sinks are registered.
-
-
- **>
- am_Gateway_s gatewayData
- }
- out {
- am_gatewayID_t gatewayID
- am_Error_e ^error
- }
- }
-
- <**
- @description : registers a converter. (at)return E_OK on succes, E_ALREADY_EXISTENT if already registered E_UNKOWN on error
- **>
- method registerConverter {
- in {
-
- <**
- @description : In a fixed setup, the gatewayID must be below 100. In a dynamic setup, the gatewayID shall be 0. listSourceFormats and listSinkFormats are empty at registration time. Values are taken over when sources and sinks are registered.
-
-
- **>
- am_Converter_s converterData
- }
- out {
- am_converterID_t converterID
- am_Error_e ^error
- }
- }
-
- <**
- @description : deregisters a gateway. Also removes all sinks and sources of the controlling domain.
-(at)return E_OK on succes, E_NON_EXISTENT if not found E_UNKOWN on error
- **>
- method deregisterGateway {
- in {
-
- <**
- @description : domainID of the control domain
- **>
- am_gatewayID_t gatewayID
- }
- out {
- am_Error_e ^error
- }
- }
-
- <**
- @description : deregisters a converter. Also removes all sinks and sources of the controlling domain.
- **>
- method deregisterConverter {
- in {
-
- <**
- @description : domainID of the control domain
- **>
- am_converterID_t converterID
- }
- out {
- am_Error_e ^error
- }
- }
-
- <**
- @description : This function returns the ID to the given sinkName. If already a sink is registered with this name, it will return the corresponding ID, if not it will reserve an ID but not register the sink. The other parameters of the sink will be overwritten when the sink is registered.
-(at)return E_OK on success, E_UNKNOWN on error
- **>
- method peekSink {
- in {
-
- <**
- @description : ID is not valid since not created yet
- **>
- String name
- }
- out {
- am_sinkID_t sinkID
- am_Error_e ^error
- }
- }
-
- <**
- @description : Registers a sink. If the sink is part of a gateway, the listconnectionFormats is copied to the gatewayInformation
-(at)return E_OK on succes, E_ALREADY_EXISTENT if already registered E_UNKOWN on error
- **>
- method registerSink {
- in {
-
- <**
- @description : In a fixed setup, the sinkID within am_Sink_s must be below 100. In a dynamic setup the sinkID must be 0 in am_Sink_s.
- **>
- am_Sink_s sinkData
- }
- out {
- am_sinkID_t sinkID
- am_Error_e ^error
- }
- }
-
- <**
- @description : deregisters a sink.
-(at)return E_OK on succes, E_NON_EXISTENT if not found E_UNKOWN on error
- **>
- method deregisterSink {
- in {
- am_sinkID_t sinkID
- }
- out {
- am_Error_e ^error
- }
- }
-
- <**
- @description : This function returns the ID to the given sourceName. If already a source is registered with this name, it will return the corresponding ID, if not it will reserve an ID but not register the source. The other parameters of the source will be overwritten when the source is registered.
-(at)return E_OK on success, E_UNKNOWN on error
- **>
- method peekSource {
- in {
- String name
- }
- out {
- am_sourceID_t sourceID
- am_Error_e ^error
- }
- }
-
- <**
- @description : registers a source. If the source is part of a gateway, the listconnectionFormats is copied to the gatewayInformation
-(at)return E_OK on success, E_UNKNOWN on error, E_ALREADY_EXIST if either name or sourceID already exists
- **>
- method registerSource {
- in {
-
- <**
- @description : In a fixed setup, the sourceID within am_Source_s must be below 100. In a dynamic setup the sourceID must be 0 in am_Source_s
- **>
- am_Source_s sourceData
- }
- out {
- am_sourceID_t sourceID
- am_Error_e ^error
- }
- }
-
- <**
- @description : deregisters a source
-(at)return E_OK on succes, E_NON_EXISTENT if not found E_UNKOWN on error
- **>
- method deregisterSource {
- in {
- am_sourceID_t sourceID
- }
- out {
- am_Error_e ^error
- }
- }
-
- <**
- @description : this function registers a crossfader.
-(at)return E_OK on succes, E_ALREADY_EXISTENT if already registered E_UNKOWN on error
- **>
- method registerCrossfader {
- in {
-
- <**
- @description : in a fixed setup, the crossfaderID must be below 100. In a dynamic setup the crossfasderID shall be 0
- **>
- am_Crossfader_s crossfaderData
- }
- out {
- am_crossfaderID_t crossfaderID
- am_Error_e ^error
- }
- }
-
- <**
- @description : this function deregisters a crossfader. removes all sources and sinks assiated as well.
-(at)return E_OK on succes, E_NON_EXISTENT if not found E_UNKOWN on error
- **>
- method deregisterCrossfader {
- in {
- am_crossfaderID_t crossfaderID
- }
- out {
- am_Error_e ^error
- }
- }
-
- <**
- @description : this function peeks a sourceclassID. It is used by the RoutingPlugins to determine the SinkClassIDs of a sinkClass.
-(at)return E_OK on succes, E_DATABASE_ERROR on error
- **>
- method peekSourceClassID {
- in {
- String name
- }
- out {
- am_sourceClass_t sourceClassID
- am_Error_e ^error
- }
- }
-
- <**
- @description : this function peeks a sourceclassID. It is used by the RoutingPlugins to determine the SinkClassIDs of a sinkClass.
-(at)return E_OK on succes, E_DATABASE_ERROR on error
- **>
- method peekSinkClassID {
- in {
- String name
- }
- out {
- am_sinkClass_t sinkClassID
- am_Error_e ^error
- }
- }
-
- <**
- @description : is called when a low level interrupt changes it status.
- **>
- method hookInterruptStatusChange {
- in {
- am_sourceID_t sourceID
- am_InterruptState_e interruptState
- }
- }
-
- <**
- @description : This hook is called when all elements from a domain are registered.
-Is used by the Controller to know when all expected domains are finally registered
- **>
- method hookDomainRegistrationComplete {
- in {
- am_domainID_t domainID
- }
- }
-
- <**
- @description : is called when a sink changes its availability
- **>
- method hookSinkAvailablityStatusChange {
- in {
- am_sinkID_t sinkID
- am_Availability_s availability
- }
- }
-
- <**
- @description : is called when a source changes its availability
- **>
- method hookSourceAvailablityStatusChange {
- in {
- am_sourceID_t sourceID
- am_Availability_s availability
- }
- }
-
- <**
- @description : is called when a domain changes its status. This used for early domains only
- **>
- method hookDomainStateChange {
- in {
- am_domainID_t domainID
- am_DomainState_e domainState
- }
- }
-
- <**
- @description : is called when the timinginformation (delay) changed for a connection.
- **>
- method hookTimingInformationChanged {
- in {
- am_connectionID_t connectionID
- am_timeSync_t delay
- }
- }
-
- <**
- @description : this function is used to send out all data that has been changed in an early state.
-(at)return E_OK on success, E_UNKNOWN on error
- **>
- method sendChangedData {
- in {
- am_EarlyData_L earlyData
- }
- }
-
- <**
- @description : updates data of an gateway. (at)return E_OK on success, E_NON_EXISTENT if the gatewayID is not valid.
- **>
- method updateGateway {
- in {
-
- <**
- @description : This is the new gateway data that has been updated. Please note that changing source and sink IDs,
-
- **>
- am_gatewayID_t gatewayID
- am_ConnectionFormat_L listSourceFormats
- am_ConnectionFormat_L listSinkFormats
- am_Convertion_L convertionMatrix
- }
- out {
- am_Error_e ^error
- }
- }
-
- <**
- @description : updates data of an converter. (at)return E_OK on success, E_NON_EXISTENT if the converterID is not valid.
- **>
- method updateConverter {
- in {
-
- <**
- @description : This is the new converter data that has been updated. Please note that changing source and sink IDs,
-
- **>
- am_converterID_t converterID
- am_ConnectionFormat_L listSourceFormats
- am_ConnectionFormat_L listSinkFormats
- am_Convertion_L convertionMatrix
- }
- out {
- am_Error_e ^error
- }
- }
-
- <**
- @description : updates data of an sink. (at)return E_OK on success, E_NON_EXISTENT if the sinkID is not valid.
- **>
- method updateSink {
- in {
-
- <**
- @description : The sinkID of the sink
- **>
- am_sinkID_t sinkID
- am_sinkClass_t sinkClassID
- am_SoundProperty_L listSoundProperties
- am_ConnectionFormat_L listConnectionFormats
- am_MainSoundProperty_L listMainSoundProperties
- }
- out {
- am_Error_e ^error
- }
- }
-
- <**
- @description : updates data of an source. (at)return E_OK on success, E_NON_EXISTENT if the sourceID in the struct is not valid.
-Please note that only the following data out of am_Source_s have effect when they are changed:
-sourceClassID,
-listSoundProperties,
-listConnectionFormats,
-listMainSoundProperties
- **>
- method updateSource {
- in {
-
- <**
- @description : the sourceID of the source
- **>
- am_sourceID_t sourceID
- am_sourceClass_t sourceClassID
- am_SoundProperty_L listSoundProperties
- am_ConnectionFormat_L listConnectionFormats
- am_MainSoundProperty_L listMainSoundProperties
- }
- out {
- am_Error_e ^error
- }
- }
-
- <**
- @description : acknowledges a asyncSetSinkVolumes
- **>
- method ackSetVolumes {
- in {
- am_Handle_s handle
-
- <**
- @description : The list of volumes that have been set. ramp and time values have no meaning when the struct is used here.
- **>
- am_Volumes_L listvolumes
-
- <**
- @description : E_OK on success, E_ABORTED if action was aborted, E_UNKNOWN on error
- **>
- am_Error_e ^error
- }
- }
-
- <**
- @description : The acknowledge of the SinkNotificationConfiguration
- **>
- method ackSinkNotificationConfiguration {
- in {
- am_Handle_s handle
- am_Error_e ^error
- }
- }
-
- <**
- @description : The acknowledge of the SourceNotificationConfiguration
- **>
- method ackSourceNotificationConfiguration {
- in {
- am_Handle_s handle
- am_Error_e ^error
- }
- }
-
- <**
- @description : is called whenever a notified value needs to be send
- **>
- method hookSinkNotificationDataChange {
- in {
-
- <**
- @description : The sinkID of the sink where the data changed
- **>
- am_sinkID_t sinkID
-
- <**
- @description : The payload
- **>
- am_NotificationPayload_s payload
- }
- }
-
- <**
- @description : is called whenever a notified value needs to be send
- **>
- method hookSourceNotificationDataChange {
- in {
-
- <**
- @description : The sinkID of the sink where the data changed
- **>
- am_sourceID_t sourceID
-
- <**
- @description : The payload
- **>
- am_NotificationPayload_s payload
- }
- }
- method confirmRoutingRundown {
- in {
- String domainName
- }
- }
-
-} \ No newline at end of file
diff --git a/PluginRoutingInterfaceCAPI/include/CAmLookupData.h b/PluginRoutingInterfaceCAPI/include/CAmLookupData.h
deleted file mode 100644
index 9aeb454..0000000
--- a/PluginRoutingInterfaceCAPI/include/CAmLookupData.h
+++ /dev/null
@@ -1,203 +0,0 @@
-/**
- * Copyright (c) 2012 BMW
- *
- * \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 CAMLOOKUPDATA_H_
-#define CAMLOOKUPDATA_H_
-
-#include <map>
-#include <iostream>
-#include <cassert>
-#include <memory>
-#include <CommonAPI/CommonAPI.h>
-#include "audiomanagertypes.h"
-#include <org/genivi/am/RoutingControlProxy.h>
-
-#ifdef UNIT_TEST
-#include "../test/IAmRoutingSenderBackdoor.h" //we need this for the unit test
-#endif
-
-namespace am {
-
-using namespace CommonAPI;
-
-/** A structure holding info for given domain.
- * For every domain a single instance is created which is used by the lookup methods.
- */
-
-struct rs_lookupData_s
-{
-private:
- bool mIsConnected; //!< bool indicating whether the domain is reachable or not
- std::shared_ptr<org::genivi::am::RoutingControlProxy<> > mSenderProxy; //!< a pointer to the proxy object, which implements the connection out from AudioManager
- CommonAPI::ProxyStatusEvent::Subscription mSubscription; //!< subscription for the proxy system events
- void onServiceStatusEvent(const CommonAPI::AvailabilityStatus& serviceStatus); //!< proxy status event callback
-public:
- rs_lookupData_s(const std::shared_ptr<org::genivi::am::RoutingControlProxy<> > & aProxy);
- ~rs_lookupData_s();
-
- /**
- * returns the proxy object.
- */
- std::shared_ptr<org::genivi::am::RoutingControlProxy<>> & getProxy();
- /**
- * returns whether the proxy object is connected or not.
- */
- bool isConnected();
- /**
- * proxy wrapping methods.
- */
- am_Error_e asyncAbort(const am_Handle_s handle, org::genivi::am::RoutingControlProxyBase::AsyncAbortAsyncCallback);
- am_Error_e asyncConnect(const am_Handle_s handle, const am_connectionID_t, const am_sourceID_t, const am_sinkID_t, const am_CustomConnectionFormat_t, org::genivi::am::RoutingControlProxyBase::AsyncConnectAsyncCallback);
- am_Error_e asyncDisconnect(const am_Handle_s handle, const am_connectionID_t, org::genivi::am::RoutingControlProxyBase::AsyncDisconnectAsyncCallback);
- am_Error_e asyncSetSinkVolume(const am_Handle_s handle, const am_sinkID_t, const am_volume_t, const am_CustomRampType_t, const am_time_t, org::genivi::am::RoutingControlProxyBase::AsyncSetSinkVolumeAsyncCallback);
- am_Error_e asyncSetSourceVolume(const am_Handle_s handle, const am_sourceID_t , const am_volume_t, const am_CustomRampType_t, const am_time_t, org::genivi::am::RoutingControlProxyBase::AsyncSetSourceVolumeAsyncCallback);
- am_Error_e asyncSetSourceState(const am_Handle_s handle, const am_sourceID_t, const am_SourceState_e, org::genivi::am::RoutingControlProxyBase::AsyncSetSourceStateAsyncCallback);
- am_Error_e asyncSetSinkSoundProperties(const am_Handle_s handle, const am_sinkID_t, const std::vector<am_SoundProperty_s>&, org::genivi::am::RoutingControlProxyBase::AsyncSetSinkSoundPropertiesAsyncCallback);
- am_Error_e asyncSetSinkSoundProperty(const am_Handle_s handle, const am_sinkID_t, const am_SoundProperty_s&, org::genivi::am::RoutingControlProxyBase::AsyncSetSinkSoundPropertyAsyncCallback);
- am_Error_e asyncSetSourceSoundProperties(const am_Handle_s handle, const am_sourceID_t, const std::vector<am_SoundProperty_s>&, org::genivi::am::RoutingControlProxyBase::AsyncSetSourceSoundPropertiesAsyncCallback);
- am_Error_e asyncSetSourceSoundProperty(const am_Handle_s handle, const am_sourceID_t, const am_SoundProperty_s&, org::genivi::am::RoutingControlProxyBase::AsyncSetSourceSoundPropertyAsyncCallback);
- am_Error_e asyncCrossFade(const am_Handle_s handle, const am_crossfaderID_t, const am_HotSink_e, const am_CustomRampType_t, const am_time_t, org::genivi::am::RoutingControlProxyBase::AsyncCrossFadeAsyncCallback);
- am_Error_e setDomainState(const am_domainID_t, const am_DomainState_e, org::genivi::am::RoutingControlProxyBase::SetDomainStateAsyncCallback);
- am_Error_e asyncSetVolumes(const am_Handle_s handle, const std::vector<am_Volumes_s>&, org::genivi::am::RoutingControlProxyBase::AsyncSetVolumesAsyncCallback);
- am_Error_e asyncSetSinkNotificationConfiguration(const am_Handle_s handle, const am_sinkID_t, const am_NotificationConfiguration_s&, org::genivi::am::RoutingControlProxyBase::AsyncSetSinkNotificationConfigurationAsyncCallback);
- am_Error_e asyncSetSourceNotificationConfiguration(const am_Handle_s handle, const am_sourceID_t, const am_NotificationConfiguration_s&, org::genivi::am::RoutingControlProxyBase::AsyncSetSourceNotificationConfigurationAsyncCallback);
-};
-
-
-/**
- * The class encapsulate the lookup mechanism and forwards the invocations to the appropriate lookup objects ( proxies ).
- */
-class CAmLookupData {
-
- typedef std::shared_ptr<rs_lookupData_s> RSLookupDataPtr;
- /**
- * Lookup maps.
- */
- typedef std::map<am_domainID_t,RSLookupDataPtr> mapDomain_t;
- typedef std::map<am_sinkID_t,RSLookupDataPtr> mapSinks_t;
- typedef std::map<am_sourceID_t,RSLookupDataPtr> mapSources_t;
- typedef std::map<am_connectionID_t,RSLookupDataPtr> mapConnections_t;
- typedef std::map<uint16_t,RSLookupDataPtr> mapHandles_t;
- typedef std::map<am_crossfaderID_t,RSLookupDataPtr> mapCrossfaders_t;
-
- mapDomain_t mMapDomains;
- mapSinks_t mMapSinks;
- mapSources_t mMapSources;
- mapConnections_t mMapConnections;
- mapHandles_t mMapHandles;
- mapCrossfaders_t mMapCrossfaders;
-
- /** \brief returns the value for given key if exists.
- *
- * @param key is a search key.
- * @param map is a either domain, sink, source, connection, crossfader or handle map.
- */
- template <typename TKey> static const RSLookupDataPtr getValueForKey(const TKey & key, const std::map<TKey,RSLookupDataPtr> & map);
-
- /** \brief removes all entries which contains given value.
- *
- * @param value is a search value.
- * @param map is a either domain, sink, source, connection, crossfader or handle map.
- */
- template <typename TKey> static void removeEntriesForValue(const RSLookupDataPtr & value, std::map<TKey,RSLookupDataPtr> & map);
-
-public:
- CAmLookupData();
- virtual ~CAmLookupData();
- /** \brief adds a lookup for given domain.
- *
- * @param domainID is a valid domain id.
- * @param aProxy is a proxy object constructed by registerDomain
- */
- void addDomainLookup(am_domainID_t & domainID,
- std::shared_ptr<org::genivi::am::RoutingControlProxy<>> & aProxy);
-
- /** \brief removes given handle from the list.
- *
- */
- void removeHandle(am_Handle_s handle);
-
- /** \brief adds a lookup for given source in a given domain.
- *
- * @param sourceID is a valid source id.
- * @param domainID is a valid domain id
- */
- void addSourceLookup(am_sourceID_t sourceID, am_domainID_t domainID);
-
- /** \brief adds a lookup for given sink in a given domain.
- *
- * @param sinkID is a valid sink id.
- * @param domainID is a valid domain id
- */
- void addSinkLookup(am_sinkID_t sinkID, am_domainID_t domainID);
-
- /** \brief adds a lookup for given crossfader in the domain wherein the given source belongs to.
- *
- * @param crossfaderID is a valid crossfader id.
- * @param soucreID is a valid source id
- */
- void addCrossfaderLookup(am_crossfaderID_t crossfaderID, am_sourceID_t soucreID);
-
- /** \brief removes a given domain lookup.
- */
- void removeDomainLookup(am_domainID_t domainID);
-
- /** \brief removes a given source lookup.
- */
- void removeSourceLookup(am_sourceID_t sourceID);
-
- /** \brief removes a given sink lookup.
- */
- void removeSinkLookup(am_sinkID_t sinkID);
-
- /** \brief removes a given crossfader lookup.
- */
- void removeCrossfaderLookup(am_crossfaderID_t crossfaderID);
-
- /** \brief removes a given connection lookup.
- */
- void removeConnectionLookup(am_connectionID_t connectionID);
-
- size_t numberOfDomains() { return mMapDomains.size(); }
-
- static const char * BUS_NAME;
-
- /**
- * Wrapping methods.
- */
- am_Error_e asyncAbort(const am_Handle_s, org::genivi::am::RoutingControlProxyBase::AsyncAbortAsyncCallback);
- am_Error_e asyncConnect(const am_Handle_s , const am_connectionID_t, const am_sourceID_t, const am_sinkID_t, const am_CustomConnectionFormat_t, org::genivi::am::RoutingControlProxyBase::AsyncConnectAsyncCallback);
- am_Error_e asyncDisconnect(const am_Handle_s , const am_connectionID_t, org::genivi::am::RoutingControlProxyBase::AsyncDisconnectAsyncCallback);
- am_Error_e asyncSetSinkVolume(const am_Handle_s , const am_sinkID_t, const am_volume_t, const am_CustomRampType_t, const am_time_t, org::genivi::am::RoutingControlProxyBase::AsyncSetSinkVolumeAsyncCallback);
- am_Error_e asyncSetSourceVolume(const am_Handle_s , const am_sourceID_t , const am_volume_t, const am_CustomRampType_t, const am_time_t, org::genivi::am::RoutingControlProxyBase::AsyncSetSourceVolumeAsyncCallback);
- am_Error_e asyncSetSourceState(const am_Handle_s , const am_sourceID_t, const am_SourceState_e, org::genivi::am::RoutingControlProxyBase::AsyncSetSourceStateAsyncCallback);
- am_Error_e asyncSetSinkSoundProperties(const am_Handle_s , const am_sinkID_t, const std::vector<am_SoundProperty_s>&, org::genivi::am::RoutingControlProxyBase::AsyncSetSinkSoundPropertiesAsyncCallback);
- am_Error_e asyncSetSinkSoundProperty(const am_Handle_s , const am_sinkID_t, const am_SoundProperty_s&, org::genivi::am::RoutingControlProxyBase::AsyncSetSinkSoundPropertyAsyncCallback);
- am_Error_e asyncSetSourceSoundProperties(const am_Handle_s , const am_sourceID_t, const std::vector<am_SoundProperty_s>&, org::genivi::am::RoutingControlProxyBase::AsyncSetSourceSoundPropertiesAsyncCallback);
- am_Error_e asyncSetSourceSoundProperty(const am_Handle_s , const am_sourceID_t, const am_SoundProperty_s&, org::genivi::am::RoutingControlProxyBase::AsyncSetSourceSoundPropertyAsyncCallback);
- am_Error_e asyncCrossFade(const am_Handle_s , const am_crossfaderID_t, const am_HotSink_e, const am_CustomRampType_t, const am_time_t, org::genivi::am::RoutingControlProxyBase::AsyncCrossFadeAsyncCallback);
- am_Error_e setDomainState(const am_domainID_t, const am_DomainState_e, org::genivi::am::RoutingControlProxyBase::SetDomainStateAsyncCallback);
- am_Error_e asyncSetVolumes(const am_Handle_s , const std::vector<am_Volumes_s>&, org::genivi::am::RoutingControlProxyBase::AsyncSetVolumesAsyncCallback);
- am_Error_e asyncSetSinkNotificationConfiguration(const am_Handle_s , const am_sinkID_t, const am_NotificationConfiguration_s&, org::genivi::am::RoutingControlProxyBase::AsyncSetSinkNotificationConfigurationAsyncCallback);
- am_Error_e asyncSetSourceNotificationConfiguration(const am_Handle_s , const am_sourceID_t, const am_NotificationConfiguration_s&, org::genivi::am::RoutingControlProxyBase::AsyncSetSourceNotificationConfigurationAsyncCallback);
-#ifdef UNIT_TEST
- friend class IAmRoutingSenderBackdoor;
-#endif
-};
-
-} /* namespace am */
-#endif /* CAMLOOKUPDATA_H_ */
diff --git a/PluginRoutingInterfaceCAPI/include/CAmRoutingSenderCAPI.h b/PluginRoutingInterfaceCAPI/include/CAmRoutingSenderCAPI.h
deleted file mode 100644
index 20e07ac..0000000
--- a/PluginRoutingInterfaceCAPI/include/CAmRoutingSenderCAPI.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/**
- * Copyright (c) 2012 BMW
- *
- * \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 CAPIROUTINGSENDER_H_
-#define CAPIROUTINGSENDER_H_
-
-#include "routing/IAmRoutingSend.h"
-#include "shared/CAmCommonAPIWrapper.h"
-#include "CAmRoutingService.h"
-#include "CAmLookupData.h"
-
-#ifdef UNIT_TEST
-#include "../test/IAmRoutingSenderBackdoor.h" //we need this for the unit test
-#endif
-
-namespace am
-{
-using namespace CommonAPI;
-
-#define ROUTING_NODE "routinginterface"
-
-class CAmRoutingSenderCAPI: public IAmRoutingSend
-{
- bool mIsServiceStarted;
- CAmLookupData mLookupData; ///< an object which implements the lookup mechanism
- CAmCommonAPIWrapper *mpCAmCAPIWrapper; ///< pointer to the common-api wrapper
- IAmRoutingReceive *mpIAmRoutingReceive; ///< pointer to the routing receive interface
- std::shared_ptr<CAmRoutingService> mService; ///< shared pointer to the routing service implementation
- CAmRoutingSenderCAPI();
- void checkSourceLookup(const am_sourceID_t id);
- void checkSinkLookup(const am_sinkID_t id);
-public:
- CAmRoutingSenderCAPI(CAmCommonAPIWrapper *aWrapper) ;
- virtual ~CAmRoutingSenderCAPI();
-
- /** \brief starts the plugin - registers the routing interface service.
- *
- * @param pIAmRoutingReceive pointer to the routing receive interface.
- */
- am_Error_e startService(IAmRoutingReceive* pIAmRoutingReceive);
-
- /** \brief interface method which calls startService.
- *
- * @param pIAmRoutingReceive pointer to the routing receive interface.
- */
- am_Error_e startupInterface(IAmRoutingReceive* pIAmRoutingReceive);
-
- /** \brief stops the service - deregister the routing interface service.
- *
- * @param pIAmRoutingReceive pointer to the routing receive interface.
- */
- am_Error_e tearDownInterface(IAmRoutingReceive*);
-
- /** \brief sets and annotates the service ready state.
- *
- */
- void setRoutingReady(const uint16_t handle);
-
- /** \brief sets and annotates the service rundown state.
- *
- */
- 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_CustomConnectionFormat_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) ;
-
- static const char * ROUTING_INTERFACE_SERVICE;
-#ifdef UNIT_TEST
- friend class IAmRoutingSenderBackdoor;
-#endif
-
-};
-}
-
-#endif /* CAPIROUTINGSENDER_H_ */
diff --git a/PluginRoutingInterfaceCAPI/include/CAmRoutingSenderCommon.h b/PluginRoutingInterfaceCAPI/include/CAmRoutingSenderCommon.h
deleted file mode 100644
index 352ed63..0000000
--- a/PluginRoutingInterfaceCAPI/include/CAmRoutingSenderCommon.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/**
- * Copyright (c) 2012 BMW
- *
- * \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 CAMROUTINGSENDERCOMMON_H_
-#define CAMROUTINGSENDERCOMMON_H_
-
-#include <memory>
-#include "audiomanagertypes.h"
-#include <org/genivi/am.h>
-
-using namespace am;
-using namespace CommonAPI;
-
-/**
- * Utility functions
- */
-extern void CAmConvertCAPI2AM(const org::genivi::am::am_Domain_s &, am_Domain_s &);
-extern void CAmConvertCAPI2AM(const org::genivi::am::am_Source_s & , am::am_Source_s & );
-extern void CAmConvertCAPI2AM(const org::genivi::am::am_Sink_s & , am::am_Sink_s & );
-extern void CAmConvertCAPI2AM(const org::genivi::am::am_Availability_s & , am_Availability_s & );
-extern void CAmConvertCAPI2AM(const org::genivi::am::am_SoundProperty_s &, am::am_SoundProperty_s &);
-extern void CAmConvertCAPI2AM(const org::genivi::am::am_MainSoundProperty_s &, am::am_MainSoundProperty_s & );
-extern void CAmConvertCAPI2AM(const org::genivi::am::am_NotificationConfiguration_s & , am::am_NotificationConfiguration_s & );
-extern void CAmConvertCAPI2AM(const org::genivi::am::am_Gateway_s & , am::am_Gateway_s & );
-extern void CAmConvertCAPI2AM(const org::genivi::am::am_Converter_s & , am::am_Converter_s & );
-extern void CAmConvertCAPI2AM(const org::genivi::am::am_Crossfader_s & , am::am_Crossfader_s & );
-extern void CAmConvertCAPI2AM(const org::genivi::am::am_EarlyData_s & , am::am_EarlyData_s & );
-extern void CAmConvertCAPI2AM(const org::genivi::am::am_EarlyData_u &, am::am_EarlyData_u & );
-extern void CAmConvertCAPI2AM(const org::genivi::am::am_DataType_u & , am::am_DataType_u & );
-extern void CAmConvertCAPI2AM(const org::genivi::am::am_Volumes_s &, am::am_Volumes_s &);
-extern void CAmConvertCAPI2AM(const org::genivi::am::am_Handle_s &, am::am_Handle_s &);
-extern void CAmConvertCAPI2AM(const org::genivi::am::am_NotificationPayload_s & , am::am_NotificationPayload_s & );
-extern void CAmConvertCAPIVector2AM(const std::vector<org::genivi::am::am_NotificationConfiguration_s> & , std::vector<am::am_NotificationConfiguration_s> & );
-extern void CAmConvertCAPIVector2AM(const std::vector<org::genivi::am::am_SoundProperty_s> &, std::vector<am::am_SoundProperty_s> &);
-extern void CAmConvertCAPIVector2AM(const std::vector<org::genivi::am::am_CustomConnectionFormat_t> &, std::vector<am::am_CustomConnectionFormat_t> & );
-extern void CAmConvertCAPIVector2AM(const std::vector<org::genivi::am::am_MainSoundProperty_s> &, std::vector<am::am_MainSoundProperty_s> & );
-extern void CAmConvertCAPIVector2AM(const std::vector<org::genivi::am::am_Volumes_s> &, std::vector<am::am_Volumes_s> & );
-extern void CAmConvertCAPIVector2AM(const org::genivi::am::am_EarlyData_L &, std::vector<am::am_EarlyData_s> &);
-
-extern void CAmConvertAM2CAPI(const am_Availability_s & , org::genivi::am::am_Availability_s & );
-extern void CAmConvertAM2CAPI(const am::am_SoundProperty_s &, org::genivi::am::am_SoundProperty_s &);
-extern void CAmConvertAM2CAPI(const am::am_NotificationConfiguration_s &, org::genivi::am::am_NotificationConfiguration_s &);
-extern void CAmConvertAM2CAPI(const am::am_Volumes_s &, org::genivi::am::am_Volumes_s &);
-extern void CAmConvertAMVector2CAPI(const std::vector<am::am_SoundProperty_s> &, std::vector<org::genivi::am::am_SoundProperty_s> &);
-extern void CAmConvertAMVector2CAPI(const std::vector<am::am_Volumes_s> & , std::vector<org::genivi::am::am_Volumes_s> & );
-extern void CAmConvertAM2CAPI(const am::am_Handle_s &, org::genivi::am::am_Handle_s &);
-
-#endif /* CAMROUTINGSENDERCOMMON_H_ */
diff --git a/PluginRoutingInterfaceCAPI/include/CAmRoutingService.h b/PluginRoutingInterfaceCAPI/include/CAmRoutingService.h
deleted file mode 100644
index 503cd1f..0000000
--- a/PluginRoutingInterfaceCAPI/include/CAmRoutingService.h
+++ /dev/null
@@ -1,151 +0,0 @@
-/**
- * Copyright (c) 2012 BMW
- *
- * \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 CAMROUTINGSERVICE_H_
-#define CAMROUTINGSERVICE_H_
-
-#include <org/genivi/am/RoutingControlObserverStubDefault.h>
-#include "../../include/routing/IAmRoutingReceive.h"
-#include "CAmLookupData.h"
-
-namespace am {
-
-class CAmCommonAPIWrapper;
-
-using namespace CommonAPI;
-
-/** Routing interface stub implementation.
- * This class is the routing interface service for the Audio Manager.
- */
-class CAmRoutingService: public org::genivi::am::RoutingControlObserverStubDefault {
- CAmCommonAPIWrapper *mpCAmCAPIWrapper; ///< pointer to common-api wrapper
- IAmRoutingReceive* mpIAmRoutingReceive; ///< pointer to the routing receive interface
- CAmLookupData* mpLookpData; ///< pointer to the plugin's lookup mechanism implementation
- int16_t mNumberDomains; ///< int number of registred domains
- uint16_t mHandle; ///< unsigned current handle
- bool mReady; ///< bool whether the service is in ready state or not
- CAmRoutingService();
-public:
-
- CAmRoutingService(IAmRoutingReceive *aReceiver, CAmLookupData* aLookpData, CAmCommonAPIWrapper *aCAPIWrapper);
- virtual ~CAmRoutingService();
-
-
- /** Stub overwritten methods.
- *
- */
-
- void ackConnect(org::genivi::am::am_Handle_s handle, org::genivi::am::am_connectionID_t connectionID, org::genivi::am::am_Error_e error);
-
- void ackDisconnect(org::genivi::am::am_Handle_s handle, org::genivi::am::am_connectionID_t connectionID, org::genivi::am::am_Error_e error);
-
- void ackSetSinkVolumeChange(org::genivi::am::am_Handle_s handle, org::genivi::am::am_volume_t volume, org::genivi::am::am_Error_e error);
-
- void ackSetSourceVolumeChange(org::genivi::am::am_Handle_s handle, org::genivi::am::am_volume_t volume, org::genivi::am::am_Error_e error);
-
- void ackSetSourceState(org::genivi::am::am_Handle_s handle, org::genivi::am::am_Error_e error);
-
- void ackSetSinkSoundProperties(org::genivi::am::am_Handle_s handle, org::genivi::am::am_Error_e error);
-
- void ackSetSinkSoundProperty(org::genivi::am::am_Handle_s handle, org::genivi::am::am_Error_e error);
-
- void ackSetSourceSoundProperties(org::genivi::am::am_Handle_s handle, org::genivi::am::am_Error_e error);
-
- void ackSetSourceSoundProperty(org::genivi::am::am_Handle_s handle, org::genivi::am::am_Error_e error);
-
- void ackCrossFading(org::genivi::am::am_Handle_s handle, org::genivi::am::am_HotSink_e hotSink, org::genivi::am::am_Error_e error);
-
- void ackSourceVolumeTick(org::genivi::am::am_Handle_s handle, org::genivi::am::am_sourceID_t source, org::genivi::am::am_volume_t volume);
-
- void ackSinkVolumeTick(org::genivi::am::am_Handle_s handle, org::genivi::am::am_sinkID_t sink, org::genivi::am::am_volume_t volume);
-
- void peekDomain(std::string name, org::genivi::am::am_domainID_t& domainID, org::genivi::am::am_Error_e& error);
-
- void registerDomain(org::genivi::am::am_Domain_s domainData, std::string returnBusname, std::string returnInterface, org::genivi::am::am_domainID_t& domainID, org::genivi::am::am_Error_e& error);
-
- void deregisterDomain(org::genivi::am::am_domainID_t domainID, org::genivi::am::am_Error_e& returnError);
-
- void registerGateway(org::genivi::am::am_Gateway_s gatewayData, org::genivi::am::am_gatewayID_t& gatewayID, org::genivi::am::am_Error_e& error);
-
- void registerConverter(org::genivi::am::am_Converter_s aData, org::genivi::am::am_converterID_t& converterID, org::genivi::am::am_Error_e& error);
-
- void deregisterGateway(org::genivi::am::am_gatewayID_t gatewayID, org::genivi::am::am_Error_e& returnError);
-
- void deregisterConverter(org::genivi::am::am_converterID_t converterID, org::genivi::am::am_Error_e& returnError);
-
- void peekSink(std::string name, org::genivi::am::am_sinkID_t& sinkID, org::genivi::am::am_Error_e& error);
-
- void registerSink(org::genivi::am::am_Sink_s sinkData, org::genivi::am::am_sinkID_t& sinkID, org::genivi::am::am_Error_e& error);
-
- void deregisterSink(org::genivi::am::am_sinkID_t sinkID, org::genivi::am::am_Error_e& returnError);
-
- void peekSource(std::string name, org::genivi::am::am_sourceID_t& sourceID, org::genivi::am::am_Error_e& error);
-
- void registerSource(org::genivi::am::am_Source_s sourceData, org::genivi::am::am_sourceID_t& sourceID, org::genivi::am::am_Error_e& error);
-
- void deregisterSource(org::genivi::am::am_sourceID_t sourceID, org::genivi::am::am_Error_e& returnError);
-
- void registerCrossfader(org::genivi::am::am_Crossfader_s crossfaderData, org::genivi::am::am_crossfaderID_t& crossfaderID, org::genivi::am::am_Error_e& error);
-
- void deregisterCrossfader(org::genivi::am::am_crossfaderID_t crossfaderID, org::genivi::am::am_Error_e& returnError);
-
- void peekSourceClassID(std::string name, org::genivi::am::am_sourceClass_t& sourceClassID, org::genivi::am::am_Error_e& error);
-
- void peekSinkClassID(std::string name, org::genivi::am::am_sinkClass_t& sinkClassID, org::genivi::am::am_Error_e& error);
-
- void hookInterruptStatusChange(org::genivi::am::am_sourceID_t sourceID, org::genivi::am::am_InterruptState_e InterruptState);
-
- void hookDomainRegistrationComplete(org::genivi::am::am_domainID_t domainID);
-
- void hookSinkAvailablityStatusChange(org::genivi::am::am_sinkID_t sinkID, org::genivi::am::am_Availability_s availability);
-
- void hookSourceAvailablityStatusChange(org::genivi::am::am_sourceID_t sourceID, org::genivi::am::am_Availability_s availability);
-
- void hookDomainStateChange(org::genivi::am::am_domainID_t domainID, org::genivi::am::am_DomainState_e domainState);
-
- void hookTimingInformationChanged(org::genivi::am::am_connectionID_t connectionID, int16_t delay);
-
- void sendChangedData(org::genivi::am::am_EarlyData_L earlyData);
-
- void updateGateway(org::genivi::am::am_gatewayID_t gatewayID, org::genivi::am::am_ConnectionFormat_L listSourceFormats, org::genivi::am::am_ConnectionFormat_L listSinkFormats, org::genivi::am::am_Convertion_L convertionMatrix, org::genivi::am::am_Error_e& error);
-
- void updateConverter(org::genivi::am::am_converterID_t converterID, org::genivi::am::am_ConnectionFormat_L listSourceFormats, org::genivi::am::am_ConnectionFormat_L listSinkFormats, org::genivi::am::am_Convertion_L convertionMatrix, org::genivi::am::am_Error_e& error);
-
- void updateSink(org::genivi::am::am_sinkID_t sinkID, org::genivi::am::am_sinkClass_t sinkClassID, org::genivi::am::am_SoundProperty_L listSoundProperties, org::genivi::am::am_ConnectionFormat_L listConnectionFormats, org::genivi::am::am_MainSoundProperty_L listMainSoundProperties, org::genivi::am::am_Error_e& error);
-
- void updateSource(org::genivi::am::am_sourceID_t sourceID, org::genivi::am::am_sourceClass_t sourceClassID, org::genivi::am::am_SoundProperty_L listSoundProperties, org::genivi::am::am_ConnectionFormat_L listConnectionFormats, org::genivi::am::am_MainSoundProperty_L listMainSoundProperties, org::genivi::am::am_Error_e& error);
-
- void ackSetVolumes(org::genivi::am::am_Handle_s handle , org::genivi::am::am_Volumes_L listVolumes, org::genivi::am::am_Error_e error);
-
- void ackSinkNotificationConfiguration (org::genivi::am::am_Handle_s handle, org::genivi::am::am_Error_e error);
-
- void ackSourceNotificationConfiguration(org::genivi::am::am_Handle_s handle, org::genivi::am::am_Error_e error);
-
- void hookSinkNotificationDataChange(org::genivi::am::am_sinkID_t sinkID, org::genivi::am::am_NotificationPayload_s payload);
-
- void hookSourceNotificationDataChange(org::genivi::am::am_sourceID_t sourceID, org::genivi::am::am_NotificationPayload_s payload);
-
- void confirmRoutingRundown(std::string domainName);
-
- void gotRundown(int16_t numberDomains, uint16_t handle);
-
- void setHandle(uint16_t handle) {mHandle=handle;}
-
-};
-
-} /* namespace am */
-#endif /* CAMROUTINGSERVICE_H_ */
diff --git a/PluginRoutingInterfaceCAPI/include/configRoutingCAPI.h b/PluginRoutingInterfaceCAPI/include/configRoutingCAPI.h
deleted file mode 100644
index 214e75e..0000000
--- a/PluginRoutingInterfaceCAPI/include/configRoutingCAPI.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef _ROUTINGDBUS_CONFIG_H
-#define _ROUTINGDBUS_CONFIG_H
-
-/* #undef ROUTING_DBUS_INTROSPECTION_FILE */
-
-#endif /* _ROUTINGDBUS_CONFIG_H */
diff --git a/PluginRoutingInterfaceCAPI/src/CAmLookupData.cpp b/PluginRoutingInterfaceCAPI/src/CAmLookupData.cpp
deleted file mode 100644
index 44c1b35..0000000
--- a/PluginRoutingInterfaceCAPI/src/CAmLookupData.cpp
+++ /dev/null
@@ -1,700 +0,0 @@
-/**
- * Copyright (c) 2012 BMW
- *
- * \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 <algorithm>
-#include "CAmLookupData.h"
-#include "CAmRoutingSenderCommon.h"
-#include "shared/CAmDltWrapper.h"
-
-
-namespace am {
-
-const char * CAmLookupData::BUS_NAME = "CAPIRoutingPlugin";
-
-/**
- * rs_lookupData_s
- */
-
-rs_lookupData_s::rs_lookupData_s(const std::shared_ptr<org::genivi::am::RoutingControlProxy<> > & aProxy):mSenderProxy(aProxy)
-{
- logInfo(__PRETTY_FUNCTION__);
- mIsConnected = mSenderProxy->isAvailable();
- mSubscription = mSenderProxy->getProxyStatusEvent().subscribe(std::bind(&rs_lookupData_s::onServiceStatusEvent,this,std::placeholders::_1));
-}
-
-rs_lookupData_s::~rs_lookupData_s()
-{
- mSenderProxy->getProxyStatusEvent().unsubscribe(mSubscription);
- mSenderProxy.reset();
-}
-
-std::shared_ptr<org::genivi::am::RoutingControlProxy<>> & rs_lookupData_s::getProxy()
-{
- return mSenderProxy;
-}
-
-bool rs_lookupData_s::isConnected()
-{
- return mIsConnected;
-}
-
-am_Error_e rs_lookupData_s::asyncAbort(const am_Handle_s handle, org::genivi::am::RoutingControlProxyBase::AsyncAbortAsyncCallback callback)
-{
- logInfo(__PRETTY_FUNCTION__, " [ isConnected : ", isConnected(), " ]");
- if(isConnected())
- {
- org::genivi::am::am_Handle_s myHandle;
- CAmConvertAM2CAPI(handle,myHandle);
- mSenderProxy->asyncAbortAsync(myHandle, callback);
- return (E_OK);
- }
- return (E_UNKNOWN);
-}
-
-am_Error_e rs_lookupData_s::asyncConnect(const am_Handle_s handle,
- const am_connectionID_t connectionID,
- const am_sourceID_t sourceID,
- const am_sinkID_t sinkID,
- const am_CustomConnectionFormat_t connectionFormat,
- org::genivi::am::RoutingControlProxyBase::AsyncConnectAsyncCallback callback)
-{
- logInfo(__PRETTY_FUNCTION__, " [ isConnected : ", isConnected(), " ]");
- if(isConnected())
- {
- org::genivi::am::am_Handle_s myHandle;
- CAmConvertAM2CAPI(handle,myHandle);
- mSenderProxy->asyncConnectAsync(myHandle,
- static_cast<org::genivi::am::am_connectionID_t>(connectionID),
- static_cast<org::genivi::am::am_sourceID_t>(sourceID),
- static_cast<org::genivi::am::am_sinkID_t>(sinkID),
- static_cast<org::genivi::am::am_CustomConnectionFormat_t>(connectionFormat),
- callback);
- return (E_OK);
- }
- return (E_UNKNOWN);
-}
-
-am_Error_e rs_lookupData_s::asyncDisconnect(const am_Handle_s handle,
- const am_connectionID_t connectionID,
- org::genivi::am::RoutingControlProxyBase::AsyncDisconnectAsyncCallback cb)
-{
- logInfo(__PRETTY_FUNCTION__, " [ isConnected : ", isConnected(), " ]");
- if(isConnected())
- {
- org::genivi::am::am_Handle_s myHandle;
- CAmConvertAM2CAPI(handle,myHandle);
- mSenderProxy->asyncDisconnectAsync(myHandle,
- static_cast<org::genivi::am::am_connectionID_t>(connectionID),
- cb);
- return (E_OK);
- }
- return (E_UNKNOWN);
-}
-
-am_Error_e rs_lookupData_s::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,
- org::genivi::am::RoutingControlProxyBase::AsyncSetSinkVolumeAsyncCallback cb)
-{
- logInfo(__PRETTY_FUNCTION__, " [ isConnected : ", isConnected(), " ]");
- if(isConnected())
- {
- org::genivi::am::am_Handle_s myHandle;
- CAmConvertAM2CAPI(handle,myHandle);
- mSenderProxy->asyncSetSinkVolumeAsync(myHandle,
- static_cast<org::genivi::am::am_sinkID_t>(sinkID),
- static_cast<org::genivi::am::am_volume_t>(volume),
- static_cast<org::genivi::am::am_CustomRampType_t>(ramp),
- static_cast<org::genivi::am::am_time_t>(time),
- cb);
- return (E_OK);
- }
- return (E_UNKNOWN);
-}
-
-am_Error_e rs_lookupData_s::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,
- org::genivi::am::RoutingControlProxyBase::AsyncSetSourceVolumeAsyncCallback cb)
-{
- logInfo(__PRETTY_FUNCTION__, " [ isConnected : ", isConnected(), " ]");
- if(isConnected())
- {
- org::genivi::am::am_Handle_s myHandle;
- CAmConvertAM2CAPI(handle,myHandle);
- mSenderProxy->asyncSetSourceVolumeAsync(myHandle,
- static_cast<org::genivi::am::am_sourceID_t>(sourceID),
- static_cast<org::genivi::am::am_volume_t>(volume),
- static_cast<org::genivi::am::am_CustomRampType_t>(ramp),
- static_cast<org::genivi::am::am_time_t>(time),
- cb);
- return (E_OK);
- }
- return (E_UNKNOWN);
-}
-
-am_Error_e rs_lookupData_s::asyncSetSourceState( const am_Handle_s handle,
- const am_sourceID_t sourceID,
- const am_SourceState_e state,
- org::genivi::am::RoutingControlProxyBase::AsyncSetSinkSoundPropertiesAsyncCallback cb)
-{
- logInfo(__PRETTY_FUNCTION__, " [ isConnected : ", isConnected(), " ]");
- if(isConnected())
- {
- org::genivi::am::am_Handle_s myHandle;
- CAmConvertAM2CAPI(handle,myHandle);
- mSenderProxy->asyncSetSourceStateAsync(myHandle,
- static_cast<org::genivi::am::am_sourceID_t>(sourceID),
- static_cast<org::genivi::am::am_SourceState_e>(state),
- cb);
- return (E_OK);
- }
- return (E_UNKNOWN);
-}
-
-am_Error_e rs_lookupData_s::asyncSetSinkSoundProperties( const am_Handle_s handle,
- const am_sinkID_t sinkID,
- const std::vector<am_SoundProperty_s>& listSoundProperties,
- org::genivi::am::RoutingControlProxyBase::AsyncSetSinkSoundPropertiesAsyncCallback cb)
-{
- logInfo(__PRETTY_FUNCTION__, " [ isConnected : ", isConnected(), " ]");
- if(isConnected())
- {
- org::genivi::am::am_SoundProperty_L lsp;
- CAmConvertAMVector2CAPI(listSoundProperties, lsp);
- org::genivi::am::am_Handle_s myHandle;
- CAmConvertAM2CAPI(handle,myHandle);
- mSenderProxy->asyncSetSinkSoundPropertiesAsync(myHandle,
- static_cast<org::genivi::am::am_sinkID_t>(sinkID),
- lsp,
- cb);
- return (E_OK);
- }
- return (E_UNKNOWN);
-}
-
-am_Error_e rs_lookupData_s::asyncSetSinkSoundProperty( const am_Handle_s handle,
- const am_sinkID_t sinkID,
- const am_SoundProperty_s& soundProperty,
- org::genivi::am::RoutingControlProxyBase::AsyncSetSinkSoundPropertyAsyncCallback cb)
-{
- logInfo(__PRETTY_FUNCTION__, " [ isConnected : ", isConnected(), " ]");
- if(isConnected())
- {
- org::genivi::am::am_SoundProperty_s converted;
- CAmConvertAM2CAPI(soundProperty, converted);
- org::genivi::am::am_Handle_s myHandle;
- CAmConvertAM2CAPI(handle,myHandle);
- mSenderProxy->asyncSetSinkSoundPropertyAsync(myHandle,
- static_cast<org::genivi::am::am_sinkID_t>(sinkID),
- converted,
- cb);
- return (E_OK);
- }
- return (E_UNKNOWN);
-}
-
-am_Error_e rs_lookupData_s::asyncSetSourceSoundProperties(const am_Handle_s handle,
- const am_sourceID_t sourceID,
- const std::vector<am_SoundProperty_s>& listSoundProperties,
- org::genivi::am::RoutingControlProxyBase::AsyncSetSourceSoundPropertiesAsyncCallback cb)
-{
- logInfo(__PRETTY_FUNCTION__, " [ isConnected : ", isConnected(), " ]");
- if(isConnected())
- {
- org::genivi::am::am_SoundProperty_L lsp;
- CAmConvertAMVector2CAPI(listSoundProperties, lsp);
- org::genivi::am::am_Handle_s myHandle;
- CAmConvertAM2CAPI(handle,myHandle);
- mSenderProxy->asyncSetSourceSoundPropertiesAsync(myHandle,
- static_cast<org::genivi::am::am_sourceID_t>(sourceID),
- lsp,
- cb);
- return (E_OK);
- }
- return (E_UNKNOWN);
-}
-
-am_Error_e rs_lookupData_s::asyncSetSourceSoundProperty(const am_Handle_s handle,
- const am_sourceID_t sourceID,
- const am_SoundProperty_s& soundProperty,
- org::genivi::am::RoutingControlProxyBase::AsyncSetSourceSoundPropertyAsyncCallback cb)
-{
- logInfo(__PRETTY_FUNCTION__, " [ isConnected : ", isConnected(), " ]");
- if(isConnected())
- {
- org::genivi::am::am_SoundProperty_s converted;
- CAmConvertAM2CAPI(soundProperty, converted);
- org::genivi::am::am_Handle_s myHandle;
- CAmConvertAM2CAPI(handle,myHandle);
- mSenderProxy->asyncSetSourceSoundPropertyAsync( myHandle,
- static_cast<org::genivi::am::am_sourceID_t>(sourceID),
- converted,
- cb);
- return (E_OK);
- }
- return (E_UNKNOWN);
-}
-
-
-am_Error_e rs_lookupData_s::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,
- org::genivi::am::RoutingControlProxyBase::AsyncCrossFadeAsyncCallback cb)
-{
- logInfo(__PRETTY_FUNCTION__, " [ isConnected : ", isConnected(), " ]");
- if(isConnected())
- {
- org::genivi::am::am_Handle_s myHandle;
- CAmConvertAM2CAPI(handle,myHandle);
- mSenderProxy->asyncCrossFadeAsync(myHandle,
- static_cast<org::genivi::am::am_crossfaderID_t>(crossfaderID),
- static_cast<org::genivi::am::am_HotSink_e>(hotSink),
- static_cast<org::genivi::am::am_CustomRampType_t>(rampType),
- static_cast<org::genivi::am::am_time_t>(time),
- cb);
- return (E_OK);
- }
- return (E_UNKNOWN);
-}
-
-am_Error_e rs_lookupData_s::setDomainState(const am_domainID_t domainID, const am_DomainState_e domainState, org::genivi::am::RoutingControlProxyBase::SetDomainStateAsyncCallback cb)
-{
- logInfo(__PRETTY_FUNCTION__, " [ isConnected : ", isConnected(), " ]");
- if(isConnected())
- {
- mSenderProxy->setDomainStateAsync(static_cast<org::genivi::am::am_domainID_t>(domainID),
- static_cast<org::genivi::am::am_DomainState_e>(domainState),
- cb);
- return (E_OK);
- }
- return (E_UNKNOWN);
-}
-
-am_Error_e rs_lookupData_s::asyncSetVolumes(const am_Handle_s handle,
- const std::vector<am_Volumes_s>& volumes ,
- org::genivi::am::RoutingControlProxyBase::AsyncSetVolumesAsyncCallback cb )
-{
- logInfo(__PRETTY_FUNCTION__, " [ isConnected : ", isConnected(), " ]");
- if(isConnected())
- {
- org::genivi::am::am_Volumes_L list;
- CAmConvertAMVector2CAPI(volumes, list);
- org::genivi::am::am_Handle_s myHandle;
- CAmConvertAM2CAPI(handle,myHandle);
- mSenderProxy->asyncSetVolumesAsync(myHandle,
- list,
- cb);
- return (E_OK);
- }
- return (E_UNKNOWN);
-}
-
-am_Error_e rs_lookupData_s::asyncSetSinkNotificationConfiguration(const am_Handle_s handle,
- const am_sinkID_t sinkID,
- const am_NotificationConfiguration_s& notificationConfiguration,
- org::genivi::am::RoutingControlProxyBase::AsyncSetSinkNotificationConfigurationAsyncCallback cb)
-{
- logInfo(__PRETTY_FUNCTION__, " [ isConnected : ", isConnected(), " ]");
- if(isConnected())
- {
- org::genivi::am::am_NotificationConfiguration_s converted;
- CAmConvertAM2CAPI(notificationConfiguration, converted);
- org::genivi::am::am_Handle_s myHandle;
- CAmConvertAM2CAPI(handle,myHandle);
- mSenderProxy->asyncSetSinkNotificationConfigurationAsync(myHandle,
- static_cast<org::genivi::am::am_sinkID_t>(sinkID),
- converted,
- cb);
- return (E_OK);
- }
- return (E_UNKNOWN);
-}
-
-am_Error_e rs_lookupData_s::asyncSetSourceNotificationConfiguration(const am_Handle_s handle,
- const am_sourceID_t sourceID,
- const am_NotificationConfiguration_s& notificationConfiguration,
- org::genivi::am::RoutingControlProxyBase::AsyncSetSourceNotificationConfigurationAsyncCallback cb)
-{
- logInfo(__PRETTY_FUNCTION__, " [ isConnected : ", isConnected(), " ]");
- if(isConnected())
- {
- org::genivi::am::am_NotificationConfiguration_s converted;
- CAmConvertAM2CAPI(notificationConfiguration, converted);
- org::genivi::am::am_Handle_s myHandle;
- CAmConvertAM2CAPI(handle,myHandle);
- mSenderProxy->asyncSetSourceNotificationConfigurationAsync( myHandle,
- static_cast<org::genivi::am::am_sourceID_t>(sourceID),
- converted,
- cb);
- return (E_OK);
- }
- return (E_UNKNOWN);
-}
-
-void rs_lookupData_s::onServiceStatusEvent(const CommonAPI::AvailabilityStatus& serviceStatus)
-{
- logInfo(__PRETTY_FUNCTION__, " status : ", (int)serviceStatus );
- mIsConnected = (serviceStatus==CommonAPI::AvailabilityStatus::AVAILABLE);
-}
-
-/**
- * CAmLookupData
- */
-
-CAmLookupData::CAmLookupData():mMapDomains(), mMapSinks(), mMapSources(),mMapConnections(),mMapHandles(), mMapCrossfaders() {
- // TODO Auto-generated constructor stub
-
-}
-
-CAmLookupData::~CAmLookupData() {
- // TODO Auto-generated destructor stub
-}
-
-void CAmLookupData::addDomainLookup(am_domainID_t & domainID,
- std::shared_ptr<org::genivi::am::RoutingControlProxy<>> & aProxy)
-{
- logInfo(__PRETTY_FUNCTION__, " [ domainID : ", domainID, " ]");
- RSLookupDataPtr lookupData = std::make_shared<rs_lookupData_s>(aProxy);
- mMapDomains.insert(std::make_pair(domainID, lookupData));
-}
-
-void CAmLookupData::removeHandle(am_Handle_s handle)
-{
- mMapHandles.erase(handle.handle);
-}
-
-void CAmLookupData::addSourceLookup(am_sourceID_t sourceID, am_domainID_t domainID)
-{
- logInfo(__PRETTY_FUNCTION__, " [ domainID : ", domainID, " ]", " [ sourceID : ", sourceID, " ]");
- mapDomain_t::iterator iter(mMapDomains.begin());
- iter = mMapDomains.find(domainID);
- if (iter != mMapDomains.end())
- {
- mMapSources.insert(std::make_pair(sourceID, iter->second));
- }
-}
-
-void CAmLookupData::addSinkLookup(am_sinkID_t sinkID, am_domainID_t domainID)
-{
- logInfo(__PRETTY_FUNCTION__, " [ domainID : ", domainID, " ]", " [ sinkID : ", sinkID, " ]");
- mapDomain_t::iterator iter(mMapDomains.begin());
- iter = mMapDomains.find(domainID);
- if (iter != mMapDomains.end())
- {
- mMapSinks.insert(std::make_pair(sinkID, iter->second));
- }
-}
-
-void CAmLookupData::addCrossfaderLookup(am_crossfaderID_t crossfaderID, am_sourceID_t soucreID)
-{
- logInfo(__PRETTY_FUNCTION__, " [ crossfaderID : ", crossfaderID, " ]", " [ soucreID : ", soucreID, " ]");
- mapSources_t::iterator iter(mMapSources.begin());
- iter = mMapSources.find(soucreID);
- if (iter != mMapSources.end())
- {
- mMapCrossfaders.insert(std::make_pair(crossfaderID, iter->second));
- }
-}
-
-void CAmLookupData::removeDomainLookup(am_domainID_t domainID)
-{
- mapDomain_t::iterator iter(mMapDomains.begin());
- iter = mMapDomains.find(domainID);
- if (iter != mMapDomains.end())
- {
- CAmLookupData::removeEntriesForValue(iter->second, mMapSources);
- CAmLookupData::removeEntriesForValue(iter->second, mMapSinks);
- CAmLookupData::removeEntriesForValue(iter->second, mMapCrossfaders);
- CAmLookupData::removeEntriesForValue(iter->second, mMapHandles);
- CAmLookupData::removeEntriesForValue(iter->second, mMapConnections);
- mMapDomains.erase(domainID);
- }
-}
-
-void CAmLookupData::removeSourceLookup(am_sourceID_t sourceID)
-{
- mMapSources.erase(sourceID);
-}
-
-void CAmLookupData::removeSinkLookup(am_sinkID_t sinkID)
-{
- mMapSinks.erase(sinkID);
-}
-
-void CAmLookupData::removeCrossfaderLookup(am_crossfaderID_t crossfaderID)
-{
- mMapCrossfaders.erase(crossfaderID);
-}
-
-void CAmLookupData::removeConnectionLookup(am_connectionID_t connectionID)
-{
- mMapConnections.erase(connectionID);
-}
-
-template <typename TKey> void CAmLookupData::removeEntriesForValue(const RSLookupDataPtr & value, std::map<TKey,RSLookupDataPtr> & map)
-{
- typename std::map<TKey,RSLookupDataPtr>::iterator it = map.begin();
- while ( it != map.end() )
- {
- if (it->second == value)
- {
- typename std::map<TKey,RSLookupDataPtr>::iterator it_tmp = it;
- it++;
- map.erase(it_tmp);
- }
- else
- ++it;
- }
-}
-
-template <typename TKey> const CAmLookupData::RSLookupDataPtr CAmLookupData::getValueForKey(const TKey & key, const std::map<TKey,CAmLookupData::RSLookupDataPtr> & map)
-{
- mapHandles_t::const_iterator iter = map.find(key);
- if (iter != map.end() )
- {
- return iter->second;
- }
- return NULL;
-}
-
-am_Error_e CAmLookupData::asyncAbort(const am_Handle_s handle, org::genivi::am::RoutingControlProxyBase::AsyncAbortAsyncCallback callback)
-{
- RSLookupDataPtr result = getValueForKey(handle.handle, mMapHandles);
- if(result)
- return result->asyncAbort(handle, callback);
- return (E_UNKNOWN);
-}
-
-am_Error_e CAmLookupData::asyncConnect(const am_Handle_s handle,
- const am_connectionID_t connectionID,
- const am_sourceID_t sourceID,
- const am_sinkID_t sinkID,
- const am_CustomConnectionFormat_t connectionFormat,
- org::genivi::am::RoutingControlProxyBase::AsyncConnectAsyncCallback callback)
-{
- RSLookupDataPtr result = CAmLookupData::getValueForKey(sourceID, mMapSources);
- logInfo(__PRETTY_FUNCTION__, " [sourceID:", sourceID, "]", "[sinkID:", sinkID, "]");
- if(result)
- {
- logInfo(" [isConnected:", result->isConnected(), "]", "[address:", result->getProxy()->getAddress(), "]");
-
- mMapConnections.insert(std::make_pair(connectionID, result));
- mMapHandles.insert(std::make_pair(+handle.handle, result));
- return result->asyncConnect(handle, connectionID, sourceID, sinkID, connectionFormat, callback);
- }
- return (E_UNKNOWN);
-}
-
-am_Error_e CAmLookupData::asyncDisconnect(const am_Handle_s handle,
- const am_connectionID_t connectionID,
- org::genivi::am::RoutingControlProxyBase::AsyncDisconnectAsyncCallback cb)
-{
- RSLookupDataPtr result = CAmLookupData::getValueForKey(connectionID, mMapConnections);
- if(result)
- {
- mMapHandles.insert(std::make_pair(+handle.handle, result));
- return result->asyncDisconnect(handle, connectionID, cb);
- }
- return (E_UNKNOWN);
-}
-
-am_Error_e CAmLookupData::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,
- org::genivi::am::RoutingControlProxyBase::AsyncSetSinkVolumeAsyncCallback cb)
-{
- RSLookupDataPtr result = CAmLookupData::getValueForKey(sinkID, mMapSinks);
- if(result)
- {
- mMapHandles.insert(std::make_pair(+handle.handle, result));
- return result->asyncSetSinkVolume(handle, sinkID, volume, ramp, time, cb);
- }
- return (E_UNKNOWN);
-}
-
-am_Error_e CAmLookupData::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,
- org::genivi::am::RoutingControlProxyBase::AsyncSetSourceVolumeAsyncCallback cb)
-{
- RSLookupDataPtr result = CAmLookupData::getValueForKey(sourceID, mMapSources);
- if(result)
- {
- mMapHandles.insert(std::make_pair(+handle.handle, result));
- return result->asyncSetSourceVolume(handle, sourceID, volume, ramp, time, cb);
- }
- return (E_UNKNOWN);
-}
-
-am_Error_e CAmLookupData::asyncSetSourceState(const am_Handle_s handle,
- const am_sourceID_t sourceID,
- const am_SourceState_e state,
- org::genivi::am::RoutingControlProxyBase::AsyncSetSinkSoundPropertiesAsyncCallback cb)
-{
- RSLookupDataPtr result = CAmLookupData::getValueForKey(sourceID, mMapSources);
- if(result)
- {
- mMapHandles.insert(std::make_pair(+handle.handle, result));
- return result->asyncSetSourceState(handle, sourceID, state, cb);
- }
- return (E_UNKNOWN);
-}
-
-am_Error_e CAmLookupData::asyncSetSinkSoundProperties( const am_Handle_s handle,
- const am_sinkID_t sinkID,
- const std::vector<am_SoundProperty_s>& listSoundProperties,
- org::genivi::am::RoutingControlProxyBase::AsyncSetSinkSoundPropertiesAsyncCallback cb)
-{
- RSLookupDataPtr result = CAmLookupData::getValueForKey(sinkID, mMapSinks);
- if(result)
- {
- mMapHandles.insert(std::make_pair(+handle.handle, result));
- return result->asyncSetSinkSoundProperties(handle, sinkID, listSoundProperties, cb);
- }
- return (E_UNKNOWN);
-}
-
-am_Error_e CAmLookupData::asyncSetSinkSoundProperty( const am_Handle_s handle,
- const am_sinkID_t sinkID,
- const am_SoundProperty_s& soundProperty,
- org::genivi::am::RoutingControlProxyBase::AsyncSetSinkSoundPropertyAsyncCallback cb)
-{
- RSLookupDataPtr result = CAmLookupData::getValueForKey(sinkID, mMapSinks);
- if(result)
- {
- mMapHandles.insert(std::make_pair(+handle.handle, result));
- return result->asyncSetSinkSoundProperty(handle, sinkID, soundProperty, cb);
- }
- return (E_UNKNOWN);
-}
-
-am_Error_e CAmLookupData::asyncSetSourceSoundProperties(const am_Handle_s handle,
- const am_sourceID_t sourceID,
- const std::vector<am_SoundProperty_s>& listSoundProperties,
- org::genivi::am::RoutingControlProxyBase::AsyncSetSourceSoundPropertiesAsyncCallback cb)
-{
- RSLookupDataPtr result = CAmLookupData::getValueForKey(sourceID, mMapSources);
- if(result)
- {
- mMapHandles.insert(std::make_pair(+handle.handle, result));
- return result->asyncSetSourceSoundProperties(handle, sourceID, listSoundProperties, cb);
- }
- return (E_UNKNOWN);
-}
-
-am_Error_e CAmLookupData::asyncSetSourceSoundProperty(const am_Handle_s handle,
- const am_sourceID_t sourceID,
- const am_SoundProperty_s& soundProperty,
- org::genivi::am::RoutingControlProxyBase::AsyncSetSourceSoundPropertyAsyncCallback cb)
-{
- RSLookupDataPtr result = CAmLookupData::getValueForKey(sourceID, mMapSources);
- if(result)
- {
- mMapHandles.insert(std::make_pair(+handle.handle, result));
- return result->asyncSetSourceSoundProperty(handle, sourceID, soundProperty, cb);
- }
- return (E_UNKNOWN);
-}
-
-
-am_Error_e CAmLookupData::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,
- org::genivi::am::RoutingControlProxyBase::AsyncCrossFadeAsyncCallback cb)
-{
- RSLookupDataPtr result = CAmLookupData::getValueForKey(crossfaderID, mMapCrossfaders);
- if(result)
- {
- mMapHandles.insert(std::make_pair(+handle.handle, result));
- return result->asyncCrossFade(handle, crossfaderID, hotSink, rampType, time, cb);
- }
- return (E_UNKNOWN);
-}
-
-am_Error_e CAmLookupData::setDomainState(const am_domainID_t domainID, const am_DomainState_e domainState, org::genivi::am::RoutingControlProxyBase::SetDomainStateAsyncCallback cb)
-{
- RSLookupDataPtr result = CAmLookupData::getValueForKey(domainID, mMapDomains);
- if(result)
- return result->setDomainState(domainID, domainState, cb);
- return (E_UNKNOWN);
-}
-
-
-am_Error_e CAmLookupData::asyncSetVolumes(const am_Handle_s handle,
- const std::vector<am_Volumes_s>& volumes ,
- org::genivi::am::RoutingControlProxyBase::AsyncSetVolumesAsyncCallback cb )
-{
-
- if(volumes.size())
- {
- am_Volumes_s volumeItem = volumes.at(0);
- RSLookupDataPtr result = NULL;
- if(volumeItem.volumeType == VT_SINK)
- result = CAmLookupData::getValueForKey(volumeItem.volumeID.sink, mMapSinks);
- else if(volumeItem.volumeType == VT_SOURCE)
- result = CAmLookupData::getValueForKey(volumeItem.volumeID.source, mMapSources);
- if(result)
- {
- mMapHandles.insert(std::make_pair(+handle.handle, result));
- return result->asyncSetVolumes(handle, volumes, cb);
- }
- }
- return (E_UNKNOWN);
-}
-
-am_Error_e CAmLookupData::asyncSetSinkNotificationConfiguration(const am_Handle_s handle,
- const am_sinkID_t sinkID,
- const am_NotificationConfiguration_s& notificationConfiguration,
- org::genivi::am::RoutingControlProxyBase::AsyncSetSinkNotificationConfigurationAsyncCallback cb)
-{
- RSLookupDataPtr result = CAmLookupData::getValueForKey(sinkID, mMapSinks);
- if(result)
- {
- mMapHandles.insert(std::make_pair(+handle.handle, result));
- return result->asyncSetSinkNotificationConfiguration(handle, sinkID, notificationConfiguration, cb);
- }
- return (E_UNKNOWN);
-}
-
-am_Error_e CAmLookupData::asyncSetSourceNotificationConfiguration(const am_Handle_s handle,
- const am_sourceID_t sourceID,
- const am_NotificationConfiguration_s& notificationConfiguration,
- org::genivi::am::RoutingControlProxyBase::AsyncSetSourceNotificationConfigurationAsyncCallback cb)
-{
- RSLookupDataPtr result = CAmLookupData::getValueForKey(sourceID, mMapSources);
- if(result)
- {
- mMapHandles.insert(std::make_pair(+handle.handle, result));
- return result->asyncSetSourceNotificationConfiguration(handle, sourceID, notificationConfiguration, cb);
- }
- return (E_UNKNOWN);
-}
-
-} /* namespace am */
diff --git a/PluginRoutingInterfaceCAPI/src/CAmRoutingSenderCAPI.cpp b/PluginRoutingInterfaceCAPI/src/CAmRoutingSenderCAPI.cpp
deleted file mode 100644
index 1531613..0000000
--- a/PluginRoutingInterfaceCAPI/src/CAmRoutingSenderCAPI.cpp
+++ /dev/null
@@ -1,378 +0,0 @@
-/**
- * Copyright (c) 2012 BMW
- *
- * \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 <cassert>
-#include <map>
-#include <algorithm>
-#include <string>
-#include <vector>
-#include <set>
-#include "shared/CAmDltWrapper.h"
-#include "CAmRoutingSenderCAPI.h"
-#include "CAmRoutingSenderCommon.h"
-
-
-
-
-namespace am
-{
-DLT_DECLARE_CONTEXT(ctxCommandCAPI)
-
-
-extern "C" IAmRoutingSend* PluginRoutingInterfaceCAPIFactory()
-{
- CAmDltWrapper::instance()->registerContext(ctxCommandCAPI, "DRS", "Common-API Plugin");
- return (new CAmRoutingSenderCAPI(Am_CAPI));
-}
-
-extern "C" void destroyPluginRoutingInterfaceCAPI(IAmRoutingSend* routingSendInterface)
-{
- delete routingSendInterface;
-}
-
-const char * CAmRoutingSenderCAPI::ROUTING_INTERFACE_SERVICE = "local:org.genivi.audiomanager.routinginterface:org.genivi.audiomanager";
-
-CAmRoutingSenderCAPI::CAmRoutingSenderCAPI() :
- mIsServiceStarted(false),
- mLookupData(),
- mpCAmCAPIWrapper(NULL), //
- mpIAmRoutingReceive(NULL),
- mService()
-{
- log(&ctxCommandCAPI, DLT_LOG_INFO, "RoutingSender constructed");
-}
-
-CAmRoutingSenderCAPI::CAmRoutingSenderCAPI(CAmCommonAPIWrapper *aWrapper) :
- mIsServiceStarted(false),
- mLookupData(),
- mpCAmCAPIWrapper(aWrapper), //
- mpIAmRoutingReceive(NULL),
- mService()
-{
- log(&ctxCommandCAPI, DLT_LOG_INFO, "CommandSenderCAPI constructor called");
- assert(mpCAmCAPIWrapper!=NULL);
-}
-
-CAmRoutingSenderCAPI::~CAmRoutingSenderCAPI()
-{
- log(&ctxCommandCAPI, DLT_LOG_INFO, "RoutingSender deallocate");
- CAmDltWrapper::instance()->unregisterContext(ctxCommandCAPI);
- tearDownInterface(mpIAmRoutingReceive);
-}
-
-am_Error_e CAmRoutingSenderCAPI::startService(IAmRoutingReceive* pIAmRoutingReceive)
-{
- log(&ctxCommandCAPI, DLT_LOG_INFO, __PRETTY_FUNCTION__);
- if(!mIsServiceStarted)
- {
- assert(pIAmRoutingReceive);
- mService = std::make_shared<CAmRoutingService>(pIAmRoutingReceive, &mLookupData, mpCAmCAPIWrapper);
- mService->setRoutingReadyAttribute(org::genivi::am::am_RoutingReady_e::RR_UNKNOWN);
- //Registers the service
- if( false == mpCAmCAPIWrapper->registerStub(mService, CAmRoutingSenderCAPI::ROUTING_INTERFACE_SERVICE) )
- {
- return (E_NOT_POSSIBLE);
- }
- mIsServiceStarted = true;
- }
- return (E_OK);
-}
-
-am_Error_e CAmRoutingSenderCAPI::startupInterface(IAmRoutingReceive* pIAmRoutingReceive)
-{
- log(&ctxCommandCAPI, DLT_LOG_INFO, __PRETTY_FUNCTION__);
- mpIAmRoutingReceive = pIAmRoutingReceive;
- return startService(mpIAmRoutingReceive);
-}
-
-am_Error_e CAmRoutingSenderCAPI::tearDownInterface(IAmRoutingReceive*)
-{
- log(&ctxCommandCAPI, DLT_LOG_INFO, __PRETTY_FUNCTION__);
- if(mpCAmCAPIWrapper)
- {
- if(mIsServiceStarted)
- {
- mIsServiceStarted = false;
- mpCAmCAPIWrapper->unregisterStub(CAmRoutingSenderCAPI::ROUTING_INTERFACE_SERVICE);
- mService.reset();
- }
- return (E_OK);
- }
- return (E_NOT_POSSIBLE);
-}
-
-void CAmRoutingSenderCAPI::getInterfaceVersion(std::string & version) const
-{
- version = RoutingSendVersion;
-}
-
-void CAmRoutingSenderCAPI::setRoutingReady(const uint16_t handle)
-{
- assert(mpIAmRoutingReceive);
- mService->setHandle(handle);
-
- log(&ctxCommandCAPI, DLT_LOG_INFO, "sending routingReady signal");
- mService->setRoutingReadyAttribute(org::genivi::am::am_RoutingReady_e::RR_READY);
-}
-
-void CAmRoutingSenderCAPI::setRoutingRundown(const uint16_t handle)
-{
- log(&ctxCommandCAPI, DLT_LOG_INFO, __PRETTY_FUNCTION__);
- assert(mpIAmRoutingReceive);
- mService->setRoutingReadyAttribute(org::genivi::am::am_RoutingReady_e::RR_RUNDOWN);
- mService->gotRundown(mLookupData.numberOfDomains(),handle);
-}
-
-void CAmRoutingSenderCAPI::checkSourceLookup(const am_sourceID_t id)
-{
- am_domainID_t domainID;
- am_Error_e result = mpIAmRoutingReceive->getDomainOfSource(id, domainID);
- if(E_OK==result)
- mLookupData.addSourceLookup(id, domainID);
- else
- logError("checkSinkLookup addSourceLookup error:", result);
-}
-
-void CAmRoutingSenderCAPI::checkSinkLookup(const am_sinkID_t id)
-{
- am_domainID_t domainID;
- am_Error_e result = mpIAmRoutingReceive->getDomainOfSink(id, domainID);
- if(E_OK==result)
- mLookupData.addSinkLookup(id, domainID);
- else
- logError("checkSinkLookup addSinkLookup error:", result);
-}
-
-am_Error_e CAmRoutingSenderCAPI::asyncAbort(const am_Handle_s handle)
-{
- log(&ctxCommandCAPI, DLT_LOG_INFO, "CAmRoutingSenderCAPI::asyncAbort called");
-
- return mLookupData.asyncAbort(handle,[](const CommonAPI::CallStatus& callStatus){
- log(&ctxCommandCAPI, DLT_LOG_INFO, __PRETTY_FUNCTION__, "Response with call status:", static_cast<int16_t>(callStatus));
- });
-}
-
-am_Error_e CAmRoutingSenderCAPI::asyncConnect(const am_Handle_s handle, const am_connectionID_t connectionID, const am_sourceID_t sourceID, const am_sinkID_t sinkID, const am_CustomConnectionFormat_t connectionFormat)
-{
- log(&ctxCommandCAPI, DLT_LOG_INFO, "CAmRoutingSenderCAPI::asyncConnect called");
- checkSourceLookup(sourceID);
- checkSinkLookup(sinkID);
- return mLookupData.asyncConnect(handle,connectionID, sourceID, sinkID, connectionFormat, [&,handle,connectionID](const CommonAPI::CallStatus& callStatus){
- log(&ctxCommandCAPI, DLT_LOG_INFO, __PRETTY_FUNCTION__, "Response with call status:", static_cast<int16_t>(callStatus));
- if (callStatus != CommonAPI::CallStatus::SUCCESS)
- {
- org::genivi::am::am_Handle_s dst;
- CAmConvertAM2CAPI(handle, dst);
- mService->ackConnect(dst, connectionID, org::genivi::am::am_Error_e::E_NON_EXISTENT);
- }
- });
-}
-
-am_Error_e CAmRoutingSenderCAPI::asyncDisconnect(const am_Handle_s handle, const am_connectionID_t connectionID)
-{
- log(&ctxCommandCAPI, DLT_LOG_INFO, "CAmRoutingSenderCAPI::asyncDisconnect called");
- return mLookupData.asyncDisconnect(handle,connectionID, [&, handle, connectionID](const CommonAPI::CallStatus& callStatus){
- log(&ctxCommandCAPI, DLT_LOG_INFO, __PRETTY_FUNCTION__, "Response with call status:", static_cast<int16_t>(callStatus));
- if (callStatus != CommonAPI::CallStatus::SUCCESS)
- {
- org::genivi::am::am_Handle_s dst;
- CAmConvertAM2CAPI(handle, dst);
- mService->ackDisconnect(dst, connectionID, org::genivi::am::am_Error_e::E_NON_EXISTENT);
- }
- });
-}
-
-am_Error_e CAmRoutingSenderCAPI::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(&ctxCommandCAPI, DLT_LOG_INFO, "CAmRoutingSenderCAPI::asyncSetSinkVolume called");
- checkSinkLookup(sinkID);
- return mLookupData.asyncSetSinkVolume(handle,sinkID, volume, ramp, time, [&, handle, volume](const CommonAPI::CallStatus& callStatus){
- log(&ctxCommandCAPI, DLT_LOG_INFO, __PRETTY_FUNCTION__, "Response with call status:", static_cast<int16_t>(callStatus));
- if (callStatus != CommonAPI::CallStatus::SUCCESS)
- {
- org::genivi::am::am_Handle_s dst;
- CAmConvertAM2CAPI(handle, dst);
- mService->ackSetSinkVolumeChange(dst, volume, org::genivi::am::am_Error_e::E_NON_EXISTENT);
- }
- });
-}
-
-am_Error_e CAmRoutingSenderCAPI::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(&ctxCommandCAPI, DLT_LOG_INFO, "CAmRoutingSenderCAPI::asyncSetSourceVolume called");
- checkSourceLookup(sourceID);
- return mLookupData.asyncSetSourceVolume(handle,sourceID, volume, ramp, time, [&, handle, volume](const CommonAPI::CallStatus& callStatus){
- log(&ctxCommandCAPI, DLT_LOG_INFO, __PRETTY_FUNCTION__, "Response with call status:", static_cast<int16_t>(callStatus));
- if (callStatus != CommonAPI::CallStatus::SUCCESS)
- {
- org::genivi::am::am_Handle_s dst;
- CAmConvertAM2CAPI(handle, dst);
- mService->ackSetSourceVolumeChange(dst, volume, org::genivi::am::am_Error_e::E_NON_EXISTENT);
- }
- });
-}
-
-am_Error_e CAmRoutingSenderCAPI::asyncSetSourceState(const am_Handle_s handle, const am_sourceID_t sourceID, const am_SourceState_e state)
-{
- log(&ctxCommandCAPI, DLT_LOG_INFO, "CAmRoutingSenderCAPI::asyncSetSourceState called");
- checkSourceLookup(sourceID);
- return mLookupData.asyncSetSourceState(handle,sourceID, state,[&, handle](const CommonAPI::CallStatus& callStatus){
- log(&ctxCommandCAPI, DLT_LOG_INFO, __PRETTY_FUNCTION__, "Response with call status:", static_cast<int16_t>(callStatus));
- if (callStatus != CommonAPI::CallStatus::SUCCESS)
- {
- org::genivi::am::am_Handle_s dst;
- CAmConvertAM2CAPI(handle, dst);
- mService->ackSetSourceState(dst, org::genivi::am::am_Error_e::E_NON_EXISTENT);
- }
- });
-}
-
-am_Error_e CAmRoutingSenderCAPI::asyncSetSinkSoundProperties(const am_Handle_s handle, const am_sinkID_t sinkID, const std::vector<am_SoundProperty_s>& listSoundProperties)
-{
- log(&ctxCommandCAPI, DLT_LOG_INFO, "CAmRoutingSenderCAPI::asyncSetSinkSoundProperties called");
- checkSinkLookup(sinkID);
- return mLookupData.asyncSetSinkSoundProperties(handle,sinkID, listSoundProperties, [&, handle](const CommonAPI::CallStatus& callStatus){
- log(&ctxCommandCAPI, DLT_LOG_INFO, __PRETTY_FUNCTION__, "Response with call status:", static_cast<int16_t>(callStatus));
- if (callStatus != CommonAPI::CallStatus::SUCCESS)
- {
- org::genivi::am::am_Handle_s dst;
- CAmConvertAM2CAPI(handle, dst);
- mService->ackSetSinkSoundProperties(dst, org::genivi::am::am_Error_e::E_NON_EXISTENT);
- }
- });
-}
-
-am_Error_e CAmRoutingSenderCAPI::asyncSetSinkSoundProperty(const am_Handle_s handle, const am_sinkID_t sinkID, const am_SoundProperty_s& soundProperty)
-{
- log(&ctxCommandCAPI, DLT_LOG_INFO, "CAmRoutingSenderCAPI::asyncSetSinkSoundProperty called");
- checkSinkLookup(sinkID);
- return mLookupData.asyncSetSinkSoundProperty(handle, sinkID, soundProperty, [&, handle](const CommonAPI::CallStatus& callStatus){
- log(&ctxCommandCAPI, DLT_LOG_INFO, __PRETTY_FUNCTION__, "Response with call status:", static_cast<int16_t>(callStatus));
- if (callStatus != CommonAPI::CallStatus::SUCCESS)
- {
- org::genivi::am::am_Handle_s dst;
- CAmConvertAM2CAPI(handle, dst);
- mService->ackSetSinkSoundProperty(dst, org::genivi::am::am_Error_e::E_NON_EXISTENT);
- }
- });
-}
-
-am_Error_e CAmRoutingSenderCAPI::asyncSetSourceSoundProperties(const am_Handle_s handle, const am_sourceID_t sourceID, const std::vector<am_SoundProperty_s>& listSoundProperties)
-{
- log(&ctxCommandCAPI, DLT_LOG_INFO, "CAmRoutingSenderCAPI::asyncSetSourceSoundProperties called");
- checkSourceLookup(sourceID);
- return mLookupData.asyncSetSourceSoundProperties(handle, sourceID, listSoundProperties, [&, handle](const CommonAPI::CallStatus& callStatus){
- log(&ctxCommandCAPI, DLT_LOG_INFO, __PRETTY_FUNCTION__, "Response with call status:", static_cast<int16_t>(callStatus));
- if (callStatus != CommonAPI::CallStatus::SUCCESS)
- {
- org::genivi::am::am_Handle_s dst;
- CAmConvertAM2CAPI(handle, dst);
- mService->ackSetSourceSoundProperties(dst, org::genivi::am::am_Error_e::E_NON_EXISTENT);
- }
- });
-}
-
-am_Error_e CAmRoutingSenderCAPI::asyncSetSourceSoundProperty(const am_Handle_s handle, const am_sourceID_t sourceID, const am_SoundProperty_s& soundProperty)
-{
- log(&ctxCommandCAPI, DLT_LOG_INFO, "CAmRoutingSenderCAPI::asyncSetSourceSoundProperty called");
- checkSourceLookup(sourceID);
- return mLookupData.asyncSetSourceSoundProperty(handle, sourceID, soundProperty, [&, handle](const CommonAPI::CallStatus& callStatus){
- log(&ctxCommandCAPI, DLT_LOG_INFO, __PRETTY_FUNCTION__, "Response with call status:", static_cast<int16_t>(callStatus));
- if (callStatus != CommonAPI::CallStatus::SUCCESS)
- {
- org::genivi::am::am_Handle_s dst;
- CAmConvertAM2CAPI(handle, dst);
- mService->ackSetSourceSoundProperty(dst, org::genivi::am::am_Error_e::E_NON_EXISTENT);
- }
- });
-}
-
-am_Error_e CAmRoutingSenderCAPI::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)
-{
- return mLookupData.asyncCrossFade(handle, crossfaderID, hotSink, rampType, time, [&, handle, hotSink](const CommonAPI::CallStatus& callStatus){
- log(&ctxCommandCAPI, DLT_LOG_INFO, __PRETTY_FUNCTION__, "Response with call status:", static_cast<int16_t>(callStatus));
- if (callStatus != CommonAPI::CallStatus::SUCCESS)
- {
- org::genivi::am::am_Handle_s dst;
- CAmConvertAM2CAPI(handle, dst);
- mService->ackCrossFading(dst, (org::genivi::am::am_HotSink_e)hotSink, org::genivi::am::am_Error_e::E_NON_EXISTENT);
- }
- });
-}
-
-am_Error_e CAmRoutingSenderCAPI::setDomainState(const am_domainID_t domainID, const am_DomainState_e domainState)
-{
- log(&ctxCommandCAPI, DLT_LOG_INFO, "CAmRoutingSenderCAPI::setDomainState called");
- return mLookupData.setDomainState(domainID, domainState, [](const CommonAPI::CallStatus& callStatus, org::genivi::am::am_Error_e error){
- log(&ctxCommandCAPI, DLT_LOG_INFO, __PRETTY_FUNCTION__, "Response with call status:", static_cast<int16_t>(callStatus),"Error",static_cast<am_Error_e>(error));
- });
-}
-
-am_Error_e CAmRoutingSenderCAPI::returnBusName(std::string& BusName) const
-{
- BusName = CAmLookupData::BUS_NAME;
- return (E_OK);
-}
-
-am_Error_e CAmRoutingSenderCAPI::asyncSetVolumes(const am_Handle_s handle, const std::vector<am_Volumes_s>& volumes)
-{
- log(&ctxCommandCAPI, DLT_LOG_INFO, "CAmRoutingSenderCAPI::asyncSetVolumes called");
- return mLookupData.asyncSetVolumes(handle, volumes, [&, handle, volumes](const CommonAPI::CallStatus& callStatus){
- log(&ctxCommandCAPI, DLT_LOG_INFO, __PRETTY_FUNCTION__, "Response with call status:", static_cast<int16_t>(callStatus));
- if (callStatus != CommonAPI::CallStatus::SUCCESS)
- {
- org::genivi::am::am_Handle_s dst;
- CAmConvertAM2CAPI(handle, dst);
- org::genivi::am::am_Volumes_L list;
- CAmConvertAMVector2CAPI(volumes, list);
- mService->ackSetVolumes(dst, list, org::genivi::am::am_Error_e::E_NON_EXISTENT);
- }
- });
-}
-
-am_Error_e CAmRoutingSenderCAPI::asyncSetSinkNotificationConfiguration(const am_Handle_s handle, const am_sinkID_t sinkID, const am_NotificationConfiguration_s& nc)
-{
- log(&ctxCommandCAPI, DLT_LOG_INFO, "CAmRoutingSenderCAPI::asyncSetSinkNotificationConfiguration called");
- checkSinkLookup(sinkID);
- return mLookupData.asyncSetSinkNotificationConfiguration(handle, sinkID, nc, [&, handle](const CommonAPI::CallStatus& callStatus){
- log(&ctxCommandCAPI, DLT_LOG_INFO, __PRETTY_FUNCTION__, "Response with call status:", static_cast<int16_t>(callStatus));
- if (callStatus != CommonAPI::CallStatus::SUCCESS)
- {
- org::genivi::am::am_Handle_s dst;
- CAmConvertAM2CAPI(handle, dst);
- mService->ackSinkNotificationConfiguration(dst, org::genivi::am::am_Error_e::E_NON_EXISTENT);
- }
- });
-}
-
-am_Error_e CAmRoutingSenderCAPI::asyncSetSourceNotificationConfiguration(const am_Handle_s handle, const am_sourceID_t sourceID, const am_NotificationConfiguration_s& nc)
-{
- log(&ctxCommandCAPI, DLT_LOG_INFO, "CAmRoutingSenderCAPI::asyncSetSourceNotificationConfiguration called");
- checkSourceLookup(sourceID);
- return mLookupData.asyncSetSourceNotificationConfiguration(handle, sourceID, nc, [&, handle](const CommonAPI::CallStatus& callStatus){
- log(&ctxCommandCAPI, DLT_LOG_INFO, __PRETTY_FUNCTION__, "Response with call status:", static_cast<int16_t>(callStatus));
- if (callStatus != CommonAPI::CallStatus::SUCCESS)
- {
- org::genivi::am::am_Handle_s dst;
- CAmConvertAM2CAPI(handle, dst);
- mService->ackSourceNotificationConfiguration(dst, org::genivi::am::am_Error_e::E_NON_EXISTENT);
- }
- });
-}
-
-}
-
diff --git a/PluginRoutingInterfaceCAPI/src/CAmRoutingSenderCommon.cpp b/PluginRoutingInterfaceCAPI/src/CAmRoutingSenderCommon.cpp
deleted file mode 100644
index be1bdfc..0000000
--- a/PluginRoutingInterfaceCAPI/src/CAmRoutingSenderCommon.cpp
+++ /dev/null
@@ -1,318 +0,0 @@
-/**
- * Copyright (c) 2012 BMW
- *
- * \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 "CAmRoutingSenderCommon.h"
-
-/**
- * Utility functions
- */
-
-void CAmConvertCAPI2AM(const org::genivi::am::am_Domain_s & source, am::am_Domain_s & destination)
-{
- destination.domainID = source.domainID;
- destination.name = source.name;
- destination.busname = source.busname;
- destination.nodename = source.nodename;
- destination.early = source.early;
- destination.complete = source.complete;
- destination.state = static_cast<am::am_DomainState_e>(source.state);
-}
-
-void CAmConvertCAPI2AM(const org::genivi::am::am_SoundProperty_s & source, am::am_SoundProperty_s & destination)
-{
- destination.type = static_cast<am::am_CustomSoundPropertyType_t>(source.type);
- destination.value = source.value;
-}
-
-void CAmConvertCAPIVector2AM(const std::vector<org::genivi::am::am_SoundProperty_s> & source, std::vector<am::am_SoundProperty_s> & destination)
-{
- am::am_SoundProperty_s soundProp;
- destination.clear();
- for(std::vector<org::genivi::am::am_SoundProperty_s>::const_iterator iter = source.begin(); iter!=source.end(); ++iter)
- {
- CAmConvertCAPI2AM(*iter, soundProp);
- destination.push_back(soundProp);
- }
-}
-
-void CAmConvertCAPI2AM(const org::genivi::am::am_MainSoundProperty_s & source, am::am_MainSoundProperty_s & destination)
-{
- destination.type = static_cast<am::am_CustomMainSoundPropertyType_t>(source.type);
- destination.value = source.value;
-}
-
-
-void CAmConvertCAPI2AM(const org::genivi::am::am_NotificationPayload_s & source, am::am_NotificationPayload_s & destination)
-{
- destination.type = static_cast<am::am_CustomNotificationType_t>(source.type);
- destination.value = source.value;
-}
-
-void CAmConvertCAPIVector2AM(const std::vector<org::genivi::am::am_Volumes_s> & source, std::vector<am::am_Volumes_s> & destination)
-{
- destination.clear();
- for(std::vector<org::genivi::am::am_Volumes_s>::const_iterator iter = source.begin(); iter!=source.end(); ++iter)
- {
- am::am_Volumes_s volume;
- CAmConvertCAPI2AM(*iter, volume);
- destination.push_back(volume);
- }
-}
-
-void CAmConvertCAPIVector2AM(const std::vector<org::genivi::am::am_MainSoundProperty_s> & source, std::vector<am::am_MainSoundProperty_s> & destination)
-{
- am::am_MainSoundProperty_s soundProp;
- destination.clear();
- for(std::vector<org::genivi::am::am_MainSoundProperty_s>::const_iterator iter = source.begin(); iter!=source.end(); ++iter)
- {
- CAmConvertCAPI2AM(*iter, soundProp);
- destination.push_back(soundProp);
- }
-}
-
-void CAmConvertCAPI2AM(const org::genivi::am::am_NotificationConfiguration_s & source, am::am_NotificationConfiguration_s & destination)
-{
- destination.type = static_cast<am::am_CustomNotificationType_t>(source.type);
- destination.status = static_cast<am::am_NotificationStatus_e>(source.status);
- destination.parameter = source.parameter;
-}
-
-void CAmConvertCAPIVector2AM(const std::vector<org::genivi::am::am_NotificationConfiguration_s> & source, std::vector<am::am_NotificationConfiguration_s> & destination)
-{
- am::am_NotificationConfiguration_s soundProp;
- destination.clear();
- for(std::vector<org::genivi::am::am_NotificationConfiguration_s>::const_iterator iter = source.begin(); iter!=source.end(); ++iter)
- {
- CAmConvertCAPI2AM(*iter, soundProp);
- destination.push_back(soundProp);
- }
-}
-
-void CAmConvertCAPIVector2AM(const std::vector<org::genivi::am::am_CustomConnectionFormat_t> & source, std::vector<am::am_CustomConnectionFormat_t> & destination)
-{
- destination.clear();
- for(std::vector<org::genivi::am::am_CustomConnectionFormat_t>::const_iterator iter = source.begin(); iter!=source.end(); ++iter)
- destination.push_back(static_cast<am::am_CustomConnectionFormat_t>(*iter));
-}
-
-
-
-void CAmConvertCAPI2AM(const org::genivi::am::am_Source_s & source, am::am_Source_s & destination)
-{
- destination.sourceID = source.sourceID;
- destination.domainID = source.domainID;
- destination.name = source.name;
- destination.sourceClassID = source.sourceClassID;
- destination.sourceState = static_cast<am::am_SourceState_e>(source.sourceState);
- destination.volume = source.volume;
- destination.visible = source.visible;
- CAmConvertCAPI2AM(source.available, destination.available);
- destination.interruptState = static_cast<am::am_InterruptState_e>(source.interruptState);
- CAmConvertCAPIVector2AM(source.listSoundProperties, destination.listSoundProperties);
- CAmConvertCAPIVector2AM(source.listConnectionFormats, destination.listConnectionFormats);
- CAmConvertCAPIVector2AM(source.listMainSoundProperties, destination.listMainSoundProperties);
- CAmConvertCAPIVector2AM(source.listNotificationConfigurations, destination.listNotificationConfigurations);
- CAmConvertCAPIVector2AM(source.listMainNotificationConfigurations, destination.listMainNotificationConfigurations);
-}
-
-void CAmConvertCAPI2AM(const org::genivi::am::am_Sink_s & source, am::am_Sink_s & destination)
-{
- destination.sinkID = source.sinkID;
- destination.domainID = source.domainID;
- destination.name = source.name;
- destination.sinkClassID = source.sinkClassID;
- destination.muteState = static_cast<am::am_MuteState_e>(source.muteState);
- destination.volume = source.volume;
- destination.visible = source.visible;
- destination.mainVolume = source.mainVolume;
- CAmConvertCAPI2AM(source.available, destination.available);
- CAmConvertCAPIVector2AM(source.listSoundProperties, destination.listSoundProperties);
- CAmConvertCAPIVector2AM(source.listConnectionFormats, destination.listConnectionFormats);
- CAmConvertCAPIVector2AM(source.listMainSoundProperties, destination.listMainSoundProperties);
- CAmConvertCAPIVector2AM(source.listNotificationConfigurations, destination.listNotificationConfigurations);
- CAmConvertCAPIVector2AM(source.listMainNotificationConfigurations, destination.listMainNotificationConfigurations);
-}
-
-void CAmConvertCAPI2AM(const org::genivi::am::am_Volumes_s & source, am::am_Volumes_s & destination)
-{
- CAmConvertCAPI2AM(source.volumeID, destination.volumeID);
- destination.volume = source.volume;
- destination.time = source.time;
- destination.volumeType = static_cast<am::am_VolumeType_e>(source.volumeType);
- destination.ramp = static_cast<am::am_CustomRampType_t>(source.ramp);
-}
-
-
-void CAmConvertCAPI2AM(const org::genivi::am::am_Crossfader_s & source, am::am_Crossfader_s & destination)
-{
- destination.crossfaderID = source.crossfaderID;
- destination.sinkID_A = source.sinkID_A;
- destination.sinkID_B = source.sinkID_B;
- destination.name = source.name;
- destination.sourceID = source.sourceID;
- destination.hotSink = static_cast<am::am_HotSink_e>(source.hotSink);
-}
-
-
-void CAmConvertCAPI2AM(const org::genivi::am::am_Gateway_s & source, am::am_Gateway_s & destination)
-{
- destination.sinkID = source.sinkID;
- destination.gatewayID = source.gatewayID;
- destination.name = source.name;
- destination.sourceID = source.sourceID;
- destination.domainSinkID = source.domainSinkID;
- destination.domainSourceID = source.domainSourceID;
- destination.controlDomainID = source.controlDomainID;
- CAmConvertCAPIVector2AM(source.listSourceFormats, destination.listSourceFormats);
- CAmConvertCAPIVector2AM(source.listSinkFormats, destination.listSinkFormats);
- destination.convertionMatrix = source.convertionMatrix;
-}
-
-void CAmConvertCAPI2AM(const org::genivi::am::am_Converter_s & source, am::am_Converter_s & destination)
-{
- destination.sinkID = source.sinkID;
- destination.converterID = source.converterID;
- destination.name = source.name;
- destination.sourceID = source.sourceID;
- destination.domainID = source.domainID;
- CAmConvertCAPIVector2AM(source.listSourceFormats, destination.listSourceFormats);
- CAmConvertCAPIVector2AM(source.listSinkFormats, destination.listSinkFormats);
- destination.convertionMatrix = source.convertionMatrix;
-}
-
-void CAmConvertCAPI2AM(const org::genivi::am::am_EarlyData_u & source, am::am_EarlyData_u & destination)
-{
- if(source.isType<org::genivi::am::am_volume_t>())
- {
- am_volume_t value = static_cast<am_volume_t>(source.get<org::genivi::am::am_volume_t>());
- destination.volume = value;
- }
- else if(source.isType<org::genivi::am::am_SoundProperty_s>())
- {
- org::genivi::am::am_SoundProperty_s value = source.get<org::genivi::am::am_SoundProperty_s>();
- am_SoundProperty_s converted;
- CAmConvertCAPI2AM(value, converted);
- destination.soundProperty = converted;
- }
-}
-
-void CAmConvertCAPI2AM(const org::genivi::am::am_DataType_u & source, am::am_DataType_u & destination)
-{
- if(source.isType<org::genivi::am::am_sinkID_t>())
- {
- am_sinkID_t value = static_cast<am_sinkID_t>(source.get<org::genivi::am::am_sinkID_t>());
- destination.sink = value;
- }
- else if(source.isType<org::genivi::am::am_sourceID_t>())
- {
- am_sourceID_t value = static_cast<am_sourceID_t>(source.get<org::genivi::am::am_sourceID_t>());
- destination.source = value;
- }
-}
-
-void CAmConvertCAPI2AM(const org::genivi::am::am_EarlyData_s & source, am::am_EarlyData_s & destination)
-{
- CAmConvertCAPI2AM(source.data, destination.data);
- CAmConvertCAPI2AM(source.sinksource, destination.sinksource);
- destination.type = static_cast<am_EarlyDataType_e>(source.type);
-}
-
-
-void CAmConvertCAPI2AM(const org::genivi::am::am_Availability_s & source, am_Availability_s & destination)
-{
- destination.availability = static_cast<am_Availability_e>(source.availability);
- destination.availabilityReason = static_cast<am_CustomAvailabilityReason_t>(source.availabilityReason);
-}
-
-void CAmConvertCAPI2AM(const org::genivi::am::am_Handle_s& source, am_Handle_s& destination)
-{
- destination.handle = static_cast<int16_t>(source.handle);
- destination.handleType = static_cast<am_Handle_e>(source.handleType);
-}
-
-void CAmConvertAM2CAPI(const am_Availability_s & source, org::genivi::am::am_Availability_s & destination)
-{
- destination.availability = static_cast<org::genivi::am::am_Availability_e>(source.availability);
- destination.availabilityReason = static_cast<org::genivi::am::am_CustomAvailabilityReason_t>(source.availabilityReason);
-}
-
-void CAmConvertAM2CAPI(const am::am_SoundProperty_s & source, org::genivi::am::am_SoundProperty_s & destination)
-{
- destination.type = static_cast<org::genivi::am::am_CustomSoundPropertyType_t>(source.type);
- destination.value = source.value;
-}
-
-extern void CAmConvertAM2CAPI(const am::am_Handle_s& source,
- org::genivi::am::am_Handle_s& destination)
-{
- destination.handle = static_cast<uint16_t>(source.handle);
- destination.handleType = static_cast<org::genivi::am::am_Handle_e>(source.handleType);
-}
-
-
-void CAmConvertAM2CAPI(const am::am_NotificationConfiguration_s & source, org::genivi::am::am_NotificationConfiguration_s & destination)
-{
- destination.type = static_cast<org::genivi::am::am_CustomNotificationType_t>(source.type);
- destination.status = static_cast<org::genivi::am::am_NotificationStatus_e>(source.status);
- destination.parameter = source.parameter;
-}
-
-void CAmConvertAM2CAPI(const am::am_Volumes_s & source, org::genivi::am::am_Volumes_s & destination)
-{
- if(source.volumeType == VT_SINK)
- destination.volumeID = org::genivi::am::am_DataType_u(static_cast<org::genivi::am::am_sinkID_t>(source.volumeID.sink));
- else if(source.volumeType == VT_SOURCE)
- destination.volumeID = org::genivi::am::am_DataType_u(static_cast<org::genivi::am::am_sourceID_t>(source.volumeID.source));
- destination.volumeType = static_cast<org::genivi::am::am_VolumeType_e>(source.volumeType);
- destination.volume = static_cast<org::genivi::am::am_volume_t>(source.volume);
- destination.ramp = static_cast<org::genivi::am::am_CustomRampType_t>(source.ramp);
- destination.time = static_cast<org::genivi::am::am_time_t>(source.time);
-}
-
-void CAmConvertAMVector2CAPI(const std::vector<am::am_Volumes_s> & source, org::genivi::am::am_Volumes_L & destination)
-{
- destination.clear();
- for(std::vector<am::am_Volumes_s>::const_iterator iter = source.begin(); iter!=source.end(); ++iter)
- {
- org::genivi::am::am_Volumes_s volume;
- CAmConvertAM2CAPI(*iter, volume);
- destination.push_back(volume);
- }
-}
-
-void CAmConvertCAPIVector2AM(const org::genivi::am::am_EarlyData_L& source,std::vector<am::am_EarlyData_s>& destination)
-{
- destination.clear();
- for (org::genivi::am::am_EarlyData_L::const_iterator iter = source.begin(); iter!=source.end(); ++iter)
- {
- am_EarlyData_s earlyData;
- CAmConvertCAPI2AM(*iter,earlyData);
- destination.push_back(earlyData);
- }
-}
-
-void CAmConvertAMVector2CAPI(const std::vector<am::am_SoundProperty_s> & source, std::vector<org::genivi::am::am_SoundProperty_s> & destination)
-{
- org::genivi::am::am_SoundProperty_s soundProp;
- destination.clear();
- for(std::vector<am::am_SoundProperty_s>::const_iterator iter = source.begin(); iter!=source.end(); ++iter)
- {
- CAmConvertAM2CAPI(*iter, soundProp);
- destination.push_back(soundProp);
- }
-}
diff --git a/PluginRoutingInterfaceCAPI/src/CAmRoutingService.cpp b/PluginRoutingInterfaceCAPI/src/CAmRoutingService.cpp
deleted file mode 100644
index 2ee2f44..0000000
--- a/PluginRoutingInterfaceCAPI/src/CAmRoutingService.cpp
+++ /dev/null
@@ -1,422 +0,0 @@
-/**
- * Copyright (c) 2012 BMW
- *
- * \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 <memory>
-#include <assert.h>
-#include <algorithm>
-#include "CAmRoutingSenderCommon.h"
-#include "shared/CAmCommonAPIWrapper.h"
-#include "CAmRoutingService.h"
-
-
-namespace am {
-
-CAmRoutingService::CAmRoutingService():mpCAmCAPIWrapper(NULL), mpIAmRoutingReceive(NULL), mpLookpData(NULL), mNumberDomains(0), mHandle(0), mReady(false) {
- // TODO Auto-generated constructor stub
-
-}
-
-CAmRoutingService::CAmRoutingService(IAmRoutingReceive *aReceiver, CAmLookupData* aLookpData, CAmCommonAPIWrapper *aCAPIWrapper):
- mpCAmCAPIWrapper(aCAPIWrapper), mpIAmRoutingReceive(aReceiver), mpLookpData(aLookpData), mNumberDomains(0), mHandle(0), mReady(false) {
- // TODO Auto-generated constructor stub
-
-}
-
-CAmRoutingService::~CAmRoutingService() {
- // TODO Auto-generated destructor stub
-}
-
-void CAmRoutingService::ackConnect(org::genivi::am::am_Handle_s handle, org::genivi::am::am_connectionID_t connectionID, org::genivi::am::am_Error_e error) {
- assert(mpIAmRoutingReceive);
- assert(mpLookpData);
- am_Handle_s handle_s;
- CAmConvertCAPI2AM(handle,handle_s);
- mpIAmRoutingReceive->ackConnect(handle_s, static_cast<am_connectionID_t>(connectionID), static_cast<am_Error_e>(error));
- mpLookpData->removeHandle(handle_s);
-}
-
-void CAmRoutingService::ackDisconnect(org::genivi::am::am_Handle_s handle , org::genivi::am::am_connectionID_t connectionID, org::genivi::am::am_Error_e error) {
- assert(mpIAmRoutingReceive);
- assert(mpLookpData);
- am_Handle_s handle_s;
- CAmConvertCAPI2AM(handle,handle_s);
- mpIAmRoutingReceive->ackDisconnect(handle_s, static_cast<am_connectionID_t>(connectionID), static_cast<am_Error_e>(error));
- mpLookpData->removeHandle(handle_s);
- mpLookpData->removeConnectionLookup(connectionID);
-}
-
-void CAmRoutingService::ackSetSinkVolumeChange(org::genivi::am::am_Handle_s handle , org::genivi::am::am_volume_t volume, org::genivi::am::am_Error_e error) {
- assert(mpIAmRoutingReceive);
- assert(mpLookpData);
- am_Handle_s handle_s;
- CAmConvertCAPI2AM(handle,handle_s);
- mpIAmRoutingReceive->ackSetSinkVolumeChange(handle_s, volume, static_cast<am_Error_e>(error));
- mpLookpData->removeHandle(handle_s);
-}
-
-void CAmRoutingService::ackSetSourceVolumeChange(org::genivi::am::am_Handle_s handle, org::genivi::am::am_volume_t volume, org::genivi::am::am_Error_e error){
- assert(mpIAmRoutingReceive);
- assert(mpLookpData);
- am_Handle_s handle_s;
- CAmConvertCAPI2AM(handle,handle_s);
- mpIAmRoutingReceive->ackSetSourceVolumeChange(handle_s, volume, static_cast<am_Error_e>(error));
- mpLookpData->removeHandle(handle_s);
-}
-
-void CAmRoutingService::ackSetSourceState(org::genivi::am::am_Handle_s handle, org::genivi::am::am_Error_e error) {
- assert(mpIAmRoutingReceive);
- assert(mpLookpData);
- am_Handle_s handle_s;
- CAmConvertCAPI2AM(handle,handle_s);
- mpIAmRoutingReceive->ackSetSourceState(handle_s,static_cast<am_Error_e>(error));
- mpLookpData->removeHandle(handle_s);
-}
-
-void CAmRoutingService::ackSetSinkSoundProperties(org::genivi::am::am_Handle_s handle, org::genivi::am::am_Error_e error){
- assert(mpIAmRoutingReceive);
- assert(mpLookpData);
- am_Handle_s handle_s;
- CAmConvertCAPI2AM(handle,handle_s);
- mpIAmRoutingReceive->ackSetSinkSoundProperties(handle_s, static_cast<am_Error_e>(error));
- mpLookpData->removeHandle(handle_s);
-}
-
-void CAmRoutingService::ackSetSinkSoundProperty(org::genivi::am::am_Handle_s handle, org::genivi::am::am_Error_e error) {
- assert(mpIAmRoutingReceive);
- assert(mpLookpData);
- am_Handle_s handle_s;
- CAmConvertCAPI2AM(handle,handle_s);
- mpIAmRoutingReceive->ackSetSinkSoundProperty(handle_s, static_cast<am_Error_e>(error));
- mpLookpData->removeHandle(handle_s);
-}
-
-void CAmRoutingService::ackSetSourceSoundProperties(org::genivi::am::am_Handle_s handle, org::genivi::am::am_Error_e error) {
- assert(mpIAmRoutingReceive);
- assert(mpLookpData);
- am_Handle_s handle_s;
- CAmConvertCAPI2AM(handle,handle_s);
- mpIAmRoutingReceive->ackSetSourceSoundProperties(handle_s, static_cast<am_Error_e>(error));
- mpLookpData->removeHandle(handle_s);
-}
-
-void CAmRoutingService::ackSetSourceSoundProperty(org::genivi::am::am_Handle_s handle, org::genivi::am::am_Error_e error) {
- assert(mpIAmRoutingReceive);
- assert(mpLookpData);
- am_Handle_s handle_s;
- CAmConvertCAPI2AM(handle,handle_s);
- mpIAmRoutingReceive->ackSetSourceSoundProperty(handle_s, static_cast<am_Error_e>(error));
- mpLookpData->removeHandle(handle_s);
-}
-
-void CAmRoutingService::ackCrossFading(org::genivi::am::am_Handle_s handle, org::genivi::am::am_HotSink_e hotSink, org::genivi::am::am_Error_e error) {
- assert(mpIAmRoutingReceive);
- assert(mpLookpData);
- am_Handle_s handle_s;
- CAmConvertCAPI2AM(handle,handle_s);
- mpIAmRoutingReceive->ackCrossFading(handle_s, static_cast<am_HotSink_e>(hotSink), static_cast<am_Error_e>(error));
- mpLookpData->removeHandle(handle_s);
-}
-
-void CAmRoutingService::ackSourceVolumeTick(org::genivi::am::am_Handle_s handle, org::genivi::am::am_sourceID_t source, org::genivi::am::am_volume_t volume) {
- assert(mpIAmRoutingReceive);
- assert(mpLookpData);
- am_Handle_s handle_s;
- CAmConvertCAPI2AM(handle,handle_s);
- mpIAmRoutingReceive->ackSourceVolumeTick(handle_s, source, volume);
-}
-
-void CAmRoutingService::ackSinkVolumeTick(org::genivi::am::am_Handle_s handle, org::genivi::am::am_sinkID_t sink, org::genivi::am::am_volume_t volume) {
- assert(mpIAmRoutingReceive);
- am_Handle_s handle_s;
- CAmConvertCAPI2AM(handle,handle_s);
- mpIAmRoutingReceive->ackSinkVolumeTick(handle_s, sink, volume);
-}
-
-void CAmRoutingService::peekDomain(std::string name, org::genivi::am::am_domainID_t& domainID, org::genivi::am::am_Error_e& error) {
- assert(mpIAmRoutingReceive);
- error = static_cast<org::genivi::am::am_Error_e>(mpIAmRoutingReceive->peekDomain(name, domainID));
-}
-
-void CAmRoutingService::registerDomain(org::genivi::am::am_Domain_s domainData, std::string returnBusname, std::string returnInterface, org::genivi::am::am_domainID_t& domainID, org::genivi::am::am_Error_e& error) {
- assert(mpIAmRoutingReceive);
- assert(mpLookpData);
- assert(mpCAmCAPIWrapper);
- am_Domain_s converted;
- CAmConvertCAPI2AM(domainData, converted);
- converted.busname = CAmLookupData::BUS_NAME;
- am_Error_e resultCode = mpIAmRoutingReceive->registerDomain(converted, domainID);
- error = static_cast<org::genivi::am::am_Error_e>(resultCode);
- if(E_OK==resultCode)
- {
- std::shared_ptr<CommonAPI::Factory> factory = mpCAmCAPIWrapper->factory();
- std::shared_ptr<org::genivi::am::RoutingControlProxy<>> shpSenderProxy = factory->buildProxy<org::genivi::am::RoutingControlProxy>(returnBusname, returnInterface , "local");
- mpLookpData->addDomainLookup(domainID, shpSenderProxy);
- }
- if (domainID==2)
- mpIAmRoutingReceive->confirmRoutingReady(mHandle,E_OK);
-}
-
-void CAmRoutingService::deregisterDomain(org::genivi::am::am_domainID_t domainID, org::genivi::am::am_Error_e& returnError) {
- assert(mpIAmRoutingReceive);
- assert(mpLookpData);
- returnError = static_cast<org::genivi::am::am_Error_e>(mpIAmRoutingReceive->deregisterDomain(domainID));
- if(org::genivi::am::am_Error_e::E_OK==returnError)
- mpLookpData->removeDomainLookup(domainID);
-}
-
-void CAmRoutingService::registerGateway(org::genivi::am::am_Gateway_s gatewayData, org::genivi::am::am_gatewayID_t& gatewayID, org::genivi::am::am_Error_e& error) {
- assert(mpIAmRoutingReceive);
- am_Gateway_s converted;
- CAmConvertCAPI2AM(gatewayData, converted);
- error = static_cast<org::genivi::am::am_Error_e>(mpIAmRoutingReceive->registerGateway(converted, gatewayID));
-}
-
-void CAmRoutingService::registerConverter(org::genivi::am::am_Converter_s aData, org::genivi::am::am_converterID_t& converterID, org::genivi::am::am_Error_e& error) {
- assert(mpIAmRoutingReceive);
- am_Converter_s converted;
- CAmConvertCAPI2AM(aData, converted);
- error = static_cast<org::genivi::am::am_Error_e>(mpIAmRoutingReceive->registerConverter(converted, converterID));
-}
-
-void CAmRoutingService::deregisterGateway(org::genivi::am::am_gatewayID_t gatewayID, org::genivi::am::am_Error_e& returnError) {
- returnError = static_cast<org::genivi::am::am_Error_e>(mpIAmRoutingReceive->deregisterGateway(gatewayID));
-}
-
-void CAmRoutingService::deregisterConverter(org::genivi::am::am_converterID_t converterID, org::genivi::am::am_Error_e& returnError) {
- returnError = static_cast<org::genivi::am::am_Error_e>(mpIAmRoutingReceive->deregisterConverter(converterID));
-}
-
-void CAmRoutingService::peekSink(std::string name, org::genivi::am::am_sinkID_t& sinkID, org::genivi::am::am_Error_e& error) {
- assert(mpIAmRoutingReceive);
- error = static_cast<org::genivi::am::am_Error_e>(mpIAmRoutingReceive->peekSink(name, sinkID));
-}
-
-void CAmRoutingService::registerSink(org::genivi::am::am_Sink_s sinkData, org::genivi::am::am_sinkID_t& sinkID, org::genivi::am::am_Error_e& error) {
- assert(mpIAmRoutingReceive);
- assert(mpLookpData);
- am_Sink_s converted;
- CAmConvertCAPI2AM(sinkData, converted);
- am_Error_e result = mpIAmRoutingReceive->registerSink(converted, sinkID);
- error = static_cast<org::genivi::am::am_Error_e>(result);
- if(E_OK==result)
- mpLookpData->addSinkLookup(sinkID, converted.domainID);
-}
-
-void CAmRoutingService::deregisterSink(org::genivi::am::am_sinkID_t sinkID, org::genivi::am::am_Error_e& returnError) {
- assert(mpIAmRoutingReceive);
- assert(mpLookpData);
- returnError = static_cast<org::genivi::am::am_Error_e>(mpIAmRoutingReceive->deregisterSink(sinkID));
- if(returnError==org::genivi::am::am_Error_e::E_OK)
- mpLookpData->removeSinkLookup(sinkID);
-}
-
-void CAmRoutingService::peekSource(std::string name, org::genivi::am::am_sourceID_t& sourceID, org::genivi::am::am_Error_e& error) {
- assert(mpIAmRoutingReceive);
- error = static_cast<org::genivi::am::am_Error_e>(mpIAmRoutingReceive->peekSource(name, sourceID));
-}
-
-void CAmRoutingService::registerSource(org::genivi::am::am_Source_s sourceData, org::genivi::am::am_sourceID_t& sourceID, org::genivi::am::am_Error_e& error) {
- assert(mpIAmRoutingReceive);
- assert(mpLookpData);
- am_Source_s converted;
- CAmConvertCAPI2AM(sourceData, converted);
- error = static_cast<org::genivi::am::am_Error_e>(mpIAmRoutingReceive->registerSource(converted, sourceID));
- if(error==org::genivi::am::am_Error_e::E_OK)
- mpLookpData->addSourceLookup(sourceID, sourceData.domainID);
-}
-
-void CAmRoutingService::deregisterSource(org::genivi::am::am_sourceID_t sourceID, org::genivi::am::am_Error_e& returnError) {
- assert(mpIAmRoutingReceive);
- assert(mpLookpData);
- returnError = static_cast<org::genivi::am::am_Error_e>(mpIAmRoutingReceive->deregisterSource(sourceID));
- if(returnError==org::genivi::am::am_Error_e::E_OK)
- mpLookpData->removeSourceLookup(sourceID);
-}
-
-void CAmRoutingService::registerCrossfader(org::genivi::am::am_Crossfader_s crossfaderData, org::genivi::am::am_crossfaderID_t& crossfaderID, org::genivi::am::am_Error_e& error) {
- assert(mpIAmRoutingReceive);
- am_Crossfader_s converted;
- CAmConvertCAPI2AM(crossfaderData, converted);
- error = static_cast<org::genivi::am::am_Error_e>(mpIAmRoutingReceive->registerCrossfader(converted, crossfaderID));
- if(error==org::genivi::am::am_Error_e::E_OK)
- mpLookpData->addCrossfaderLookup(crossfaderID, crossfaderData.sourceID);
-}
-
-void CAmRoutingService::deregisterCrossfader(org::genivi::am::am_crossfaderID_t crossfaderID, org::genivi::am::am_Error_e& returnError) {
- assert(mpIAmRoutingReceive);
- returnError = static_cast<org::genivi::am::am_Error_e>(mpIAmRoutingReceive->deregisterCrossfader(crossfaderID));
- if(returnError==org::genivi::am::am_Error_e::E_OK)
- mpLookpData->removeCrossfaderLookup(crossfaderID);
-}
-
-void CAmRoutingService::peekSourceClassID(std::string name, org::genivi::am::am_sourceClass_t& sourceClassID, org::genivi::am::am_Error_e& error) {
- error = static_cast<org::genivi::am::am_Error_e>(mpIAmRoutingReceive->peekSourceClassID(name, sourceClassID));
-}
-
-void CAmRoutingService::peekSinkClassID(std::string name, org::genivi::am::am_sinkClass_t& sinkClassID, org::genivi::am::am_Error_e& error) {
- assert(mpIAmRoutingReceive);
- error = static_cast<org::genivi::am::am_Error_e>(mpIAmRoutingReceive->peekSinkClassID(name, sinkClassID));
-}
-
-void CAmRoutingService::hookInterruptStatusChange(org::genivi::am::am_sourceID_t sourceID, org::genivi::am::am_InterruptState_e InterruptState) {
- assert(mpIAmRoutingReceive);
- mpIAmRoutingReceive->hookInterruptStatusChange(sourceID, static_cast<am_InterruptState_e>(InterruptState));
-}
-
-void CAmRoutingService::hookDomainRegistrationComplete(org::genivi::am::am_domainID_t domainID) {
- assert(mpIAmRoutingReceive != NULL);
- mpIAmRoutingReceive->hookDomainRegistrationComplete(domainID);
-}
-
-void CAmRoutingService::hookSinkAvailablityStatusChange(org::genivi::am::am_sinkID_t sinkID, org::genivi::am::am_Availability_s availability) {
- assert(mpIAmRoutingReceive);
- am_Availability_s am_avialabilty;
- CAmConvertCAPI2AM(availability, am_avialabilty);
- mpIAmRoutingReceive->hookSinkAvailablityStatusChange(sinkID, am_avialabilty);
-}
-
-void CAmRoutingService::hookSourceAvailablityStatusChange(org::genivi::am::am_sourceID_t sourceID, org::genivi::am::am_Availability_s availability) {
- assert(mpIAmRoutingReceive);
- am_Availability_s am_availabilty;
- CAmConvertCAPI2AM(availability, am_availabilty);
- mpIAmRoutingReceive->hookSourceAvailablityStatusChange(sourceID, am_availabilty);
-}
-
-void CAmRoutingService::hookDomainStateChange(org::genivi::am::am_domainID_t domainID, org::genivi::am::am_DomainState_e domainState) {
- assert(mpIAmRoutingReceive);
- am_DomainState_e am_domainState = static_cast<am_DomainState_e>(domainState);
- mpIAmRoutingReceive->hookDomainStateChange(domainID, am_domainState);
-}
-
-void CAmRoutingService::hookTimingInformationChanged(org::genivi::am::am_connectionID_t connectionID, int16_t delay) {
- assert(mpIAmRoutingReceive);
- mpIAmRoutingReceive->hookTimingInformationChanged(connectionID, delay);
-}
-
-void CAmRoutingService::sendChangedData(org::genivi::am::am_EarlyData_L earlyData) {
-
- assert(mpIAmRoutingReceive);
- std::vector<am_EarlyData_s> dest;
- CAmConvertCAPIVector2AM(earlyData,dest);
- mpIAmRoutingReceive->sendChangedData(dest);
-}
-
-void CAmRoutingService::updateGateway(org::genivi::am::am_gatewayID_t gatewayID, org::genivi::am::am_ConnectionFormat_L listSourceFormats, org::genivi::am::am_ConnectionFormat_L listSinkFormats, org::genivi::am::am_Convertion_L convertionMatrix, org::genivi::am::am_Error_e& error) {
-
- assert(mpIAmRoutingReceive);
- std::vector<am_CustomConnectionFormat_t> destinationSourceConnectionFormats;
- CAmConvertCAPIVector2AM(listSourceFormats, destinationSourceConnectionFormats);
-
- std::vector<am_CustomConnectionFormat_t> destinationSinkConnectionFormats;
- CAmConvertCAPIVector2AM(listSinkFormats, destinationSinkConnectionFormats);
-
- error = (org::genivi::am::am_Error_e)mpIAmRoutingReceive->updateGateway(gatewayID, destinationSourceConnectionFormats, destinationSinkConnectionFormats, convertionMatrix);
-}
-
-void CAmRoutingService::updateConverter(org::genivi::am::am_converterID_t converterID, org::genivi::am::am_ConnectionFormat_L listSourceFormats, org::genivi::am::am_ConnectionFormat_L listSinkFormats, org::genivi::am::am_Convertion_L convertionMatrix, org::genivi::am::am_Error_e& error) {
-
- assert(mpIAmRoutingReceive);
- std::vector<am_CustomConnectionFormat_t> destinationSourceConnectionFormats;
- CAmConvertCAPIVector2AM(listSourceFormats, destinationSourceConnectionFormats);
-
- std::vector<am_CustomConnectionFormat_t> destinationSinkConnectionFormats;
- CAmConvertCAPIVector2AM(listSinkFormats, destinationSinkConnectionFormats);
-
- error = (org::genivi::am::am_Error_e)mpIAmRoutingReceive->updateConverter(converterID, destinationSourceConnectionFormats, destinationSinkConnectionFormats, convertionMatrix);
-}
-
-void CAmRoutingService::updateSink(org::genivi::am::am_sinkID_t sinkID, org::genivi::am::am_sinkClass_t sinkClassID, org::genivi::am::am_SoundProperty_L listSoundProperties, org::genivi::am::am_ConnectionFormat_L listConnectionFormats, org::genivi::am::am_MainSoundProperty_L listMainSoundProperties, org::genivi::am::am_Error_e& error) {
- assert(mpIAmRoutingReceive);
- std::vector<am_SoundProperty_s> dstListSoundProperties;
- CAmConvertCAPIVector2AM(listSoundProperties, dstListSoundProperties);
- std::vector<am_CustomConnectionFormat_t> dstListSinkConnectionFormats;
- CAmConvertCAPIVector2AM(listConnectionFormats, dstListSinkConnectionFormats);
- std::vector<am_MainSoundProperty_s> dstListMainSoundProperties;
- CAmConvertCAPIVector2AM(listMainSoundProperties, dstListMainSoundProperties);
- error = (org::genivi::am::am_Error_e)mpIAmRoutingReceive->updateSink( sinkID, sinkClassID, dstListSoundProperties,dstListSinkConnectionFormats,dstListMainSoundProperties);
-}
-
-void CAmRoutingService::updateSource(org::genivi::am::am_sourceID_t sourceID, org::genivi::am::am_sourceClass_t sourceClassID, org::genivi::am::am_SoundProperty_L listSoundProperties, org::genivi::am::am_ConnectionFormat_L listConnectionFormats, org::genivi::am::am_MainSoundProperty_L listMainSoundProperties, org::genivi::am::am_Error_e& error) {
- assert(mpIAmRoutingReceive);
- std::vector<am_SoundProperty_s> dstListSoundProperties;
- CAmConvertCAPIVector2AM(listSoundProperties, dstListSoundProperties);
- std::vector<am_CustomConnectionFormat_t> dstListSinkConnectionFormats;
- CAmConvertCAPIVector2AM(listConnectionFormats, dstListSinkConnectionFormats);
- std::vector<am_MainSoundProperty_s> dstListMainSoundProperties;
- CAmConvertCAPIVector2AM(listMainSoundProperties, dstListMainSoundProperties);
- error = (org::genivi::am::am_Error_e)mpIAmRoutingReceive->updateSource( sourceID, sourceClassID, dstListSoundProperties,dstListSinkConnectionFormats,dstListMainSoundProperties);
-}
-
-void CAmRoutingService::ackSetVolumes(org::genivi::am::am_Handle_s handle , org::genivi::am::am_Volumes_L listVolumes, org::genivi::am::am_Error_e error) {
- assert(mpIAmRoutingReceive);
- am_Handle_s handle_s;
- CAmConvertCAPI2AM(handle,handle_s);
- std::vector<am_Volumes_s> list;
- CAmConvertCAPIVector2AM(listVolumes, list);
- am_Error_e amError = static_cast<am_Error_e>(error);
- mpIAmRoutingReceive->ackSetVolumes(handle_s, list, amError);
- mpLookpData->removeHandle(handle_s);
-}
-
-void CAmRoutingService::ackSinkNotificationConfiguration (org::genivi::am::am_Handle_s handle, org::genivi::am::am_Error_e error) {
- assert(mpIAmRoutingReceive);
- assert(mpLookpData);
- am_Handle_s handle_s;
- CAmConvertCAPI2AM(handle,handle_s);
- am_Error_e amError = static_cast<am_Error_e>(error);
- mpIAmRoutingReceive->ackSinkNotificationConfiguration(handle_s, amError);
- mpLookpData->removeHandle(handle_s);
-}
-
-void CAmRoutingService::ackSourceNotificationConfiguration(org::genivi::am::am_Handle_s handle, org::genivi::am::am_Error_e error) {
- assert(mpIAmRoutingReceive);
- assert(mpLookpData);
- am_Handle_s handle_s;
- CAmConvertCAPI2AM(handle,handle_s);
- am_Error_e amError = static_cast<am_Error_e>(error);
- mpIAmRoutingReceive->ackSourceNotificationConfiguration(handle_s, amError);
- mpLookpData->removeHandle(handle_s);
-}
-
-void CAmRoutingService::hookSinkNotificationDataChange(org::genivi::am::am_sinkID_t sinkID, org::genivi::am::am_NotificationPayload_s payload) {
- assert(mpIAmRoutingReceive);
- am_NotificationPayload_s converted;
- CAmConvertCAPI2AM(payload, converted);
- mpIAmRoutingReceive->hookSinkNotificationDataChange(sinkID, converted);
-}
-
-void CAmRoutingService::hookSourceNotificationDataChange(org::genivi::am::am_sourceID_t sourceID, org::genivi::am::am_NotificationPayload_s payload) {
- assert(mpIAmRoutingReceive);
- am_NotificationPayload_s converted;
- CAmConvertCAPI2AM(payload, converted);
- mpIAmRoutingReceive->hookSourceNotificationDataChange(sourceID, converted);
-}
-
-void CAmRoutingService::confirmRoutingRundown(std::string domainName)
-{
- mNumberDomains--;
- if (mNumberDomains==0)
- mpIAmRoutingReceive->confirmRoutingRundown(mHandle,E_OK);
-}
-
-void CAmRoutingService::gotRundown(int16_t numberDomains, uint16_t handle)
-{
- mReady=false;
- mNumberDomains=numberDomains;
- mHandle=handle;
-}
-
-} /* namespace am */
diff --git a/PluginRoutingInterfaceCAPI/test/CAmRoutingInterfaceCAPITests.cpp b/PluginRoutingInterfaceCAPI/test/CAmRoutingInterfaceCAPITests.cpp
deleted file mode 100644
index f4b3c7d..0000000
--- a/PluginRoutingInterfaceCAPI/test/CAmRoutingInterfaceCAPITests.cpp
+++ /dev/null
@@ -1,2326 +0,0 @@
-/**
- * Copyright (c) 2012 BMW
- *
- * \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 <iostream>
-#include <fstream>
-#include <sstream>
-#include <algorithm>
-#include <string>
-#include <vector>
-#include <set>
-#include <sys/time.h>
-#include <CommonAPI/CommonAPI.h>
-#include <org/genivi/am.h>
-#include "CAmRoutingInterfaceCAPITests.h"
-#include "TAmPluginTemplate.h"
-#include "shared/CAmDltWrapper.h"
-#include "../include/CAmRoutingSenderCAPI.h"
-#include "../include/CAmRoutingSenderCommon.h"
-#include "CAmRoutingSenderService.h"
-#include "IAmRoutingSenderBackdoor.h"
-
-using namespace am;
-using namespace CommonAPI;
-using namespace testing;
-
-static CAmTestsEnvironment* env;
-
-/**
- * Main thread synchronization
- */
-pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
-pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
-
-/**
- * Common-API connection thread synchronization
- */
-pthread_cond_t condPxy = PTHREAD_COND_INITIALIZER;
-pthread_mutex_t mutexPxy = PTHREAD_MUTEX_INITIALIZER;
-
-/**
- * Proxy initialization thread synchronization
- */
-pthread_cond_t condSer = PTHREAD_COND_INITIALIZER;
-pthread_mutex_t mutexSer = PTHREAD_MUTEX_INITIALIZER;
-
-
-#define TEST_ID_1 DYNAMIC_ID_BOUNDARY+2
-#define TEST_ID_2 DYNAMIC_ID_BOUNDARY+3
-
-/**
- * Initialize common-api and am sinks
- */
-void initSink(org::genivi::am::am_Sink_s & newSink, am_Sink_s & newAmSink, const org::genivi::am::am_domainID_t & domainID, const org::genivi::am::am_sinkID_t & sinkID = 0)
-{
- org::genivi::am::am_MuteState_e muteState = org::genivi::am::am_MuteState_e::MS_UNKNOWN;
- org::genivi::am::am_Availability_s available(org::genivi::am::am_Availability_e::A_MAX, AR_UNKNOWN);
- org::genivi::am::am_SoundProperty_L listSoundProperties;
- listSoundProperties.push_back(org::genivi::am::am_SoundProperty_s(SP_GENIVI_MID, 100));
- listSoundProperties.push_back(org::genivi::am::am_SoundProperty_s(SP_GENIVI_BASS, 101));
- listSoundProperties.push_back(org::genivi::am::am_SoundProperty_s(SP_UNKNOWN, 102));
- org::genivi::am::am_ConnectionFormat_L listConnectionFormats;
- listConnectionFormats.push_back(CF_UNKNOWN);
- org::genivi::am::am_MainSoundProperty_L listMainSoundProperties;
- listMainSoundProperties.push_back(org::genivi::am::am_MainSoundProperty_s(MSP_UNKNOWN, 100));
- org::genivi::am::am_NotificationConfiguration_L listMainNotificationConfigurations;
- listMainNotificationConfigurations.push_back(org::genivi::am::am_NotificationConfiguration_s(NT_UNKNOWN, org::genivi::am::am_NotificationStatus_e::NS_MAX, 100));
- org::genivi::am::am_NotificationConfiguration_L listNotificationConfigurations;
- listNotificationConfigurations.push_back(org::genivi::am::am_NotificationConfiguration_s(NT_UNKNOWN, org::genivi::am::am_NotificationStatus_e::NS_MAX, 100));
-
- org::genivi::am::am_Sink_s sink(sinkID, "name", domainID, 104, 50, true, available, muteState, 50,
- listSoundProperties, listConnectionFormats, listMainSoundProperties, listMainNotificationConfigurations, listNotificationConfigurations);
- newSink = sink;
- CAmConvertCAPI2AM(sink, newAmSink);
-}
-
-/**
- * Initialize common-api and am sources
- */
-void initSource(org::genivi::am::am_Source_s & newSource, am_Source_s & newAmSource, const org::genivi::am::am_domainID_t & domainID, const org::genivi::am::am_sourceID_t & sourceID = 0)
-{
- org::genivi::am::am_SourceState_e srcState = org::genivi::am::am_SourceState_e::SS_MAX;
- org::genivi::am::am_Availability_s available(org::genivi::am::am_Availability_e::A_MAX, AR_UNKNOWN);
- org::genivi::am::am_SoundProperty_L listSoundProperties;
- listSoundProperties.push_back(org::genivi::am::am_SoundProperty_s(SP_GENIVI_MID, 100));
- listSoundProperties.push_back(org::genivi::am::am_SoundProperty_s(SP_GENIVI_BASS, 101));
- listSoundProperties.push_back(org::genivi::am::am_SoundProperty_s(SP_UNKNOWN, 102));
- org::genivi::am::am_ConnectionFormat_L listConnectionFormats;
- listConnectionFormats.push_back(CF_UNKNOWN);
- org::genivi::am::am_MainSoundProperty_L listMainSoundProperties;
- listMainSoundProperties.push_back(org::genivi::am::am_MainSoundProperty_s(MSP_UNKNOWN, 100));
- org::genivi::am::am_NotificationConfiguration_L listMainNotificationConfigurations;
- listMainNotificationConfigurations.push_back(org::genivi::am::am_NotificationConfiguration_s(NT_UNKNOWN, org::genivi::am::am_NotificationStatus_e::NS_MAX, 100));
- org::genivi::am::am_NotificationConfiguration_L listNotificationConfigurations;
- listNotificationConfigurations.push_back(org::genivi::am::am_NotificationConfiguration_s(NT_UNKNOWN, org::genivi::am::am_NotificationStatus_e::NS_MAX, 100));
-
- org::genivi::am::am_Source_s source(sourceID, domainID, "name", 104, srcState, 50, true, available, org::genivi::am::am_InterruptState_e::IS_MAX,
- listSoundProperties, listConnectionFormats, listMainSoundProperties, listMainNotificationConfigurations, listNotificationConfigurations);
- newSource = source;
- CAmConvertCAPI2AM(source, newAmSource);
-}
-
-/**
- * Initialize common-api and am crossfaders
- */
-void initCrossfader(org::genivi::am::am_Crossfader_s & newCrossfader, am_Crossfader_s & newAmCrossfader, const org::genivi::am::am_crossfaderID_t & crossfaderID = 0)
-{
- org::genivi::am::am_Crossfader_s crossfader(crossfaderID, "name", TEST_ID_1, TEST_ID_2, TEST_ID_1, org::genivi::am::am_HotSink_e::HS_MAX);
- CAmConvertCAPI2AM(crossfader, newAmCrossfader);
- newCrossfader = crossfader;
-}
-
-/**
- * Client thread where the proxy and the routing test domain service run
- */
-void* run_client(void*)
-{
- CAmSocketHandler socketHandler;
- CAmTestCAPIWrapper wrapper(&socketHandler);
- env->mSocketHandlerClient = &socketHandler;
- std::shared_ptr<CommonAPI::Factory> factory = wrapper.factory();
-
- env->mProxy = factory->buildProxy<org::genivi::am::RoutingControlObserverProxy>(CAmRoutingSenderCAPI::ROUTING_INTERFACE_SERVICE);
- env->mProxy->getProxyStatusEvent().subscribe(std::bind(&CAmTestsEnvironment::onServiceStatusEvent,env,std::placeholders::_1));
-
- env->mDomainService = std::make_shared<CAmRoutingSenderService>(&wrapper, env->mProxy);
-
- if( false == wrapper.registerStub(env->mDomainService, CAmRoutingSenderService::ROUTING_SENDER_SERVICE) )
- {
- printf("\n Can't register service -> %s \n", CAmRoutingSenderService::ROUTING_SENDER_SERVICE);
- logInfo("Can't register service -> ", CAmRoutingSenderService::ROUTING_SENDER_SERVICE);
- }
-
- pthread_mutex_lock(&mutexSer);
- env->mIsProxyInitilized = true;
- pthread_mutex_unlock(&mutexSer);
- pthread_cond_signal(&condSer);
-
- socketHandler.start_listenting();
-
-//Cleanup
- env->mProxy.reset();
- env->mSocketHandlerClient = NULL;
-
- return (NULL);
-}
-
-/**
- * Service thread for the routing plugin
- */
-void* run_service(void*)
-{
- CAmSocketHandler socketHandler;
- CAmTestCAPIWrapper wrapper(&socketHandler);
- CAmRoutingSenderCAPI plugin(&wrapper);
- env->mpPlugin = &plugin;
- env->mSocketHandlerService = &socketHandler;
- MockIAmRoutingReceive mock;
- env->mpRoutingReceive = &mock;
- if(plugin.startupInterface(env->mpRoutingReceive)!=E_OK)
- {
- logError("CommandSendInterface can't start!");
- }
- else
- {
- plugin.setRoutingReady(10);
- socketHandler.start_listenting();
- plugin.setRoutingRundown(10);
- plugin.tearDownInterface(env->mpRoutingReceive);
- }
- //Cleanup
- env->mpRoutingReceive = NULL;
- env->mpPlugin = NULL;
- env->mSocketHandlerClient = NULL;
-
- return (NULL);
-}
-
-/**
- * Helper thread that listens for signals from another threads in order to synchronize them.
- * This thread starts actually the unit tests.
- */
-void* run_listener(void*)
-{
- pthread_mutex_lock(&mutexSer);
- while (env->mIsProxyInitilized==false)
- {
- std::cout << "\n\r Intialize proxy..\n\r" ;
- pthread_cond_wait(&condSer, &mutexSer);
- }
- pthread_mutex_unlock(&mutexSer);
-
- time_t start = time(0);
- time_t now = start;
- pthread_mutex_lock(&mutexPxy);
- while ( env->mIsServiceAvailable==false && now-start <= 15 )
- {
- std::cout << " Waiting for proxy..\n\r" ;
- struct timespec ts = { 0, 0 };
- clock_gettime(CLOCK_REALTIME, &ts);
- ts.tv_sec += 5;
- pthread_cond_timedwait(&condPxy, &mutexPxy, &ts);
- now = time(0);
- }
- pthread_mutex_unlock(&mutexPxy);
-
- pthread_cond_signal(&cond);
-
- return NULL;
-}
-
-
-CAmRoutingInterfaceCAPITests::CAmRoutingInterfaceCAPITests()
-{
-
-}
-
-CAmRoutingInterfaceCAPITests::~CAmRoutingInterfaceCAPITests()
-{
-
-}
-
-void CAmRoutingInterfaceCAPITests::SetUp()
-{
- ::testing::GTEST_FLAG(throw_on_failure) = false;
-}
-
-void CAmRoutingInterfaceCAPITests::TearDown()
-{
- ::testing::GTEST_FLAG(throw_on_failure) = true;
-}
-
-
-CAmRoutingSenderCAPITests::CAmRoutingSenderCAPITests()
-{
-
-}
-
-CAmRoutingSenderCAPITests::~CAmRoutingSenderCAPITests()
-{
-
-}
-
-void CAmRoutingSenderCAPITests::SetUp()
-{
- ::testing::GTEST_FLAG(throw_on_failure) = false;
-}
-
-void CAmRoutingSenderCAPITests::TearDown()
-{
- ::testing::GTEST_FLAG(throw_on_failure) = true;
-}
-
-int main(int argc, char **argv)
-{
- ::testing::InitGoogleTest(&argc, argv);
- ::testing::AddGlobalTestEnvironment(new CAmTestsEnvironment);
- return RUN_ALL_TESTS();
-}
-
-CAmTestsEnvironment::CAmTestsEnvironment() :
- mIsProxyInitilized(false),
- mIsServiceAvailable(false),
- mIsDomainAvailable(false),
- mListenerThread(0),
- mServicePThread(0),
- mClientPThread(0),
- mSocketHandlerService(NULL),
- mSocketHandlerClient(NULL),
- mpRoutingReceive(NULL),
- mpPlugin(NULL),
- mProxy(NULL),
- mDomainService(NULL)
-{
- env=this;
- CAmDltWrapper::instance()->registerApp("capiTest", "capiTest");
- pthread_create(&mListenerThread, NULL, run_listener, NULL);
- pthread_create(&mServicePThread, NULL, run_service, NULL);
- pthread_create(&mClientPThread, NULL, run_client, NULL);
-}
-
-CAmTestsEnvironment::~CAmTestsEnvironment()
-{
-
-}
-
-void CAmTestsEnvironment::SetUp()
-{
- pthread_cond_wait(&cond, &mutex);
-}
-
-void CAmTestsEnvironment::TearDown()
-{
- EXPECT_TRUE(Mock::VerifyAndClearExpectations(mpRoutingReceive));
- if(mSocketHandlerClient)
- mSocketHandlerClient->exit_mainloop();
- pthread_join(mClientPThread, NULL);
-
- if(mSocketHandlerService)
- mSocketHandlerService->exit_mainloop();
- pthread_join(mServicePThread, NULL);
- sleep(1);
-}
-
-void CAmTestsEnvironment::onServiceStatusEvent(const CommonAPI::AvailabilityStatus& serviceStatus)
-{
- std::stringstream avail;
- avail << "(" << static_cast<int>(serviceStatus) << ")";
-
- logInfo("Service Status changed to ", avail.str());
- std::cout << std::endl << "Service Status changed to " << avail.str() << std::endl;
- pthread_mutex_lock(&mutexPxy);
- mIsServiceAvailable = (serviceStatus==CommonAPI::AvailabilityStatus::AVAILABLE);
- pthread_mutex_unlock(&mutexPxy);
- pthread_cond_signal(&condPxy);
-}
-
-TEST_F(CAmRoutingInterfaceCAPITests, ClientStartupTest)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
-
-}
-
-MATCHER_P(IsHandleEqual, value, "") {
- am_Handle_s & lh = arg;
- return lh.handle == value.handle && lh.handleType == value.handleType;
-}
-
-TEST_F(CAmRoutingInterfaceCAPITests, ackConnect)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- CallStatus callStatus = CallStatus::NOT_AVAILABLE;
- org::genivi::am::am_connectionID_t connectionID = TEST_ID_1;
- am_Error_e error = E_OK;
- am_Handle_s handle = {H_CONNECT, 20};
- org::genivi::am::am_Handle_s CAPIHandle;
- CAmConvertAM2CAPI(handle,CAPIHandle);
- EXPECT_CALL(*env->mpRoutingReceive, ackConnect(IsHandleEqual(handle), connectionID, error)).Times(1);
- env->mProxy->ackConnect(CAPIHandle, connectionID, static_cast<org::genivi::am::am_Error_e>(error), callStatus);
- ASSERT_EQ( callStatus, CallStatus::SUCCESS );
- }
-
-}
-
-TEST_F(CAmRoutingInterfaceCAPITests, ackDisconnect)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- CallStatus callStatus = CallStatus::NOT_AVAILABLE;
- org::genivi::am::am_connectionID_t connectionID = TEST_ID_1;
- am_Error_e error = E_OK;
- am_Handle_s handle = {H_DISCONNECT, 20};
- org::genivi::am::am_Handle_s CAPIHandle;
- CAmConvertAM2CAPI(handle,CAPIHandle);
- EXPECT_CALL(*env->mpRoutingReceive, ackDisconnect(IsHandleEqual(handle), connectionID, error)).Times(1);
- env->mProxy->ackDisconnect(CAPIHandle, connectionID, static_cast<org::genivi::am::am_Error_e>(error), callStatus);
- ASSERT_EQ( callStatus, CallStatus::SUCCESS );
- }
-
-}
-
-TEST_F(CAmRoutingInterfaceCAPITests, ackSetSinkVolumeChange)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- CallStatus callStatus = CallStatus::NOT_AVAILABLE;
- am_Error_e error = E_OK;
- am_volume_t volume = 50;
- am_Handle_s handle = {H_SETSINKVOLUME, 20};
- org::genivi::am::am_Handle_s CAPIHandle;
- CAmConvertAM2CAPI(handle,CAPIHandle);
- EXPECT_CALL(*env->mpRoutingReceive, ackSetSinkVolumeChange(IsHandleEqual(handle), volume, error)).Times(1);
- env->mProxy->ackSetSinkVolumeChange(CAPIHandle, static_cast<org::genivi::am::am_volume_t>(volume), static_cast<org::genivi::am::am_Error_e>(error), callStatus);
- ASSERT_EQ( callStatus, CallStatus::SUCCESS );
- }
-
-}
-
-TEST_F(CAmRoutingInterfaceCAPITests, ackSetSourceVolumeChange)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- CallStatus callStatus = CallStatus::NOT_AVAILABLE;
- am_Error_e error = E_OK;
- am_volume_t volume = 50;
- am_Handle_s handle = {H_SETSOURCEVOLUME, 20};
- org::genivi::am::am_Handle_s CAPIHandle;
- CAmConvertAM2CAPI(handle,CAPIHandle);
- EXPECT_CALL(*env->mpRoutingReceive, ackSetSourceVolumeChange(IsHandleEqual(handle), volume, error)).Times(1);
- env->mProxy->ackSetSourceVolumeChange(CAPIHandle, static_cast<org::genivi::am::am_volume_t>(volume), static_cast<org::genivi::am::am_Error_e>(error), callStatus);
- ASSERT_EQ( callStatus, CallStatus::SUCCESS );
- }
-
-
-}
-
-TEST_F(CAmRoutingInterfaceCAPITests, ackSetSourceState)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- CallStatus callStatus = CallStatus::NOT_AVAILABLE;
- am_Error_e error = E_OK;
- am_volume_t volume = 50;
- am_Handle_s handle = {H_SETSOURCESTATE, 20};
- org::genivi::am::am_Handle_s CAPIHandle;
- CAmConvertAM2CAPI(handle,CAPIHandle);
- EXPECT_CALL(*env->mpRoutingReceive, ackSetSourceState(IsHandleEqual(handle), error)).Times(1);
- env->mProxy->ackSetSourceState(CAPIHandle, static_cast<org::genivi::am::am_Error_e>(error), callStatus);
- ASSERT_EQ( callStatus, CallStatus::SUCCESS );
- }
-
-
-}
-
-TEST_F(CAmRoutingInterfaceCAPITests, ackSetSinkSoundProperties)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- CallStatus callStatus = CallStatus::NOT_AVAILABLE;
- am_Error_e error = E_OK;
- am_volume_t volume = 50;
- am_Handle_s handle = {H_SETSINKSOUNDPROPERTIES, 20};
- org::genivi::am::am_Handle_s CAPIHandle;
- CAmConvertAM2CAPI(handle,CAPIHandle);
- EXPECT_CALL(*env->mpRoutingReceive, ackSetSinkSoundProperties(IsHandleEqual(handle), error)).Times(1);
- env->mProxy->ackSetSinkSoundProperties(CAPIHandle, static_cast<org::genivi::am::am_Error_e>(error), callStatus);
- ASSERT_EQ( callStatus, CallStatus::SUCCESS );
- }
-
-
-}
-
-TEST_F(CAmRoutingInterfaceCAPITests, ackSetSinkSoundProperty)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- CallStatus callStatus = CallStatus::NOT_AVAILABLE;
- am_Error_e error = E_OK;
- am_volume_t volume = 50;
- am_Handle_s handle = {H_SETSINKSOUNDPROPERTY, 20};
- org::genivi::am::am_Handle_s CAPIHandle;
- CAmConvertAM2CAPI(handle,CAPIHandle);
- EXPECT_CALL(*env->mpRoutingReceive, ackSetSinkSoundProperty(IsHandleEqual(handle), error)).Times(1);
- env->mProxy->ackSetSinkSoundProperty(CAPIHandle, static_cast<org::genivi::am::am_Error_e>(error), callStatus);
- ASSERT_EQ( callStatus, CallStatus::SUCCESS );
- }
-
-
-}
-
-TEST_F(CAmRoutingInterfaceCAPITests, ackSetSourceSoundProperties)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- CallStatus callStatus = CallStatus::NOT_AVAILABLE;
- am_Error_e error = E_OK;
- am_volume_t volume = 50;
- am_Handle_s handle = {H_SETSOURCESOUNDPROPERTIES, 20};
- org::genivi::am::am_Handle_s CAPIHandle;
- CAmConvertAM2CAPI(handle,CAPIHandle);
- EXPECT_CALL(*env->mpRoutingReceive, ackSetSourceSoundProperties(IsHandleEqual(handle), error)).Times(1);
- env->mProxy->ackSetSourceSoundProperties(CAPIHandle, static_cast<org::genivi::am::am_Error_e>(error), callStatus);
- ASSERT_EQ( callStatus, CallStatus::SUCCESS );
- }
-
-
-}
-
-TEST_F(CAmRoutingInterfaceCAPITests, ackSetSourceSoundProperty)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- CallStatus callStatus = CallStatus::NOT_AVAILABLE;
- am_Error_e error = E_OK;
- am_volume_t volume = 50;
- am_Handle_s handle = {H_SETSOURCESOUNDPROPERTY, 20};
- org::genivi::am::am_Handle_s CAPIHandle;
- CAmConvertAM2CAPI(handle,CAPIHandle);
- EXPECT_CALL(*env->mpRoutingReceive, ackSetSourceSoundProperty(IsHandleEqual(handle), error)).Times(1);
- env->mProxy->ackSetSourceSoundProperty(CAPIHandle, static_cast<org::genivi::am::am_Error_e>(error), callStatus);
- ASSERT_EQ( callStatus, CallStatus::SUCCESS );
- }
-
-}
-
-TEST_F(CAmRoutingInterfaceCAPITests, ackCrossFading)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- CallStatus callStatus = CallStatus::NOT_AVAILABLE;
- am_Error_e error = E_OK;
- am_HotSink_e hotSink = HS_UNKNOWN;
- am_Handle_s handle = {H_CROSSFADE, 20};
- org::genivi::am::am_Handle_s CAPIHandle;
- CAmConvertAM2CAPI(handle,CAPIHandle);
- EXPECT_CALL(*env->mpRoutingReceive, ackCrossFading(IsHandleEqual(handle), hotSink, error)).Times(1);
- env->mProxy->ackCrossFading(CAPIHandle, static_cast<org::genivi::am::am_HotSink_e>(hotSink), static_cast<org::genivi::am::am_Error_e>(error), callStatus);
- ASSERT_EQ( callStatus, CallStatus::SUCCESS );
- }
-
-}
-
-TEST_F(CAmRoutingInterfaceCAPITests, ackSourceVolumeTick)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- CallStatus callStatus = CallStatus::NOT_AVAILABLE;
- am_Error_e error = E_OK;
- am_sourceID_t sourceID = TEST_ID_1;
- am_Handle_s handle = {H_SETSOURCEVOLUME, 20};
- am_volume_t volume (20);
- org::genivi::am::am_Handle_s CAPIHandle;
- CAmConvertAM2CAPI(handle,CAPIHandle);
- EXPECT_CALL(*env->mpRoutingReceive, ackSourceVolumeTick(IsHandleEqual(handle), sourceID, volume)).Times(1);
- env->mProxy->ackSourceVolumeTick(CAPIHandle, sourceID, static_cast<org::genivi::am::am_volume_t>(volume), callStatus);
- ASSERT_EQ( callStatus, CallStatus::SUCCESS );
- }
-
-}
-
-TEST_F(CAmRoutingInterfaceCAPITests, ackSinkVolumeTick)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- CallStatus callStatus = CallStatus::NOT_AVAILABLE;
- am_Error_e error = E_OK;
- am_sinkID_t sID = TEST_ID_1;
- am_Handle_s handle = {H_SETSINKVOLUME, 20};
- org::genivi::am::am_Handle_s CAPIHandle;
- CAmConvertAM2CAPI(handle,CAPIHandle);
- am_volume_t volume (20);
- EXPECT_CALL(*env->mpRoutingReceive, ackSinkVolumeTick(IsHandleEqual(handle), sID, volume)).Times(1);
- env->mProxy->ackSinkVolumeTick(CAPIHandle, sID,static_cast<org::genivi::am::am_volume_t>(volume), callStatus);
- ASSERT_EQ( callStatus, CallStatus::SUCCESS );
- }
-
-}
-
-ACTION(actionRegister){
- arg1=TEST_ID_1;
-}
-
-ACTION(actionPeekDomain){
- arg1=TEST_ID_1;
-}
-
-TEST_F(CAmRoutingInterfaceCAPITests, peekDomain)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- CallStatus callStatus = CallStatus::NOT_AVAILABLE;
- org::genivi::am::am_Error_e error = org::genivi::am::am_Error_e::E_UNKNOWN;
- std::string name("domain name");
- org::genivi::am::am_domainID_t domainID = 0;
- ON_CALL(*env->mpRoutingReceive, peekDomain(_, _)).WillByDefault(Return(E_OK));
- EXPECT_CALL(*env->mpRoutingReceive, peekDomain(name, _)).WillOnce(DoAll(actionPeekDomain(), Return(E_OK)));
- env->mProxy->peekDomain(name, callStatus, domainID, error);
- ASSERT_EQ( domainID, TEST_ID_1 );
- ASSERT_EQ( error, org::genivi::am::am_Error_e::E_OK );
- ASSERT_EQ( callStatus, CallStatus::SUCCESS );
- }
-
-}
-
-MATCHER_P(IsDomainDataEqualTo, value, "") {
- auto lh = arg;
- return lh.domainID == value.domainID &&
- lh.name == value.name &&
- lh.nodename == value.nodename &&
- lh.early == value.early &&
- lh.complete == value.complete &&
- lh.state == value.state;
-}
-
-TEST_F(CAmRoutingInterfaceCAPITests, registerDomain)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- CallStatus callStatus = CallStatus::NOT_AVAILABLE;
- org::genivi::am::am_Error_e error = org::genivi::am::am_Error_e::E_UNKNOWN;
-
- std::string name("domain name");
- std::string busname("busname");
- std::string nodename("nodename");
-
- org::genivi::am::am_Domain_s domainData(0, name, busname, nodename, false, false, org::genivi::am::am_DomainState_e::DS_CONTROLLED);
- am::am_Domain_s amDomainData;
- CAmConvertCAPI2AM(domainData, amDomainData);
- org::genivi::am::am_domainID_t domainID = 0;
-//If the result is E_OK, then the routing service will try to establish a connection with the domain via common-api.
-//For now we won't test common-api connection with the domain therefore E_ABORTED is returned.
- ON_CALL(*env->mpRoutingReceive, registerDomain(_, _)).WillByDefault(Return(E_ABORTED));
- EXPECT_CALL(*env->mpRoutingReceive, registerDomain(IsDomainDataEqualTo(amDomainData), _)).WillOnce(DoAll(actionRegister(), Return(E_ABORTED)));
-
-//example: [local:org.genivi.audiomanager.testdomaininterface:org.genivi.audiomanager]
- env->mProxy->registerDomain(domainData,
- "org.genivi.audiomanager", //(last part)
- "org.genivi.audiomanager.testdomaininterface", //(middle part)
- callStatus,
- domainID,
- error);
- ASSERT_EQ( domainID, TEST_ID_1 );
- ASSERT_EQ( error, org::genivi::am::am_Error_e::E_ABORTED );
- ASSERT_EQ( callStatus, CallStatus::SUCCESS );
- }
-
-}
-
-TEST_F(CAmRoutingInterfaceCAPITests, deregisterDomain)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- CallStatus callStatus = CallStatus::NOT_AVAILABLE;
- org::genivi::am::am_Error_e error = org::genivi::am::am_Error_e::E_UNKNOWN;
- org::genivi::am::am_domainID_t domainID = TEST_ID_1;
-
- ON_CALL(*env->mpRoutingReceive, deregisterDomain(_)).WillByDefault(Return(E_OK));
- EXPECT_CALL(*env->mpRoutingReceive, deregisterDomain(domainID)).WillOnce(Return(E_OK));
- env->mProxy->deregisterDomain(domainID, callStatus, error);
- ASSERT_EQ( error, org::genivi::am::am_Error_e::E_OK );
- ASSERT_EQ( callStatus, CallStatus::SUCCESS );
- }
-
-}
-
-ACTION(actionRegisterGateway){
- arg1=TEST_ID_1;
-}
-
-MATCHER_P(IsGatewayDataEqualTo, value, "") {
- auto lh = arg;
- return lh.gatewayID == value.gatewayID &&
- lh.name == value.name &&
- lh.sinkID == value.sinkID &&
- lh.sourceID == value.sourceID &&
- lh.domainSinkID == value.domainSinkID &&
- lh.controlDomainID == value.controlDomainID &&
- lh.listSourceFormats == value.listSourceFormats &&
- lh.listSinkFormats == value.listSinkFormats &&
- lh.convertionMatrix == value.convertionMatrix;
-}
-
-TEST_F(CAmRoutingInterfaceCAPITests, registerGateway)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- CallStatus callStatus = CallStatus::NOT_AVAILABLE;
- org::genivi::am::am_Error_e error = org::genivi::am::am_Error_e::E_UNKNOWN;
-
- org::genivi::am::am_ConnectionFormat_L listSourceFormats;
- listSourceFormats.push_back(static_cast<org::genivi::am::am_CustomConnectionFormat_t>(CF_GENIVI_ANALOG));
- listSourceFormats.push_back(static_cast<org::genivi::am::am_CustomConnectionFormat_t>(CF_GENIVI_AUTO));
- org::genivi::am::am_ConnectionFormat_L listSinkFormats;
- listSinkFormats.push_back(static_cast<org::genivi::am::am_CustomConnectionFormat_t>(CF_GENIVI_AUTO));
- listSinkFormats.push_back(static_cast<org::genivi::am::am_CustomConnectionFormat_t>(CF_GENIVI_ANALOG));
- org::genivi::am::am_Convertion_L convertionMatrix;
- convertionMatrix.push_back(1);
- convertionMatrix.push_back(0);
-
- org::genivi::am::am_gatewayID_t gatewayID = 0;
- org::genivi::am::am_Gateway_s gateway(gatewayID, "name", 103, 104, 105, 106, 107, listSourceFormats, listSinkFormats, convertionMatrix);
- am_Gateway_s amGateway;
- CAmConvertCAPI2AM(gateway, amGateway);
-
- ON_CALL(*env->mpRoutingReceive, registerGateway(_, _)).WillByDefault(Return(E_OK));
- EXPECT_CALL(*env->mpRoutingReceive, registerGateway(IsGatewayDataEqualTo(amGateway), _)).WillOnce(DoAll(actionRegisterGateway(), Return(E_OK)));
- env->mProxy->registerGateway(gateway, callStatus, gatewayID, error);
- ASSERT_EQ( gatewayID, TEST_ID_1 );
- ASSERT_EQ( error, org::genivi::am::am_Error_e::E_OK );
- ASSERT_EQ( callStatus, CallStatus::SUCCESS );
- }
-
-}
-
-TEST_F(CAmRoutingInterfaceCAPITests, deregisterGateway)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- CallStatus callStatus = CallStatus::NOT_AVAILABLE;
- org::genivi::am::am_Error_e error = org::genivi::am::am_Error_e::E_UNKNOWN;
- org::genivi::am::am_gatewayID_t gatewayID = TEST_ID_1;
-
- ON_CALL(*env->mpRoutingReceive, deregisterGateway(_)).WillByDefault(Return(E_OK));
- EXPECT_CALL(*env->mpRoutingReceive, deregisterGateway(gatewayID)).WillOnce(Return(E_OK));
- env->mProxy->deregisterGateway(gatewayID, callStatus, error);
- ASSERT_EQ( error, org::genivi::am::am_Error_e::E_OK );
- ASSERT_EQ( callStatus, CallStatus::SUCCESS );
- }
-
-}
-
-MATCHER_P(IsConverterDataEqualTo, value, "") {
- auto lh = arg;
- return lh.converterID == value.converterID &&
- lh.name == value.name &&
- lh.sinkID == value.sinkID &&
- lh.sourceID == value.sourceID &&
- lh.domainID == value.domainID &&
- lh.listSourceFormats == value.listSourceFormats &&
- lh.listSinkFormats == value.listSinkFormats &&
- lh.convertionMatrix == value.convertionMatrix;
-}
-
-TEST_F(CAmRoutingInterfaceCAPITests, registerConverter)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- CallStatus callStatus = CallStatus::NOT_AVAILABLE;
- org::genivi::am::am_Error_e error = org::genivi::am::am_Error_e::E_UNKNOWN;
-
- org::genivi::am::am_ConnectionFormat_L listSourceFormats;
- listSourceFormats.push_back(static_cast<org::genivi::am::am_CustomConnectionFormat_t>(CF_GENIVI_ANALOG));
- listSourceFormats.push_back(static_cast<org::genivi::am::am_CustomConnectionFormat_t>(CF_GENIVI_AUTO));
- org::genivi::am::am_ConnectionFormat_L listSinkFormats;
- listSinkFormats.push_back(static_cast<org::genivi::am::am_CustomConnectionFormat_t>(CF_GENIVI_AUTO));
- listSinkFormats.push_back(static_cast<org::genivi::am::am_CustomConnectionFormat_t>(CF_GENIVI_ANALOG));
- org::genivi::am::am_Convertion_L convertionMatrix;
- convertionMatrix.push_back(1);
- convertionMatrix.push_back(0);
-
- org::genivi::am::am_converterID_t converterID = 0;
- org::genivi::am::am_Converter_s gateway(converterID, "name", 103, 104, 105, listSourceFormats, listSinkFormats, convertionMatrix);
- am_Converter_s amGateway;
- CAmConvertCAPI2AM(gateway, amGateway);
-
- ON_CALL(*env->mpRoutingReceive, registerConverter(_, _)).WillByDefault(Return(E_OK));
- EXPECT_CALL(*env->mpRoutingReceive, registerConverter(IsConverterDataEqualTo(amGateway), _)).WillOnce(DoAll(actionRegisterGateway(), Return(E_OK)));
- env->mProxy->registerConverter(gateway, callStatus, converterID, error);
- ASSERT_EQ( converterID, TEST_ID_1 );
- ASSERT_EQ( error, org::genivi::am::am_Error_e::E_OK );
- ASSERT_EQ( callStatus, CallStatus::SUCCESS );
- }
-
-}
-
-TEST_F(CAmRoutingInterfaceCAPITests, deregisterConverter)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- CallStatus callStatus = CallStatus::NOT_AVAILABLE;
- org::genivi::am::am_Error_e error = org::genivi::am::am_Error_e::E_UNKNOWN;
- org::genivi::am::am_converterID_t converterID = TEST_ID_1;
-
- ON_CALL(*env->mpRoutingReceive, deregisterConverter(_)).WillByDefault(Return(E_OK));
- EXPECT_CALL(*env->mpRoutingReceive, deregisterConverter(converterID)).WillOnce(Return(E_OK));
- env->mProxy->deregisterConverter(converterID, callStatus, error);
- ASSERT_EQ( error, org::genivi::am::am_Error_e::E_OK );
- ASSERT_EQ( callStatus, CallStatus::SUCCESS );
- }
-
-}
-
-ACTION(actionPeek){
- arg1=TEST_ID_1;
-}
-
-TEST_F(CAmRoutingInterfaceCAPITests, peekSink)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- CallStatus callStatus = CallStatus::NOT_AVAILABLE;
- org::genivi::am::am_Error_e error = org::genivi::am::am_Error_e::E_UNKNOWN;
- std::string name("name");
- org::genivi::am::am_sinkID_t sinkID = 0;
- ON_CALL(*env->mpRoutingReceive, peekSink(_, _)).WillByDefault(Return(E_OK));
- EXPECT_CALL(*env->mpRoutingReceive, peekSink(name, _)).WillOnce(DoAll(actionPeek(), Return(E_OK)));
- env->mProxy->peekSink(name, callStatus, sinkID, error);
- ASSERT_EQ( sinkID, TEST_ID_1 );
- ASSERT_EQ( error, org::genivi::am::am_Error_e::E_OK );
- ASSERT_EQ( callStatus, CallStatus::SUCCESS );
- }
-
-}
-
-
-MATCHER_P(IsSinkDataEqualTo, value, "") {
- auto lh = arg;
-
- bool bMainSoundProperties = lh.listMainSoundProperties.size() == value.listMainSoundProperties.size();
- for(int i=0; i<lh.listMainSoundProperties.size(); i++)
- {
- bMainSoundProperties &= (lh.listMainSoundProperties.at(i).type==value.listMainSoundProperties.at(i).type &&
- lh.listMainSoundProperties.at(i).value==value.listMainSoundProperties.at(i).value);
- }
-
- bool bSoundProperties = lh.listSoundProperties.size() == value.listSoundProperties.size();
- for(int i=0; i<lh.listSoundProperties.size(); i++)
- {
- bSoundProperties &= (lh.listSoundProperties.at(i).type==value.listSoundProperties.at(i).type &&
- lh.listSoundProperties.at(i).value==value.listSoundProperties.at(i).value);
- }
-
- bool bMainNotificationConfigurations = lh.listMainNotificationConfigurations.size() == value.listMainNotificationConfigurations.size();
- for(int i=0; i<lh.listMainNotificationConfigurations.size(); i++)
- {
- bMainNotificationConfigurations &= (lh.listMainNotificationConfigurations.at(i).type==value.listMainNotificationConfigurations.at(i).type &&
- lh.listMainNotificationConfigurations.at(i).status==value.listMainNotificationConfigurations.at(i).status &&
- lh.listMainNotificationConfigurations.at(i).parameter==value.listMainNotificationConfigurations.at(i).parameter);
- }
-
- bool bNotificationConfigurations = lh.listNotificationConfigurations.size() == value.listNotificationConfigurations.size();
- for(int i=0; i<lh.listNotificationConfigurations.size(); i++)
- {
- bNotificationConfigurations &= (lh.listNotificationConfigurations.at(i).type==value.listNotificationConfigurations.at(i).type &&
- lh.listNotificationConfigurations.at(i).status==value.listNotificationConfigurations.at(i).status &&
- lh.listNotificationConfigurations.at(i).parameter==value.listNotificationConfigurations.at(i).parameter);
- }
-
- return bMainSoundProperties &&
- bSoundProperties &&
- bNotificationConfigurations &&
- bMainNotificationConfigurations &&
- lh.sinkID == value.sinkID &&
- lh.name == value.name &&
- lh.domainID == value.domainID &&
- lh.sinkClassID == value.sinkClassID &&
- lh.volume == value.volume &&
- lh.visible == value.visible &&
- lh.available.availability == value.available.availability &&
- lh.available.availabilityReason == value.available.availabilityReason &&
- lh.muteState == value.muteState &&
- lh.mainVolume == value.mainVolume &&
- lh.listConnectionFormats == value.listConnectionFormats;
-}
-
-TEST_F(CAmRoutingInterfaceCAPITests, registerSink)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- CallStatus callStatus = CallStatus::NOT_AVAILABLE;
- org::genivi::am::am_Error_e error = org::genivi::am::am_Error_e::E_UNKNOWN;
-
- org::genivi::am::am_Sink_s sink;
- am_Sink_s amSink;
- org::genivi::am::am_sinkID_t sinkID = 0;
- initSink(sink, amSink, TEST_ID_2, sinkID);
-
- ON_CALL(*env->mpRoutingReceive, registerSink(_, _)).WillByDefault(Return(E_OK));
- EXPECT_CALL(*env->mpRoutingReceive, registerSink(IsSinkDataEqualTo(amSink), _)).WillOnce(DoAll(actionRegister(), Return(E_OK)));
- env->mProxy->registerSink(sink, callStatus, sinkID, error);
- ASSERT_EQ( sinkID, TEST_ID_1 );
- ASSERT_EQ( error, org::genivi::am::am_Error_e::E_OK );
- ASSERT_EQ( callStatus, CallStatus::SUCCESS );
- }
-
-}
-
-TEST_F(CAmRoutingInterfaceCAPITests, deregisterSink)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- CallStatus callStatus = CallStatus::NOT_AVAILABLE;
- org::genivi::am::am_Error_e error = org::genivi::am::am_Error_e::E_UNKNOWN;
- org::genivi::am::am_sinkID_t sinkID = TEST_ID_1;
-
- ON_CALL(*env->mpRoutingReceive, deregisterSink(_)).WillByDefault(Return(E_OK));
- EXPECT_CALL(*env->mpRoutingReceive, deregisterSink(sinkID)).WillOnce(Return(E_OK));
- env->mProxy->deregisterSink(sinkID, callStatus, error);
- ASSERT_EQ( error, org::genivi::am::am_Error_e::E_OK );
- ASSERT_EQ( callStatus, CallStatus::SUCCESS );
- }
-
-}
-
-TEST_F(CAmRoutingInterfaceCAPITests, peekSource)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- CallStatus callStatus = CallStatus::NOT_AVAILABLE;
- org::genivi::am::am_Error_e error = org::genivi::am::am_Error_e::E_UNKNOWN;
- std::string name("name");
- org::genivi::am::am_sourceID_t sinkID = 0;
- ON_CALL(*env->mpRoutingReceive, peekSource(_, _)).WillByDefault(Return(E_OK));
- EXPECT_CALL(*env->mpRoutingReceive, peekSource(name, _)).WillOnce(DoAll(actionPeek(), Return(E_OK)));
- env->mProxy->peekSource(name, callStatus, sinkID, error);
- ASSERT_EQ( sinkID, TEST_ID_1 );
- ASSERT_EQ( error, org::genivi::am::am_Error_e::E_OK );
- ASSERT_EQ( callStatus, CallStatus::SUCCESS );
- }
-
-}
-
-ACTION(actionRegisterSource){
- arg1=TEST_ID_1;
-}
-
-MATCHER_P(IsSourceDataEqualTo, value, "") {
- auto lh = arg;
-
- bool bMainSoundProperties = lh.listMainSoundProperties.size() == value.listMainSoundProperties.size();
- for(int i=0; i<lh.listMainSoundProperties.size(); i++)
- {
- bMainSoundProperties &= (lh.listMainSoundProperties.at(i).type==value.listMainSoundProperties.at(i).type &&
- lh.listMainSoundProperties.at(i).value==value.listMainSoundProperties.at(i).value);
- }
-
- bool bSoundProperties = lh.listSoundProperties.size() == value.listSoundProperties.size();
- for(int i=0; i<lh.listSoundProperties.size(); i++)
- {
- bSoundProperties &= (lh.listSoundProperties.at(i).type==value.listSoundProperties.at(i).type &&
- lh.listSoundProperties.at(i).value==value.listSoundProperties.at(i).value);
- }
-
- bool bMainNotificationConfigurations = lh.listMainNotificationConfigurations.size() == value.listMainNotificationConfigurations.size();
- for(int i=0; i<lh.listMainNotificationConfigurations.size(); i++)
- {
- bMainNotificationConfigurations &= (lh.listMainNotificationConfigurations.at(i).type==value.listMainNotificationConfigurations.at(i).type &&
- lh.listMainNotificationConfigurations.at(i).status==value.listMainNotificationConfigurations.at(i).status &&
- lh.listMainNotificationConfigurations.at(i).parameter==value.listMainNotificationConfigurations.at(i).parameter);
- }
-
- bool bNotificationConfigurations = lh.listNotificationConfigurations.size() == value.listNotificationConfigurations.size();
- for(int i=0; i<lh.listNotificationConfigurations.size(); i++)
- {
- bNotificationConfigurations &= (lh.listNotificationConfigurations.at(i).type==value.listNotificationConfigurations.at(i).type &&
- lh.listNotificationConfigurations.at(i).status==value.listNotificationConfigurations.at(i).status &&
- lh.listNotificationConfigurations.at(i).parameter==value.listNotificationConfigurations.at(i).parameter);
- }
- return bMainSoundProperties &&
- bSoundProperties &&
- bNotificationConfigurations &&
- bMainNotificationConfigurations &&
- lh.sourceID == value.sourceID &&
- lh.name == value.name &&
- lh.domainID == value.domainID &&
- lh.sourceClassID == value.sourceClassID &&
- lh.volume == value.volume &&
- lh.visible == value.visible &&
- lh.available.availability == value.available.availability &&
- lh.available.availabilityReason == value.available.availabilityReason &&
- lh.sourceState == value.sourceState &&
- lh.interruptState == value.interruptState &&
- lh.listConnectionFormats == value.listConnectionFormats;
-}
-
-TEST_F(CAmRoutingInterfaceCAPITests, registerSource)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- CallStatus callStatus = CallStatus::NOT_AVAILABLE;
- org::genivi::am::am_Error_e error = org::genivi::am::am_Error_e::E_UNKNOWN;
-
- org::genivi::am::am_Source_s source;
- am_Source_s amSource;
- org::genivi::am::am_sourceID_t sourceID = 0;
- initSource(source, amSource, TEST_ID_2, sourceID);
-
- ON_CALL(*env->mpRoutingReceive, registerSource(_, _)).WillByDefault(Return(E_OK));
- EXPECT_CALL(*env->mpRoutingReceive, registerSource(IsSourceDataEqualTo(amSource), _)).WillOnce(DoAll(actionRegister(), Return(E_OK)));
- env->mProxy->registerSource(source, callStatus, sourceID, error);
- ASSERT_EQ( sourceID, TEST_ID_1 );
- ASSERT_EQ( error, org::genivi::am::am_Error_e::E_OK );
- ASSERT_EQ( callStatus, CallStatus::SUCCESS );
- }
-
-}
-
-TEST_F(CAmRoutingInterfaceCAPITests, deregisterSource)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- CallStatus callStatus = CallStatus::NOT_AVAILABLE;
- org::genivi::am::am_Error_e error = org::genivi::am::am_Error_e::E_UNKNOWN;
- org::genivi::am::am_sourceID_t sinkID = TEST_ID_1;
-
- ON_CALL(*env->mpRoutingReceive, deregisterSource(_)).WillByDefault(Return(E_OK));
- EXPECT_CALL(*env->mpRoutingReceive, deregisterSource(sinkID)).WillOnce(Return(E_OK));
- env->mProxy->deregisterSource(sinkID, callStatus, error);
- ASSERT_EQ( error, org::genivi::am::am_Error_e::E_OK );
- ASSERT_EQ( callStatus, CallStatus::SUCCESS );
- }
-
-}
-
-ACTION(actionRegisterCrossfader){
- arg1=TEST_ID_1;
-}
-
-MATCHER_P(IsCrossfaderDataEqualTo, value, "") {
- auto lh = arg;
- return lh.crossfaderID == value.crossfaderID &&
- lh.name == value.name &&
- lh.sinkID_A == value.sinkID_A &&
- lh.sinkID_B == value.sinkID_B &&
- lh.sinkID_B == value.sinkID_B &&
- lh.sourceID == value.sourceID &&
- lh.hotSink == value.hotSink;
-}
-
-TEST_F(CAmRoutingInterfaceCAPITests, registerCrossfader)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- CallStatus callStatus = CallStatus::NOT_AVAILABLE;
- org::genivi::am::am_Error_e error = org::genivi::am::am_Error_e::E_UNKNOWN;
-
- org::genivi::am::am_crossfaderID_t crossfaderID = 0;
- org::genivi::am::am_Crossfader_s crossfader;
- am_Crossfader_s amCrossfader;
- initCrossfader(crossfader, amCrossfader, crossfaderID);
-
- ON_CALL(*env->mpRoutingReceive, registerCrossfader(_, _)).WillByDefault(Return(E_OK));
- EXPECT_CALL(*env->mpRoutingReceive, registerCrossfader(IsCrossfaderDataEqualTo(amCrossfader), _)).WillOnce(DoAll(actionRegister(), Return(E_OK)));
- env->mProxy->registerCrossfader(crossfader, callStatus, crossfaderID, error);
- ASSERT_EQ( crossfaderID, TEST_ID_1 );
- ASSERT_EQ( error, org::genivi::am::am_Error_e::E_OK );
- ASSERT_EQ( callStatus, CallStatus::SUCCESS );
- }
-
-}
-
-TEST_F(CAmRoutingInterfaceCAPITests, deregisterCrossfader)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- CallStatus callStatus = CallStatus::NOT_AVAILABLE;
- org::genivi::am::am_Error_e error = org::genivi::am::am_Error_e::E_UNKNOWN;
- org::genivi::am::am_crossfaderID_t crossfaderID = TEST_ID_1;
-
- ON_CALL(*env->mpRoutingReceive, deregisterCrossfader(_)).WillByDefault(Return(E_OK));
- EXPECT_CALL(*env->mpRoutingReceive, deregisterCrossfader(crossfaderID)).WillOnce(Return(E_OK));
- env->mProxy->deregisterCrossfader(crossfaderID, callStatus, error);
- ASSERT_EQ( error, org::genivi::am::am_Error_e::E_OK );
- ASSERT_EQ( callStatus, CallStatus::SUCCESS );
- }
-
-}
-
-TEST_F(CAmRoutingInterfaceCAPITests, peekSourceClassID)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- CallStatus callStatus = CallStatus::NOT_AVAILABLE;
- org::genivi::am::am_Error_e error = org::genivi::am::am_Error_e::E_UNKNOWN;
- std::string name("name");
- org::genivi::am::am_sourceClass_t sinkID = 0;
- ON_CALL(*env->mpRoutingReceive, peekSourceClassID(_, _)).WillByDefault(Return(E_OK));
- EXPECT_CALL(*env->mpRoutingReceive, peekSourceClassID(name, _)).WillOnce(DoAll(actionPeek(), Return(E_OK)));
- env->mProxy->peekSourceClassID(name, callStatus, sinkID, error);
- ASSERT_EQ( sinkID, TEST_ID_1 );
- ASSERT_EQ( error, org::genivi::am::am_Error_e::E_OK );
- ASSERT_EQ( callStatus, CallStatus::SUCCESS );
- }
-
-}
-
-TEST_F(CAmRoutingInterfaceCAPITests, peekSinkClassID)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- CallStatus callStatus = CallStatus::NOT_AVAILABLE;
- org::genivi::am::am_Error_e error = org::genivi::am::am_Error_e::E_UNKNOWN;
- std::string name("name");
- org::genivi::am::am_sinkClass_t sinkID = 0;
- ON_CALL(*env->mpRoutingReceive, peekSinkClassID(_, _)).WillByDefault(Return(E_OK));
- EXPECT_CALL(*env->mpRoutingReceive, peekSinkClassID(name, _)).WillOnce(DoAll(actionPeek(), Return(E_OK)));
- env->mProxy->peekSinkClassID(name, callStatus, sinkID, error);
- ASSERT_EQ( sinkID, TEST_ID_1 );
- ASSERT_EQ( error, org::genivi::am::am_Error_e::E_OK );
- ASSERT_EQ( callStatus, CallStatus::SUCCESS );
- }
-
-}
-
-TEST_F(CAmRoutingInterfaceCAPITests, hookInterruptStatusChange)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- CallStatus callStatus = CallStatus::NOT_AVAILABLE;
- am_Error_e error = E_OK;
- org::genivi::am::am_sourceID_t sourceID = TEST_ID_1;
- am_InterruptState_e interruptState = am_InterruptState_e::IS_MAX;
- org::genivi::am::am_InterruptState_e CAPIInterruptState=static_cast<org::genivi::am::am_InterruptState_e>(interruptState);
- EXPECT_CALL(*env->mpRoutingReceive, hookInterruptStatusChange(sourceID, interruptState)).Times(1);
- env->mProxy->hookInterruptStatusChange(sourceID, CAPIInterruptState, callStatus);
- ASSERT_EQ( callStatus, CallStatus::SUCCESS );
- }
-
-}
-
-TEST_F(CAmRoutingInterfaceCAPITests, hookDomainRegistrationComplete)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- CallStatus callStatus = CallStatus::NOT_AVAILABLE;
- am_Error_e error = E_OK;
- org::genivi::am::am_domainID_t testID = TEST_ID_1;
- EXPECT_CALL(*env->mpRoutingReceive, hookDomainRegistrationComplete(testID)).Times(1);
- env->mProxy->hookDomainRegistrationComplete(testID, callStatus);
- ASSERT_EQ( callStatus, CallStatus::SUCCESS );
- }
-
-}
-
-MATCHER_P(IsAvailabilityEqualTo, value, "") {
- am_Availability_s lh = arg;
- return lh.availability == value.availability &&
- lh.availabilityReason == value.availabilityReason;
-}
-
-TEST_F(CAmRoutingInterfaceCAPITests, hookSinkAvailablityStatusChange)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- CallStatus callStatus = CallStatus::NOT_AVAILABLE;
- am_Error_e error = E_OK;
- org::genivi::am::am_sinkID_t testID = TEST_ID_1;
-
- org::genivi::am::am_Availability_s available(org::genivi::am::am_Availability_e::A_MAX, AR_UNKNOWN);
- am_Availability_s amAvailable;
- CAmConvertCAPI2AM(available, amAvailable);
-
- EXPECT_CALL(*env->mpRoutingReceive, hookSinkAvailablityStatusChange(testID, IsAvailabilityEqualTo(amAvailable))).Times(1);
- env->mProxy->hookSinkAvailablityStatusChange(testID, available, callStatus);
- ASSERT_EQ( callStatus, CallStatus::SUCCESS );
- }
-
-}
-
-TEST_F(CAmRoutingInterfaceCAPITests, hookSourceAvailablityStatusChange)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- CallStatus callStatus = CallStatus::NOT_AVAILABLE;
- am_Error_e error = E_OK;
- org::genivi::am::am_sourceID_t testID = TEST_ID_1;
-
- org::genivi::am::am_Availability_s available(org::genivi::am::am_Availability_e::A_MAX, AR_UNKNOWN);
- am_Availability_s amAvailable;
- CAmConvertCAPI2AM(available, amAvailable);
-
- EXPECT_CALL(*env->mpRoutingReceive, hookSourceAvailablityStatusChange(testID, IsAvailabilityEqualTo(amAvailable))).Times(1);
- env->mProxy->hookSourceAvailablityStatusChange(testID, available, callStatus);
- ASSERT_EQ( callStatus, CallStatus::SUCCESS );
- }
-
-}
-
-TEST_F(CAmRoutingInterfaceCAPITests, hookDomainStateChange)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- CallStatus callStatus = CallStatus::NOT_AVAILABLE;
- am_Error_e error = E_OK;
- org::genivi::am::am_domainID_t testID = TEST_ID_1;
- org::genivi::am::am_DomainState_e domainState = org::genivi::am::am_DomainState_e::DS_MAX;
- EXPECT_CALL(*env->mpRoutingReceive, hookDomainStateChange(testID, (am_DomainState_e)domainState)).Times(1);
- env->mProxy->hookDomainStateChange(testID, domainState, callStatus);
- ASSERT_EQ( callStatus, CallStatus::SUCCESS );
- }
-
-}
-
-TEST_F(CAmRoutingInterfaceCAPITests, hookTimingInformationChanged)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- CallStatus callStatus = CallStatus::NOT_AVAILABLE;
- am_Error_e error = E_OK;
- org::genivi::am::am_connectionID_t testID = TEST_ID_1;
- int16_t delay = 10;
- org::genivi::am::am_DomainState_e domainState = org::genivi::am::am_DomainState_e::DS_MAX;
- EXPECT_CALL(*env->mpRoutingReceive, hookTimingInformationChanged(testID, delay)).Times(1);
- env->mProxy->hookTimingInformationChanged(testID, delay, callStatus);
- ASSERT_EQ( callStatus, CallStatus::SUCCESS );
- }
-
-}
-
-MATCHER_P(IsEarlyDataEqualTo, value, "") {
-
- std::vector<am_EarlyData_s> lh = arg;
- bool result = lh.size() == value.size();
- for(int i=0; result && i<lh.size(); i++)
- {
- am_EarlyData_s ed_lh = lh.at(i);
- org::genivi::am::am_EarlyData_s ed_rh = value.at(i);
- if(ed_lh.type != static_cast<am_EarlyDataType_e>(ed_rh.type))
- {
- result = false;
- break;
- }
- else
- {
- if(ed_lh.type==ED_SINK_VOLUME)
- {
- result &= ed_lh.data.volume == ed_rh.data.get<org::genivi::am::am_volume_t>();
- result &= ed_lh.sinksource.sink == ed_rh.sinksource.get<org::genivi::am::am_sinkID_t>();
- }
- else if(ed_lh.type==ED_SINK_PROPERTY)
- {
- org::genivi::am::am_SoundProperty_s soundproperty=ed_rh.data.get<org::genivi::am::am_SoundProperty_s>();
- result &= ed_lh.data.soundProperty.type == soundproperty.type;
- result &= ed_lh.data.soundProperty.value == soundproperty.value;
- result &= ed_lh.sinksource.sink == ed_rh.sinksource.get<org::genivi::am::am_sinkID_t>();
- }
- else if(ed_lh.type==ED_SOURCE_VOLUME)
- {
- result &= ed_lh.data.volume == ed_rh.data.get<org::genivi::am::am_volume_t>();
- result &= ed_lh.sinksource.source == ed_rh.sinksource.get<org::genivi::am::am_sourceID_t>();
- }
- else if(ed_lh.type==ED_SOURCE_PROPERTY)
- {
- org::genivi::am::am_SoundProperty_s soundproperty=ed_rh.data.get<org::genivi::am::am_SoundProperty_s>();
- result &= ed_lh.data.soundProperty.type == soundproperty.type;
- result &= ed_lh.data.soundProperty.value == soundproperty.value;
- result &= ed_lh.sinksource.source == ed_rh.sinksource.get<org::genivi::am::am_sinkID_t>();
- }
- else
- {
- result = false;
- break;
- }
- }
- }
-
- return result;
-}
-
-TEST_F(CAmRoutingInterfaceCAPITests, sendChangedData)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- CallStatus callStatus = CallStatus::NOT_AVAILABLE;
- am_Error_e error = E_OK;
- org::genivi::am::am_connectionID_t testID = TEST_ID_1;
- org::genivi::am::am_EarlyData_L earlyData;
-
- org::genivi::am::am_DataType_u dt11(static_cast<org::genivi::am::am_sinkID_t>(103));
- org::genivi::am::am_EarlyData_u ed11(static_cast<org::genivi::am::am_volume_t>(50));
- earlyData.push_back(org::genivi::am::am_EarlyData_s(org::genivi::am::am_EarlyDataType_e::ED_SINK_VOLUME,
- dt11,
- ed11));
- org::genivi::am::am_DataType_u dt12(static_cast<org::genivi::am::am_sinkID_t>(104));
- earlyData.push_back(org::genivi::am::am_EarlyData_s(org::genivi::am::am_EarlyDataType_e::ED_SINK_VOLUME,
- dt12,
- ed11));
-
- org::genivi::am::am_DataType_u dt13(static_cast<org::genivi::am::am_sinkID_t>(105));
- org::genivi::am::am_EarlyData_u ed12(org::genivi::am::am_SoundProperty_s(SP_UNKNOWN, 50));
- earlyData.push_back(org::genivi::am::am_EarlyData_s(org::genivi::am::am_EarlyDataType_e::ED_SINK_PROPERTY,
- dt13,
- ed12));
- org::genivi::am::am_DataType_u dt14(static_cast<org::genivi::am::am_sinkID_t>(106));
- earlyData.push_back(org::genivi::am::am_EarlyData_s(org::genivi::am::am_EarlyDataType_e::ED_SINK_PROPERTY,
- dt14,
- ed12));
-
- EXPECT_CALL(*env->mpRoutingReceive, sendChangedData(IsEarlyDataEqualTo(earlyData))).Times(1);
-
- env->mProxy->sendChangedData(earlyData, callStatus);
- }
-
-}
-
-TEST_F(CAmRoutingInterfaceCAPITests, updateGateway)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- CallStatus callStatus = CallStatus::NOT_AVAILABLE;
- am_Error_e error = E_OK;
- org::genivi::am::am_gatewayID_t testID = TEST_ID_1;
-
- org::genivi::am::am_ConnectionFormat_L listSourceFormats;
- listSourceFormats.push_back(static_cast<org::genivi::am::am_CustomConnectionFormat_t>(CF_GENIVI_ANALOG));
- listSourceFormats.push_back(static_cast<org::genivi::am::am_CustomConnectionFormat_t>(CF_GENIVI_AUTO));
-
- org::genivi::am::am_ConnectionFormat_L listSinkFormats;
- listSinkFormats.push_back(static_cast<org::genivi::am::am_CustomConnectionFormat_t>(CF_GENIVI_AUTO));
- listSinkFormats.push_back(static_cast<org::genivi::am::am_CustomConnectionFormat_t>(CF_GENIVI_ANALOG));
-
- org::genivi::am::am_Convertion_L convertionMatrix;
- convertionMatrix.push_back(1);
- convertionMatrix.push_back(0);
-
- std::vector<am_CustomConnectionFormat_t> am_listSourceFormats;
- am_listSourceFormats.push_back(CF_GENIVI_ANALOG);
- am_listSourceFormats.push_back(CF_GENIVI_AUTO);
-
- std::vector<am_CustomConnectionFormat_t> am_listSinkFormats;
- am_listSinkFormats.push_back(CF_GENIVI_AUTO);
- am_listSinkFormats.push_back(CF_GENIVI_ANALOG);
-
- std::vector<bool> am_convertionMatrix;
- am_convertionMatrix.push_back(1);
- am_convertionMatrix.push_back(0);
- ON_CALL(*env->mpRoutingReceive, updateGateway(_, _, _, _)).WillByDefault(Return(E_OK));
- EXPECT_CALL(*env->mpRoutingReceive, updateGateway(testID, am_listSourceFormats, am_listSinkFormats, am_convertionMatrix)).Times(1);
-
- org::genivi::am::am_Error_e CAPIError;
- env->mProxy->updateGateway(testID, listSourceFormats, listSinkFormats, convertionMatrix, callStatus,CAPIError);
- ASSERT_EQ( callStatus, CallStatus::SUCCESS );
- }
-
-}
-
-TEST_F(CAmRoutingInterfaceCAPITests, updateConverter)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- CallStatus callStatus = CallStatus::NOT_AVAILABLE;
- am_Error_e error = E_OK;
- org::genivi::am::am_converterID_t testID = TEST_ID_1;
-
- org::genivi::am::am_ConnectionFormat_L listSourceFormats;
- listSourceFormats.push_back(static_cast<org::genivi::am::am_CustomConnectionFormat_t>(CF_GENIVI_ANALOG));
- listSourceFormats.push_back(static_cast<org::genivi::am::am_CustomConnectionFormat_t>(CF_GENIVI_AUTO));
-
- org::genivi::am::am_ConnectionFormat_L listSinkFormats;
- listSinkFormats.push_back(static_cast<org::genivi::am::am_CustomConnectionFormat_t>(CF_GENIVI_AUTO));
- listSinkFormats.push_back(static_cast<org::genivi::am::am_CustomConnectionFormat_t>(CF_GENIVI_ANALOG));
-
- org::genivi::am::am_Convertion_L convertionMatrix;
- convertionMatrix.push_back(1);
- convertionMatrix.push_back(0);
-
- std::vector<am_CustomConnectionFormat_t> am_listSourceFormats;
- am_listSourceFormats.push_back(CF_GENIVI_ANALOG);
- am_listSourceFormats.push_back(CF_GENIVI_AUTO);
-
- std::vector<am_CustomConnectionFormat_t> am_listSinkFormats;
- am_listSinkFormats.push_back(CF_GENIVI_AUTO);
- am_listSinkFormats.push_back(CF_GENIVI_ANALOG);
-
- std::vector<bool> am_convertionMatrix;
- am_convertionMatrix.push_back(1);
- am_convertionMatrix.push_back(0);
- ON_CALL(*env->mpRoutingReceive, updateConverter(_, _, _, _)).WillByDefault(Return(E_OK));
- EXPECT_CALL(*env->mpRoutingReceive, updateConverter(testID, am_listSourceFormats, am_listSinkFormats, am_convertionMatrix)).Times(1);
-
- org::genivi::am::am_Error_e CAPIError;
- env->mProxy->updateConverter(testID, listSourceFormats, listSinkFormats, convertionMatrix, callStatus,CAPIError);
- ASSERT_EQ( callStatus, CallStatus::SUCCESS );
- }
-
-}
-
-MATCHER_P(IsSoundPropertiesArrayEqualTo, value, "") {
- auto lh = arg;
-
- bool bSoundProperties = lh.size() == value.size();
- for(int i=0; i<lh.size(); i++)
- {
- bSoundProperties &= (lh.at(i).type==value.at(i).type &&
- lh.at(i).value==value.at(i).value);
- }
- return bSoundProperties;
-}
-
-void prepareArrays( org::genivi::am::am_SoundProperty_L & listSoundProperties,
- org::genivi::am::am_ConnectionFormat_L & listSinkFormats,
- org::genivi::am::am_MainSoundProperty_L & listMainSoundProperties,
- std::vector<am_CustomConnectionFormat_t> & am_listSinkFormats,
- std::vector<am_SoundProperty_s> & am_listSoundProperties,
- std::vector<am_MainSoundProperty_s> & am_listMainSoundProperties)
-{
- listSoundProperties.push_back(org::genivi::am::am_SoundProperty_s(SP_UNKNOWN, 50));
- listSoundProperties.push_back(org::genivi::am::am_SoundProperty_s(SP_UNKNOWN, 51));
-
- listSinkFormats.push_back(static_cast<org::genivi::am::am_CustomConnectionFormat_t>(CF_GENIVI_AUTO));
- listSinkFormats.push_back(static_cast<org::genivi::am::am_CustomConnectionFormat_t>(CF_GENIVI_ANALOG));
-
- listMainSoundProperties.push_back(org::genivi::am::am_MainSoundProperty_s(MSP_UNKNOWN, 50));
- listMainSoundProperties.push_back(org::genivi::am::am_MainSoundProperty_s(MSP_UNKNOWN, 51));
-
- am_listSinkFormats.push_back(CF_GENIVI_AUTO);
- am_listSinkFormats.push_back(CF_GENIVI_ANALOG);
-
- am_listSoundProperties.push_back((am_SoundProperty_s){SP_UNKNOWN, 50});
- am_listSoundProperties.push_back((am_SoundProperty_s){SP_UNKNOWN, 51});
-
- am_listMainSoundProperties.push_back((am_MainSoundProperty_s){MSP_UNKNOWN, 50});
- am_listMainSoundProperties.push_back((am_MainSoundProperty_s){MSP_UNKNOWN, 51});
-}
-
-TEST_F(CAmRoutingInterfaceCAPITests, updateSink)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- CallStatus callStatus = CallStatus::NOT_AVAILABLE;
- am_Error_e error = E_OK;
- org::genivi::am::am_sinkID_t testID = TEST_ID_1;
-
- org::genivi::am::am_SoundProperty_L listSoundProperties;
- org::genivi::am::am_ConnectionFormat_L listSinkFormats;
- org::genivi::am::am_MainSoundProperty_L listMainSoundProperties;
- std::vector<am_CustomConnectionFormat_t> am_listSinkFormats;
- std::vector<am_SoundProperty_s> am_listSoundProperties;
- std::vector<am_MainSoundProperty_s> am_listMainSoundProperties;
- prepareArrays(listSoundProperties, listSinkFormats, listMainSoundProperties, am_listSinkFormats, am_listSoundProperties, am_listMainSoundProperties);
-
- ON_CALL(*env->mpRoutingReceive, updateSink(_, _, _, _, _)).WillByDefault(Return(E_OK));
- EXPECT_CALL(*env->mpRoutingReceive, updateSink(testID, TEST_ID_2, IsSoundPropertiesArrayEqualTo(am_listSoundProperties), am_listSinkFormats, IsSoundPropertiesArrayEqualTo(am_listMainSoundProperties))).Times(1);
- org::genivi::am::am_Error_e CAPIError;
- env->mProxy->updateSink(testID, TEST_ID_2, listSoundProperties, listSinkFormats, listMainSoundProperties, callStatus,CAPIError);
- ASSERT_EQ( callStatus, CallStatus::SUCCESS );
- }
-
-}
-
-TEST_F(CAmRoutingInterfaceCAPITests, updateSource)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- CallStatus callStatus = CallStatus::NOT_AVAILABLE;
- am_Error_e error = E_OK;
- org::genivi::am::am_sourceID_t testID = TEST_ID_1;
-
- org::genivi::am::am_SoundProperty_L listSoundProperties;
- org::genivi::am::am_ConnectionFormat_L listSinkFormats;
- org::genivi::am::am_MainSoundProperty_L listMainSoundProperties;
- std::vector<am_CustomConnectionFormat_t> am_listSinkFormats;
- std::vector<am_SoundProperty_s> am_listSoundProperties;
- std::vector<am_MainSoundProperty_s> am_listMainSoundProperties;
- prepareArrays(listSoundProperties, listSinkFormats, listMainSoundProperties, am_listSinkFormats, am_listSoundProperties, am_listMainSoundProperties);
-
- ON_CALL(*env->mpRoutingReceive, updateSource(_, _, _, _, _)).WillByDefault(Return(E_OK));
- EXPECT_CALL(*env->mpRoutingReceive, updateSource(testID, TEST_ID_2, IsSoundPropertiesArrayEqualTo(am_listSoundProperties), am_listSinkFormats, IsSoundPropertiesArrayEqualTo(am_listMainSoundProperties))).Times(1);
- org::genivi::am::am_Error_e CAPIError;
- env->mProxy->updateSource(testID, TEST_ID_2, listSoundProperties, listSinkFormats, listMainSoundProperties, callStatus,CAPIError);
- ASSERT_EQ( callStatus, CallStatus::SUCCESS );
- }
-
-}
-
-
-MATCHER_P2(IsSinkVolumeArrayEqualTo, value, isSink, "") {
-
- std::vector<am_Volumes_s> lh = arg;
- bool bResult = lh.size() == value.size();
- for(int i=0; i<lh.size(); i++)
- {
- bResult &= (((isSink && lh.at(i).volumeID.sink==value.at(i).volumeID.sink) || (!isSink && lh.at(i).volumeID.source==value.at(i).volumeID.source)) &&
- lh.at(i).volume==value.at(i).volume &&
- lh.at(i).ramp==value.at(i).ramp &&
- lh.at(i).time==value.at(i).time);
- }
- return bResult;
-}
-
-MATCHER_P(IsHandleStructEqualTo, value, "") {
- am_Handle_s lh = arg;
- return lh.handle==value.handle &&
- lh.handleType==value.handleType ;
-}
-
-TEST_F(CAmRoutingInterfaceCAPITests, ackSetVolumes)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- CallStatus callStatus = CallStatus::NOT_AVAILABLE;
- uint16_t error = (uint16_t)E_OK;
- uint16_t testID = 10;
- org::genivi::am::am_Volumes_L listVolumes;
- org::genivi::am::am_DataType_u dt(static_cast<org::genivi::am::am_sinkID_t>(103));
- listVolumes.push_back(org::genivi::am::am_Volumes_s(org::genivi::am::am_VolumeType_e::VT_MAX,
- dt,
- 50,
- static_cast<org::genivi::am::am_CustomRampType_t>(RAMP_GENIVI_DIRECT),
- 50));
-
- std::vector<am_Volumes_s> am_listVolumes;
- am_DataType_u dt1;
- dt1.sink = 103;
- am_listVolumes.push_back((am_Volumes_s){VT_MAX,
- dt1,
- 50,
- RAMP_GENIVI_DIRECT,
- 50});
-
- am_Handle_s handle_s;
- handle_s.handle = 10;
- handle_s.handleType = H_SETVOLUMES;
- org::genivi::am::am_Handle_s handle;
- CAmConvertAM2CAPI(handle_s,handle);
- org::genivi::am::am_Error_e genError(org::genivi::am::am_Error_e::E_OK);
- EXPECT_CALL(*env->mpRoutingReceive, ackSetVolumes(IsHandleStructEqualTo(handle_s), IsSinkVolumeArrayEqualTo(am_listVolumes, true), E_OK)).Times(1);
- env->mProxy->ackSetVolumes(handle, listVolumes, genError, callStatus);
- ASSERT_EQ( callStatus, CallStatus::SUCCESS );
- }
-
-}
-
-TEST_F(CAmRoutingInterfaceCAPITests, ackSinkNotificationConfiguration)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- CallStatus callStatus = CallStatus::NOT_AVAILABLE;
- org::genivi::am::am_Error_e error = org::genivi::am::am_Error_e::E_OK;
- uint16_t testID = TEST_ID_1;
- am_Handle_s handle_s;
- handle_s.handle = testID;
- handle_s.handleType = H_CONNECT;
- org::genivi::am::am_Handle_s CAPIHandle;
- CAmConvertAM2CAPI(handle_s,CAPIHandle);
- org::genivi::am::am_Error_e genError(org::genivi::am::am_Error_e::E_OK);
- EXPECT_CALL(*env->mpRoutingReceive, ackSinkNotificationConfiguration(IsHandleStructEqualTo(handle_s), (am_Error_e)error)).Times(1);
- env->mProxy->ackSinkNotificationConfiguration(CAPIHandle, genError, callStatus);
- ASSERT_EQ( callStatus, CallStatus::SUCCESS );
- }
-
-}
-
-TEST_F(CAmRoutingInterfaceCAPITests, ackSourceNotificationConfiguration)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- CallStatus callStatus = CallStatus::NOT_AVAILABLE;
- org::genivi::am::am_Error_e error = org::genivi::am::am_Error_e::E_OK;
- uint16_t testID = TEST_ID_1;
- am_Handle_s handle_s;
- handle_s.handle = testID;
- handle_s.handleType = H_CONNECT;
- org::genivi::am::am_Handle_s CAPIHandle;
- CAmConvertAM2CAPI(handle_s,CAPIHandle);
- org::genivi::am::am_Error_e genError(org::genivi::am::am_Error_e::E_OK);
- EXPECT_CALL(*env->mpRoutingReceive, ackSourceNotificationConfiguration(IsHandleStructEqualTo(handle_s), (am_Error_e)error)).Times(1);
- env->mProxy->ackSourceNotificationConfiguration(CAPIHandle, genError, callStatus);
- ASSERT_EQ( callStatus, CallStatus::SUCCESS );
- }
-
-}
-
-MATCHER_P(IsPayloadEqualTo, value, "") {
-
- auto lh = arg;
- return lh.type == value.type && lh.value == value.value;
-}
-
-
-TEST_F(CAmRoutingInterfaceCAPITests, hookSinkNotificationDataChange)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- CallStatus callStatus = CallStatus::NOT_AVAILABLE;
- am_Error_e error = E_OK;
- org::genivi::am::am_sinkID_t testID = TEST_ID_1;
- org::genivi::am::am_NotificationPayload_s payload(NT_UNKNOWN, 50);
-
- am_NotificationPayload_s am_payload = (am_NotificationPayload_s){NT_UNKNOWN, 50};
-
- EXPECT_CALL(*env->mpRoutingReceive, hookSinkNotificationDataChange(testID, IsPayloadEqualTo(am_payload))).Times(1);
- env->mProxy->hookSinkNotificationDataChange(testID, payload, callStatus);
- ASSERT_EQ( callStatus, CallStatus::SUCCESS );
- }
-
-}
-
-TEST_F(CAmRoutingInterfaceCAPITests, hookSourceNotificationDataChange)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- CallStatus callStatus = CallStatus::NOT_AVAILABLE;
- am_Error_e error = E_OK;
- org::genivi::am::am_sourceID_t testID = TEST_ID_1;
- org::genivi::am::am_NotificationPayload_s payload(NT_UNKNOWN, 50);
-
- am_NotificationPayload_s am_payload = (am_NotificationPayload_s){NT_UNKNOWN, 50};
-
- EXPECT_CALL(*env->mpRoutingReceive, hookSourceNotificationDataChange(testID, IsPayloadEqualTo(am_payload))).Times(1);
- env->mProxy->hookSourceNotificationDataChange(testID, payload, callStatus);
- ASSERT_EQ( callStatus, CallStatus::SUCCESS );
- }
-
-}
-
-ACTION(actionRegister2){
- arg1=TEST_ID_2;
-}
-
-TEST_F(CAmRoutingInterfaceCAPITests, confirmRoutingRundown)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- CallStatus callStatus = CallStatus::NOT_AVAILABLE, domainstatus = CallStatus::NOT_AVAILABLE;
- org::genivi::am::am_domainID_t domainID;
- am_Error_e error = E_OK;
- org::genivi::am::am_Error_e CAPIError;
- std::string name("test domain name");
- std::string busname("busname");
- std::string nodename("nodename");
- org::genivi::am::am_Domain_s domainData(0, name, busname, nodename, false, false, org::genivi::am::am_DomainState_e::DS_CONTROLLED);
- ON_CALL(*env->mpRoutingReceive, registerDomain(_,_)).WillByDefault(Return(E_OK));
- EXPECT_CALL(*env->mpRoutingReceive, registerDomain(_, _));
- env->mProxy->registerDomain(domainData,"sd","sd",domainstatus,domainID,CAPIError);
- ASSERT_EQ( domainstatus, CallStatus::SUCCESS );
- env->mpPlugin->setRoutingRundown(5);
- EXPECT_CALL(*env->mpRoutingReceive, confirmRoutingRundown(5,E_OK)).Times(1);
- env->mProxy->confirmRoutingRundown(name, callStatus);
- EXPECT_CALL(*env->mpRoutingReceive, deregisterDomain(_));
- env->mProxy->deregisterDomain(domainID,domainstatus,CAPIError);
- ASSERT_EQ( callStatus, CallStatus::SUCCESS );
- }
-
-}
-
-/** CAmRoutingSenderCAPITests
- * The following methods must be executed in the given order.
- * It is important that the TestDomain_register* methods are executed first because they make domain, sink, source and crossfader registrations.
- * The last couple of methods are TestDomain_deregister* methods which check whether the 'deregistration' functionality works properly.
- */
-
-TEST_F(CAmRoutingSenderCAPITests, TestDomain_registerDomain)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- IAmRoutingSenderBackdoor backdoor(env->mpPlugin);
- ASSERT_FALSE( backdoor.containsDomainWithID( (const am_domainID_t)TEST_ID_1) );
-
- CallStatus callStatus = CallStatus::NOT_AVAILABLE;
- org::genivi::am::am_Error_e error = org::genivi::am::am_Error_e::E_UNKNOWN;
- org::genivi::am::am_domainID_t domainID = 0;
- org::genivi::am::am_Domain_s domainData;
- domainData.name = "TestDomain";
- domainData.busname ="TestDomain";
- domainData.complete = true;
- domainData.domainID = domainID;
- domainData.early = false;
- domainData.nodename = "Test";
- domainData.state = org::genivi::am::am_DomainState_e::DS_CONTROLLED;
-
- am::am_Domain_s amDomainData;
- CAmConvertCAPI2AM(domainData, amDomainData);
-
- ON_CALL(*env->mpRoutingReceive, registerDomain(_, _)).WillByDefault(Return(E_OK));
-
- EXPECT_CALL(*env->mpRoutingReceive, registerDomain(IsDomainDataEqualTo(amDomainData), _)).WillOnce(DoAll(actionRegister(), Return(E_OK)));
- env->mProxy->registerDomain(domainData,
- CAPI_SENDER_INSTANCE,
- CAPI_SENDER_INTERFACE,
- callStatus,
- domainID,
- error);
- usleep(50000);
- ASSERT_EQ( callStatus, CallStatus::SUCCESS );
- ASSERT_EQ( error, org::genivi::am::am_Error_e::E_OK );
- ASSERT_EQ( domainID, TEST_ID_1 );
- ASSERT_TRUE( backdoor.containsDomainWithID(domainID) );
-
- domainID = 0;
- domainData.domainID = 0;
- domainData.name = "TestDomain2";
- domainData.busname ="TestDomain2";
- CAmConvertCAPI2AM(domainData, amDomainData);
- EXPECT_CALL(*env->mpRoutingReceive, registerDomain(IsDomainDataEqualTo(amDomainData), _)).WillOnce(DoAll(actionRegister2(), Return(E_OK)));
- env->mProxy->registerDomain(domainData,
- CAPI_SENDER_INSTANCE,
- CAPI_SENDER_INTERFACE,
- callStatus,
- domainID,
- error);
- usleep(50000);
- ASSERT_EQ( callStatus, CallStatus::SUCCESS );
- ASSERT_EQ( error, org::genivi::am::am_Error_e::E_OK );
- ASSERT_EQ( domainID, TEST_ID_2 );
- ASSERT_TRUE( backdoor.domainsCount()==2 );
- ASSERT_TRUE( backdoor.containsDomainWithID( (const am_domainID_t)TEST_ID_1) );
- ASSERT_TRUE( backdoor.containsDomainWithID( (const am_domainID_t)TEST_ID_2) );
- ASSERT_FALSE( backdoor.containsDomainWithID( (const am_domainID_t)10000) );
- }
-
-}
-
-TEST_F(CAmRoutingSenderCAPITests, TestDomain_registerSource)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- const org::genivi::am::am_domainID_t domainID = TEST_ID_1;
- IAmRoutingSenderBackdoor backdoor(env->mpPlugin);
- ASSERT_TRUE( backdoor.containsDomainWithID( (const am_domainID_t)domainID) );
-
- CallStatus callStatus = CallStatus::NOT_AVAILABLE;
- org::genivi::am::am_Error_e error = org::genivi::am::am_Error_e::E_UNKNOWN;
-
- org::genivi::am::am_Source_s source;
- am_Source_s amSource;
- org::genivi::am::am_sourceID_t sinkID = 0;
- initSource(source, amSource, domainID, sinkID);
-
- ON_CALL(*env->mpRoutingReceive, registerSource(_, _)).WillByDefault(Return(E_OK));
- EXPECT_CALL(*env->mpRoutingReceive, registerSource(IsSourceDataEqualTo(amSource), _)).WillOnce(DoAll(actionRegister(), Return(E_OK)));
- env->mProxy->registerSource(source, callStatus, sinkID, error);
- usleep(50000);
- ASSERT_EQ( sinkID, TEST_ID_1 );
- ASSERT_EQ( error, org::genivi::am::am_Error_e::E_OK );
- ASSERT_EQ( callStatus, CallStatus::SUCCESS );
- ASSERT_TRUE( backdoor.containsSourceWithID( (const am_sourceID_t)TEST_ID_1) );
-
- initSource(source, amSource, domainID, sinkID);
- EXPECT_CALL(*env->mpRoutingReceive, registerSource(IsSourceDataEqualTo(amSource), _)).WillOnce(DoAll(actionRegister2(), Return(E_OK)));
- env->mProxy->registerSource(source, callStatus, sinkID, error);
- usleep(50000);
- ASSERT_EQ( callStatus, CallStatus::SUCCESS );
- ASSERT_EQ( error, org::genivi::am::am_Error_e::E_OK );
- ASSERT_EQ( sinkID, TEST_ID_2 );
- ASSERT_TRUE( backdoor.containsSourceWithID( (const am_sourceID_t)TEST_ID_2) );
- ASSERT_TRUE( backdoor.sourcesCount()==2 );
- }
-
-}
-
-
-
-TEST_F(CAmRoutingSenderCAPITests, TestDomain_registerSink)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- const org::genivi::am::am_domainID_t domainID = TEST_ID_1;
- IAmRoutingSenderBackdoor backdoor(env->mpPlugin);
- ASSERT_TRUE( backdoor.containsDomainWithID( (const am_domainID_t)domainID) );
-
- CallStatus callStatus = CallStatus::NOT_AVAILABLE;
- org::genivi::am::am_Error_e error = org::genivi::am::am_Error_e::E_UNKNOWN;
-
- org::genivi::am::am_Sink_s sink;
- am_Sink_s amSink;
- org::genivi::am::am_sinkID_t sinkID = 0;
- initSink(sink, amSink, domainID, sinkID);
-
- ON_CALL(*env->mpRoutingReceive, registerSink(_, _)).WillByDefault(Return(E_OK));
- EXPECT_CALL(*env->mpRoutingReceive, registerSink(IsSinkDataEqualTo(amSink), _)).WillOnce(DoAll(actionRegister(), Return(E_OK)));
- env->mProxy->registerSink(sink, callStatus, sinkID, error);
-
- usleep(50000);
- ASSERT_EQ( callStatus, CallStatus::SUCCESS );
- ASSERT_EQ( error, org::genivi::am::am_Error_e::E_OK );
- ASSERT_EQ( sinkID, TEST_ID_1 );
- ASSERT_TRUE( backdoor.containsSinkWithID( (const am_sourceID_t)TEST_ID_1) );
-
- initSink(sink, amSink, TEST_ID_1, 0);
- EXPECT_CALL(*env->mpRoutingReceive, registerSink(IsSinkDataEqualTo(amSink), _)).WillOnce(DoAll(actionRegister2(), Return(E_OK)));
- env->mProxy->registerSink(sink, callStatus, sinkID, error);
-
- usleep(50000);
- ASSERT_EQ( callStatus, CallStatus::SUCCESS );
- ASSERT_EQ( error, org::genivi::am::am_Error_e::E_OK );
- ASSERT_EQ( sinkID, TEST_ID_2 );
- ASSERT_TRUE( backdoor.containsSinkWithID( (const am_sourceID_t)TEST_ID_2) );
- ASSERT_TRUE( backdoor.sinksCount()==2 );
- }
-
-}
-
-TEST_F(CAmRoutingSenderCAPITests, TestDomain_setDomainState)
-{
-//todo: Decide how to test
-}
-
-TEST_F(CAmRoutingSenderCAPITests, TestDomain_asyncSetSourceState)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- const org::genivi::am::am_domainID_t domainID = TEST_ID_1;
- const org::genivi::am::am_sourceID_t sID = TEST_ID_1;
- IAmRoutingSenderBackdoor backdoor(env->mpPlugin);
- ASSERT_TRUE( backdoor.containsDomainWithID( (const am_domainID_t)domainID) );
- ASSERT_TRUE( backdoor.containsSourceWithID( (const am_sourceID_t)sID) );
-
- am_volume_t volume = 50;
- am_Handle_s handle = {H_SETSOURCESTATE, 20};
- am_SourceState_e state = am_SourceState_e::SS_MAX;
- EXPECT_CALL(*env->mpRoutingReceive, ackSetSourceState(IsHandleEqual(handle), E_OK)).Times(1);
- EXPECT_CALL(*env->mpRoutingReceive, getDomainOfSource(TEST_ID_1, _)).WillOnce(Return(E_OK));
- am_Error_e error = env->mpPlugin->asyncSetSourceState(handle, sID, state);
- usleep(50000);
- ASSERT_EQ( error, E_OK );
- ASSERT_FALSE( backdoor.containsHandle( handle.handle) );
- }
-
-
-}
-
-TEST_F(CAmRoutingSenderCAPITests, TestDomain_asyncSetSourceVolume)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- const org::genivi::am::am_domainID_t domainID = TEST_ID_1;
- const org::genivi::am::am_sourceID_t sID = TEST_ID_1;
- IAmRoutingSenderBackdoor backdoor(env->mpPlugin);
- ASSERT_TRUE( backdoor.containsDomainWithID( (const am_domainID_t)domainID) );
- ASSERT_TRUE( backdoor.containsSourceWithID( (const am_sourceID_t)sID) );
-
- am_volume_t volume = 50;
- am_time_t time = 10;
- am_CustomRampType_t ramp = RAMP_GENIVI_DIRECT;
- am_Handle_s handle = {H_SETSOURCEVOLUME, 20};
- am_SourceState_e state = am_SourceState_e::SS_MAX;
- EXPECT_CALL(*env->mpRoutingReceive, ackSetSourceVolumeChange(IsHandleEqual(handle), volume, E_OK)).Times(1);
- EXPECT_CALL(*env->mpRoutingReceive, getDomainOfSource(TEST_ID_1, _)).WillOnce(Return(E_OK));
- am_Error_e error = env->mpPlugin->asyncSetSourceVolume(handle, sID, volume, ramp, time);
- usleep(50000);
- ASSERT_EQ( error, E_OK );
- ASSERT_FALSE( backdoor.containsHandle( handle.handle) );
- }
-
-
-}
-
-TEST_F(CAmRoutingSenderCAPITests, TestDomain_registerCrossfader)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- const org::genivi::am::am_domainID_t domainID = TEST_ID_1;
- IAmRoutingSenderBackdoor backdoor(env->mpPlugin);
- ASSERT_TRUE( backdoor.containsDomainWithID( (const am_domainID_t)domainID) );
-
- CallStatus callStatus = CallStatus::NOT_AVAILABLE;
- org::genivi::am::am_Error_e error = org::genivi::am::am_Error_e::E_UNKNOWN;
-
- org::genivi::am::am_crossfaderID_t crossfaderID = 0;
- org::genivi::am::am_Crossfader_s crossfaderData;
- am_Crossfader_s amCrossfaderData;
- initCrossfader(crossfaderData, amCrossfaderData, crossfaderID);
-
- ON_CALL(*env->mpRoutingReceive, registerCrossfader(_, _)).WillByDefault(Return(E_OK));
- EXPECT_CALL(*env->mpRoutingReceive, registerCrossfader(IsCrossfaderDataEqualTo(amCrossfaderData), _)).WillOnce(DoAll(actionRegister(), Return(E_OK)));
- env->mProxy->registerCrossfader(crossfaderData, callStatus, crossfaderID, error);
-
- usleep(50000);
- ASSERT_EQ( callStatus, CallStatus::SUCCESS );
- ASSERT_EQ( error, org::genivi::am::am_Error_e::E_OK );
- ASSERT_EQ( crossfaderID, TEST_ID_1 );
- ASSERT_TRUE( backdoor.containsCrossfader( TEST_ID_1) );
- }
-
-}
-
-TEST_F(CAmRoutingSenderCAPITests, TestDomain_asyncSetSinkVolume)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- const org::genivi::am::am_domainID_t domainID = TEST_ID_1;
- const org::genivi::am::am_sinkID_t sID = TEST_ID_1;
- IAmRoutingSenderBackdoor backdoor(env->mpPlugin);
- ASSERT_TRUE( backdoor.containsDomainWithID( (const am_domainID_t)domainID) );
- ASSERT_TRUE( backdoor.containsSourceWithID( (const am_sourceID_t)sID) );
-
- am_volume_t volume = 50;
- am_time_t time = 10;
- am_CustomRampType_t ramp = RAMP_GENIVI_DIRECT;
- am_Handle_s handle = {H_SETSINKVOLUME, 20};
- am_SourceState_e state = am_SourceState_e::SS_MAX;
- EXPECT_CALL(*env->mpRoutingReceive, ackSetSinkVolumeChange(IsHandleEqual(handle), volume, E_OK)).Times(1);
- EXPECT_CALL(*env->mpRoutingReceive, getDomainOfSink(TEST_ID_1, _)).WillOnce(Return(E_OK));
- am_Error_e error = env->mpPlugin->asyncSetSinkVolume(handle, sID, volume, ramp, time);
- usleep(50000);
- ASSERT_EQ( error, E_OK );
- ASSERT_FALSE( backdoor.containsHandle( handle.handle) );
- }
-
-
-}
-
-TEST_F(CAmRoutingSenderCAPITests, TestDomain_asyncConnect)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
-// const org::genivi::am::am_domainID_t domainID = TEST_ID_1;
- IAmRoutingSenderBackdoor backdoor(env->mpPlugin);
- ASSERT_TRUE( backdoor.containsDomainWithID( TEST_ID_1 ));
- ASSERT_TRUE( backdoor.containsSinkWithID( TEST_ID_1 ));
- ASSERT_TRUE( backdoor.containsSourceWithID( TEST_ID_1 ));
-
- org::genivi::am::am_connectionID_t connectionID = TEST_ID_1;
- am_Handle_s handle = {H_CONNECT, 20};
- am_CustomConnectionFormat_t cf = CF_GENIVI_STEREO;
- EXPECT_CALL(*env->mpRoutingReceive, ackConnect(IsHandleEqual(handle), connectionID, E_OK)).Times(1);
- EXPECT_CALL(*env->mpRoutingReceive, getDomainOfSource(TEST_ID_1, _)).WillOnce(Return(E_OK));
- EXPECT_CALL(*env->mpRoutingReceive, getDomainOfSink(TEST_ID_1, _)).WillOnce(Return(E_OK));
- am_Error_e error = env->mpPlugin->asyncConnect(handle, connectionID, TEST_ID_1, TEST_ID_1, cf);
- usleep(50000);
- ASSERT_EQ( error, E_OK );
- ASSERT_FALSE( backdoor.containsHandle( handle.handle ) );
- ASSERT_EQ( backdoor.connectionsCount( ) , 1 );
- }
-
-}
-
-TEST_F(CAmRoutingSenderCAPITests, TestDomain_asyncDisconnect)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- IAmRoutingSenderBackdoor backdoor(env->mpPlugin);
- ASSERT_TRUE( backdoor.containsDomainWithID( TEST_ID_1 ));
- ASSERT_TRUE( backdoor.containsConnection( TEST_ID_1 ));
-
- org::genivi::am::am_connectionID_t connectionID = TEST_ID_1;
- am_Handle_s handle = {H_DISCONNECT, 20};
- am_CustomConnectionFormat_t cf = CF_GENIVI_STEREO;
- EXPECT_CALL(*env->mpRoutingReceive, ackDisconnect(IsHandleEqual(handle), connectionID, E_OK)).Times(1);
- am_Error_e error = env->mpPlugin->asyncDisconnect(handle, connectionID);
- usleep(50000);
- ASSERT_EQ( error, E_OK );
- ASSERT_FALSE( backdoor.containsHandle( handle.handle ) );
- ASSERT_FALSE( backdoor.containsConnection( TEST_ID_1 ) );
- }
-
-}
-
-TEST_F(CAmRoutingSenderCAPITests, TestDomain_asyncAbort)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- const org::genivi::am::am_domainID_t domainID = TEST_ID_1;
- const org::genivi::am::am_sourceID_t sID = TEST_ID_1;
- IAmRoutingSenderBackdoor backdoor(env->mpPlugin);
- ASSERT_TRUE( backdoor.containsDomainWithID( (const am_domainID_t)domainID) );
- ASSERT_TRUE( backdoor.containsSourceWithID( (const am_sourceID_t)sID) );
-
- am_volume_t volume = 50;
- am_Handle_s handle = {H_SETSOURCESTATE, 200};
- org::genivi::am::am_Handle_s CAPIHandle;
- CAPIHandle.handle=200;
- CAPIHandle.handleType=org::genivi::am::am_Handle_e::H_SETSOURCESTATE;
- am_SourceState_e state = am_SourceState_e::SS_MAX;
-
- //we set an abort handle in order to test the return status
- env->mDomainService->setAbortHandle(CAPIHandle);
- EXPECT_CALL(*env->mpRoutingReceive, getDomainOfSource(TEST_ID_1, _)).WillOnce(Return(E_OK));
- EXPECT_CALL(*env->mpRoutingReceive, ackSetSourceState(IsHandleEqual(handle), E_ABORTED)).Times(1);
- am_Error_e error = env->mpPlugin->asyncSetSourceState(handle, sID, state);
- usleep(50000);
- ASSERT_EQ( error, E_OK );
- ASSERT_FALSE( backdoor.containsHandle( handle.handle) );
- }
-
-
-}
-
-MATCHER_P(IsListMainSoundPropertiesEqualTo, value, "") {
- auto lh = arg;
-
- bool bMainSoundProperties = lh.size() == value.size();
- for(int i=0; i<lh.size(); i++)
- {
- bMainSoundProperties &= (lh.at(i).type==value.at(i).type &&
- lh.at(i).value==value.at(i).value);
- }
- return bMainSoundProperties;
-}
-
-TEST_F(CAmRoutingSenderCAPITests, TestDomain_asyncSetSinkSoundProperties)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- const org::genivi::am::am_domainID_t domainID = TEST_ID_1;
- const org::genivi::am::am_sinkID_t sID = TEST_ID_1;
- IAmRoutingSenderBackdoor backdoor(env->mpPlugin);
- ASSERT_TRUE( backdoor.containsDomainWithID( (const am_domainID_t)domainID) );
- ASSERT_TRUE( backdoor.containsSourceWithID( (const am_sourceID_t)sID) );
-
- am_Handle_s handle = {H_SETSINKSOUNDPROPERTIES, 200};
- am_SourceState_e state = am_SourceState_e::SS_MAX;
-
- std::vector<am_SoundProperty_s> listSoundProperties;
- listSoundProperties.push_back((am_SoundProperty_s){SP_GENIVI_MID, 100});
- listSoundProperties.push_back((am_SoundProperty_s){SP_UNKNOWN, 101});
- listSoundProperties.push_back((am_SoundProperty_s){SP_GENIVI_TREBLE, 100});
- EXPECT_CALL(*env->mpRoutingReceive, getDomainOfSink(TEST_ID_1, _)).WillOnce(Return(E_OK));
- EXPECT_CALL(*env->mpRoutingReceive, ackSetSinkSoundProperties(IsHandleEqual(handle), E_OK)).Times(1);
- am_Error_e error = env->mpPlugin->asyncSetSinkSoundProperties(handle, sID, listSoundProperties);
- usleep(50000);
- ASSERT_EQ( error, E_OK );
- ASSERT_FALSE( backdoor.containsHandle( handle.handle) );
- }
-
-
-}
-
-TEST_F(CAmRoutingSenderCAPITests, TestDomain_asyncSetSinkSoundProperty)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- const org::genivi::am::am_domainID_t domainID = TEST_ID_1;
- const org::genivi::am::am_sinkID_t sID = TEST_ID_1;
- IAmRoutingSenderBackdoor backdoor(env->mpPlugin);
- ASSERT_TRUE( backdoor.containsDomainWithID( (const am_domainID_t)domainID) );
- ASSERT_TRUE( backdoor.containsSourceWithID( (const am_sourceID_t)sID) );
-
- am_Handle_s handle = {H_SETSINKSOUNDPROPERTY, 200};
- am_SourceState_e state = am_SourceState_e::SS_MAX;
- EXPECT_CALL(*env->mpRoutingReceive, getDomainOfSink(TEST_ID_1, _)).WillOnce(Return(E_OK));
- EXPECT_CALL(*env->mpRoutingReceive, ackSetSinkSoundProperty(IsHandleEqual(handle), E_OK)).Times(1);
- am_Error_e error = env->mpPlugin->asyncSetSinkSoundProperty(handle, sID, (am_SoundProperty_s){SP_GENIVI_MID, 100});
- usleep(50000);
- ASSERT_EQ( error, E_OK );
- ASSERT_FALSE( backdoor.containsHandle( handle.handle) );
- }
-
-
-}
-
-TEST_F(CAmRoutingSenderCAPITests, TestDomain_asyncSetSourceSoundProperties)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- const org::genivi::am::am_domainID_t domainID = TEST_ID_1;
- const org::genivi::am::am_sourceID_t sID = TEST_ID_1;
- IAmRoutingSenderBackdoor backdoor(env->mpPlugin);
- ASSERT_TRUE( backdoor.containsDomainWithID( (const am_domainID_t)domainID) );
- ASSERT_TRUE( backdoor.containsSourceWithID( (const am_sourceID_t)sID) );
-
- am_Handle_s handle = {H_SETSOURCESOUNDPROPERTIES, 200};
- am_SourceState_e state = am_SourceState_e::SS_MAX;
-
- std::vector<am_SoundProperty_s> listSoundProperties;
- listSoundProperties.push_back((am_SoundProperty_s){SP_GENIVI_MID, 100});
- listSoundProperties.push_back((am_SoundProperty_s){SP_UNKNOWN, 101});
- listSoundProperties.push_back((am_SoundProperty_s){SP_GENIVI_TREBLE, 100});
- EXPECT_CALL(*env->mpRoutingReceive, getDomainOfSource(TEST_ID_1, _)).WillOnce(Return(E_OK));
- EXPECT_CALL(*env->mpRoutingReceive, ackSetSourceSoundProperties(IsHandleEqual(handle), E_OK)).Times(1);
- am_Error_e error = env->mpPlugin->asyncSetSourceSoundProperties(handle, sID, listSoundProperties);
- usleep(50000);
- ASSERT_EQ( error, E_OK );
- ASSERT_FALSE( backdoor.containsHandle( handle.handle) );
- }
-
-
-}
-
-TEST_F(CAmRoutingSenderCAPITests, TestDomain_asyncSetSourceSoundProperty)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- const org::genivi::am::am_domainID_t domainID = TEST_ID_1;
- const org::genivi::am::am_sourceID_t sID = TEST_ID_1;
- IAmRoutingSenderBackdoor backdoor(env->mpPlugin);
- ASSERT_TRUE( backdoor.containsDomainWithID( (const am_domainID_t)domainID) );
- ASSERT_TRUE( backdoor.containsSourceWithID( (const am_sourceID_t)sID) );
-
- am_Handle_s handle = {H_SETSOURCESOUNDPROPERTY, 200};
- am_SourceState_e state = am_SourceState_e::SS_MAX;
- EXPECT_CALL(*env->mpRoutingReceive, getDomainOfSource(TEST_ID_1, _)).WillOnce(Return(E_OK));
- EXPECT_CALL(*env->mpRoutingReceive, ackSetSourceSoundProperty(IsHandleEqual(handle), E_OK)).Times(1);
- am_Error_e error = env->mpPlugin->asyncSetSourceSoundProperty(handle, sID, (am_SoundProperty_s){SP_GENIVI_MID, 100});
- usleep(50000);
- ASSERT_EQ( error, E_OK );
- ASSERT_FALSE( backdoor.containsHandle( handle.handle) );
- }
-
-
-}
-
-TEST_F(CAmRoutingSenderCAPITests, TestDomain_asyncCrossFade)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- const org::genivi::am::am_crossfaderID_t sID = TEST_ID_1;
- IAmRoutingSenderBackdoor backdoor(env->mpPlugin);
- ASSERT_TRUE( backdoor.containsDomainWithID( TEST_ID_1 ));
- ASSERT_TRUE( backdoor.containsSourceWithID( TEST_ID_1 ));
- ASSERT_TRUE( backdoor.containsCrossfader( TEST_ID_1 ));
-
- am_Handle_s handle = {H_CROSSFADE, 200};
- am_CustomRampType_t state = RAMP_GENIVI_DIRECT;
- am_HotSink_e hotSink = HS_UNKNOWN;
- EXPECT_CALL(*env->mpRoutingReceive, ackCrossFading(IsHandleEqual(handle), hotSink, E_OK)).Times(1);
- am_Error_e error = env->mpPlugin->asyncCrossFade(handle, sID, hotSink, state, 50);
- usleep(50000);
- ASSERT_EQ( error, E_OK );
- ASSERT_FALSE( backdoor.containsHandle( handle.handle) );
- }
-
-
-}
-
-TEST_F(CAmRoutingSenderCAPITests, TestDomain_asyncSetSinkNotificationConfiguration)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- IAmRoutingSenderBackdoor backdoor(env->mpPlugin);
- ASSERT_TRUE( backdoor.containsDomainWithID( TEST_ID_1 ));
- ASSERT_TRUE( backdoor.containsSinkWithID( TEST_ID_1 ));
-
- am_Handle_s handle = {H_CONNECT, 200};
- am_NotificationConfiguration_s nc = (am_NotificationConfiguration_s){NT_UNKNOWN, am_NotificationStatus_e::NS_MAX};
- EXPECT_CALL(*env->mpRoutingReceive, getDomainOfSink(TEST_ID_1, _)).WillOnce(Return(E_OK));
- EXPECT_CALL(*env->mpRoutingReceive, ackSinkNotificationConfiguration(IsHandleStructEqualTo(handle), E_OK)).Times(1);
- am_Error_e error = env->mpPlugin->asyncSetSinkNotificationConfiguration(handle, TEST_ID_1, nc);
- usleep(50000);
- ASSERT_EQ( error, E_OK );
- ASSERT_FALSE( backdoor.containsHandle( handle.handle) );
- }
-
-
-}
-
-TEST_F(CAmRoutingSenderCAPITests, TestDomain_asyncSetSourceNotificationConfiguration)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- IAmRoutingSenderBackdoor backdoor(env->mpPlugin);
- ASSERT_TRUE( backdoor.containsDomainWithID( TEST_ID_1 ));
- ASSERT_TRUE( backdoor.containsSinkWithID( TEST_ID_1 ));
-
- am_Handle_s handle = {H_CONNECT, 200};
- am_NotificationConfiguration_s nc = (am_NotificationConfiguration_s){NT_UNKNOWN, am_NotificationStatus_e::NS_MAX};
- EXPECT_CALL(*env->mpRoutingReceive, getDomainOfSource(TEST_ID_1, _)).WillOnce(Return(E_OK));
- EXPECT_CALL(*env->mpRoutingReceive, ackSourceNotificationConfiguration(IsHandleStructEqualTo(handle), E_OK)).Times(1);
- am_Error_e error = env->mpPlugin->asyncSetSourceNotificationConfiguration(handle, TEST_ID_1, nc);
- usleep(50000);
- ASSERT_EQ( error, E_OK );
- ASSERT_FALSE( backdoor.containsHandle( handle.handle) );
- }
-
-
-}
-
-TEST_F(CAmRoutingSenderCAPITests, TestDomain_asyncSetVolumes)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- IAmRoutingSenderBackdoor backdoor(env->mpPlugin);
- ASSERT_TRUE( backdoor.containsDomainWithID( TEST_ID_1) );
- ASSERT_TRUE( backdoor.containsSourceWithID( TEST_ID_1) );
-
- org::genivi::am::am_Volumes_L listVolumes;
- org::genivi::am::am_DataType_u dt(static_cast<org::genivi::am::am_sourceID_t>(TEST_ID_1));
- listVolumes.push_back(org::genivi::am::am_Volumes_s(org::genivi::am::am_VolumeType_e::VT_SOURCE,
- dt,
- 50,
- static_cast<org::genivi::am::am_CustomRampType_t>(RAMP_GENIVI_DIRECT),
- 50));
-
- std::vector<am_Volumes_s> am_listVolumes;
- am_DataType_u dt1;
- dt1.source = TEST_ID_2;
- am_listVolumes.push_back((am_Volumes_s){VT_SOURCE,
- dt1,
- 50,
- RAMP_GENIVI_DIRECT,
- 50});
-
- am_Handle_s handle = {H_SETVOLUMES, 200};
- EXPECT_CALL(*env->mpRoutingReceive, ackSetVolumes(IsHandleStructEqualTo(handle), IsSinkVolumeArrayEqualTo(am_listVolumes, false), E_OK)).Times(1);
- am_Error_e error = env->mpPlugin->asyncSetVolumes(handle, am_listVolumes);
-
- usleep(50000);
- ASSERT_EQ( error, E_OK );
- ASSERT_FALSE( backdoor.containsHandle( handle.handle) );
-
- }
-
-}
-
-TEST_F(CAmRoutingSenderCAPITests, TestDomain_deregisterSink)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- CallStatus callStatus = CallStatus::NOT_AVAILABLE;
- org::genivi::am::am_Error_e error = org::genivi::am::am_Error_e::E_UNKNOWN;
- org::genivi::am::am_sinkID_t sinkID = TEST_ID_2;
-
- IAmRoutingSenderBackdoor backdoor(env->mpPlugin);
- ASSERT_TRUE( backdoor.containsSinkWithID( sinkID ));
-
- ON_CALL(*env->mpRoutingReceive, deregisterSink(_)).WillByDefault(Return(E_OK));
- EXPECT_CALL(*env->mpRoutingReceive, deregisterSink(sinkID)).WillOnce(Return(E_OK));
- env->mProxy->deregisterSink(sinkID, callStatus, error);
- usleep(50000);
- ASSERT_EQ( error, org::genivi::am::am_Error_e::E_OK );
- ASSERT_EQ( callStatus, CallStatus::SUCCESS );
- ASSERT_FALSE( backdoor.containsSinkWithID( sinkID ));
- }
-
-}
-
-TEST_F(CAmRoutingSenderCAPITests, TestDomain_deregisterSource)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- CallStatus callStatus = CallStatus::NOT_AVAILABLE;
- org::genivi::am::am_Error_e error = org::genivi::am::am_Error_e::E_UNKNOWN;
- org::genivi::am::am_sourceID_t sID = TEST_ID_2;
-
- IAmRoutingSenderBackdoor backdoor(env->mpPlugin);
- ASSERT_TRUE( backdoor.containsSourceWithID( sID ));
-
- ON_CALL(*env->mpRoutingReceive, deregisterSource(_)).WillByDefault(Return(E_OK));
- EXPECT_CALL(*env->mpRoutingReceive, deregisterSource(sID)).WillOnce(Return(E_OK));
- env->mProxy->deregisterSource(sID, callStatus, error);
- usleep(50000);
- ASSERT_EQ( error, org::genivi::am::am_Error_e::E_OK );
- ASSERT_EQ( callStatus, CallStatus::SUCCESS );
- ASSERT_FALSE( backdoor.containsSourceWithID( sID ));
- }
-
-}
-
-TEST_F(CAmRoutingSenderCAPITests, TestDomain_deregisterCrossfader)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- CallStatus callStatus = CallStatus::NOT_AVAILABLE;
- org::genivi::am::am_Error_e error = org::genivi::am::am_Error_e::E_UNKNOWN;
- org::genivi::am::am_crossfaderID_t sID = TEST_ID_1;
-
- IAmRoutingSenderBackdoor backdoor(env->mpPlugin);
- ASSERT_TRUE( backdoor.containsCrossfader( sID ));
-
- ON_CALL(*env->mpRoutingReceive, deregisterCrossfader(_)).WillByDefault(Return(E_OK));
- EXPECT_CALL(*env->mpRoutingReceive, deregisterCrossfader(sID)).WillOnce(Return(E_OK));
- env->mProxy->deregisterCrossfader(sID, callStatus, error);
- usleep(50000);
- ASSERT_EQ( error, org::genivi::am::am_Error_e::E_OK );
- ASSERT_EQ( callStatus, CallStatus::SUCCESS );
- ASSERT_FALSE( backdoor.containsCrossfader( sID ));
- }
-
-}
-
-TEST_F(CAmRoutingSenderCAPITests, TestDomain_deregisterDomain)
-{
- ASSERT_TRUE(env->mIsServiceAvailable);
- if(env->mIsServiceAvailable)
- {
- IAmRoutingSenderBackdoor backdoor(env->mpPlugin);
- ASSERT_TRUE( backdoor.containsDomainWithID( TEST_ID_2 ));
- CallStatus callStatus = CallStatus::NOT_AVAILABLE;
- org::genivi::am::am_Error_e error = org::genivi::am::am_Error_e::E_UNKNOWN;
-
- ON_CALL(*env->mpRoutingReceive, deregisterDomain(_)).WillByDefault(Return(E_OK));
- EXPECT_CALL(*env->mpRoutingReceive, deregisterDomain(TEST_ID_2)).WillOnce(Return(E_OK));
- env->mProxy->deregisterDomain(TEST_ID_2, callStatus, error);
- usleep(50000);
- ASSERT_EQ( error, org::genivi::am::am_Error_e::E_OK );
- ASSERT_EQ( callStatus, CallStatus::SUCCESS );
- ASSERT_EQ( backdoor.domainsCount(), 1 );
- ASSERT_FALSE( backdoor.containsDomainWithID( TEST_ID_2 ));
-
- EXPECT_CALL(*env->mpRoutingReceive, deregisterDomain(TEST_ID_1)).WillOnce(Return(E_OK));
- env->mProxy->deregisterDomain(TEST_ID_1, callStatus, error);
- usleep(50000);
- ASSERT_EQ( error, org::genivi::am::am_Error_e::E_OK );
- ASSERT_EQ( callStatus, CallStatus::SUCCESS );
- ASSERT_FALSE( backdoor.containsDomainWithID( TEST_ID_1 ));
- ASSERT_EQ( backdoor.domainsCount(), 0 );
- ASSERT_EQ( backdoor.sourcesCount(), 0 );
- ASSERT_EQ( backdoor.sinksCount(), 0 );
- ASSERT_EQ( backdoor.crossfadersCount(), 0 );
- ASSERT_EQ( backdoor.connectionsCount(), 0 );
- }
-
-}
-
diff --git a/PluginRoutingInterfaceCAPI/test/CAmRoutingInterfaceCAPITests.h b/PluginRoutingInterfaceCAPI/test/CAmRoutingInterfaceCAPITests.h
deleted file mode 100644
index 5a1e264..0000000
--- a/PluginRoutingInterfaceCAPI/test/CAmRoutingInterfaceCAPITests.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/**
- * Copyright (c) 2012 BMW
- *
- * \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 ROUTINGINTERFACETEST_H_
-#define ROUTINGINTERFACETEST_H_
-
-#include "gtest/gtest.h"
-#include "gmock/gmock.h"
-#include "shared/CAmSocketHandler.h"
-#include "CAmTestCAPIWrapper.h"
-#include "../include/CAmRoutingSenderCAPI.h"
-#include "MockIAmRoutingReceive.h"
-#include <../src-gen/org/genivi/am/RoutingControlObserverProxy.h>
-
-#define UNIT_TEST 1
-
-using namespace testing;
-using namespace CommonAPI;
-namespace am {
-
-class CAmCommandSenderDbusBackdoor;
-class IAmCommandSend;
-class CAmRoutingSenderService;
-
-/** Global test environment which sets the routing interface service and test domain service for all tests.
- * The tests are executed after the connection have been successful established.
- * If the connection is not available for some reason all tests will fail.
- */
-class CAmTestsEnvironment : public ::testing::Environment
-{
- pthread_t mListenerThread; ///< supporting sync thread
- pthread_t mServicePThread; ///< plugin's thread
- pthread_t mClientPThread; ///< thread for the routing interface proxy and test domain stub
-
-public:
- bool mIsProxyInitilized;
- bool mIsServiceAvailable;
- bool mIsDomainAvailable;
- CAmSocketHandler *mSocketHandlerService;
- CAmSocketHandler *mSocketHandlerClient;
- MockIAmRoutingReceive *mpRoutingReceive;
- CAmRoutingSenderCAPI *mpPlugin;
-
- std::shared_ptr<org::genivi::am::RoutingControlObserverProxy<> > mProxy; ///< pointer to routing interface proxy
- std::shared_ptr<CAmRoutingSenderService> mDomainService; ///< pointer to the test domain service
-
- CAmTestsEnvironment();
- ~CAmTestsEnvironment();
- void SetUp();
- // Override this to define how to tear down the environment.
- void TearDown();
- void onServiceStatusEvent(const CommonAPI::AvailabilityStatus& serviceStatus);
-};
-
-/**
- * Common tests - types and calls matching
- */
-class CAmRoutingInterfaceCAPITests :public ::testing::Test
-{
-
-public:
- CAmRoutingInterfaceCAPITests();
- ~CAmRoutingInterfaceCAPITests();
-
- void SetUp();
- void TearDown();
-
-};
-
-/**
- * Domain tests - connection to domain, registrations, deregistrations, lookups.
- */
-class CAmRoutingSenderCAPITests :public ::testing::Test
-{
-
-public:
- CAmRoutingSenderCAPITests();
- ~CAmRoutingSenderCAPITests();
-
- void SetUp();
- void TearDown();
-
-};
-
-}
-
-#endif /* ROUTINGINTERFACETEST_H_ */
diff --git a/PluginRoutingInterfaceCAPI/test/CAmRoutingSenderService.cpp b/PluginRoutingInterfaceCAPI/test/CAmRoutingSenderService.cpp
deleted file mode 100644
index 1b17037..0000000
--- a/PluginRoutingInterfaceCAPI/test/CAmRoutingSenderService.cpp
+++ /dev/null
@@ -1,226 +0,0 @@
-/**
- * Copyright (c) 2012 BMW
- *
- * \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 <stdint.h>
-#include <limits.h>
-#include "shared/CAmCommonAPIWrapper.h"
-#include "shared/CAmDltWrapper.h"
-#include "CAmRoutingSenderService.h"
-
-
-namespace am {
-
-#define CAPI_SENDER_ADDRESS "local:" CAPI_SENDER_INTERFACE ":" CAPI_SENDER_INSTANCE
-#define CAPI_ROUTING_ADDRESS "local:" CAPI_ROUTING_INTERFACE ":" CAPI_ROUTING_INSTANCE
-
-const char * CAmRoutingSenderService::ROUTING_SENDER_SERVICE = CAPI_SENDER_ADDRESS;
-const char * CAmRoutingSenderService::ROUTING_INTERFACE_SERVICE = CAPI_ROUTING_ADDRESS;
-
-CAmRoutingSenderService::CAmRoutingSenderService(CAmCommonAPIWrapper * aWrapper):
- mDomainData(), mAbortedHandle(), mIsDomainRegistred(false), mIsServiceAvailable(0), mIsReady(0), mpWrapper(aWrapper), mRoutingInterfaceProxy(NULL)
-{
- mAbortedHandle.handle=UINT_MAX;
-}
-
-CAmRoutingSenderService::CAmRoutingSenderService():
- mDomainData(), mAbortedHandle(), mIsDomainRegistred(false), mIsServiceAvailable(0), mIsReady(0), mpWrapper(NULL), mRoutingInterfaceProxy(NULL)
-{
-
-}
-
-CAmRoutingSenderService::CAmRoutingSenderService(CAmCommonAPIWrapper * aWrapper, std::shared_ptr<org::genivi::am::RoutingControlObserverProxy<> > aProxy):
- mDomainData(), mAbortedHandle(), mIsDomainRegistred(false), mIsServiceAvailable(0), mIsReady(0), mpWrapper(aWrapper), mRoutingInterfaceProxy(aProxy)
-{
- mAbortedHandle.handle=UINT_MAX;
- mRoutingInterfaceProxy->getProxyStatusEvent().subscribe(std::bind(&CAmRoutingSenderService::onServiceStatusEvent,this,std::placeholders::_1));
- //mRoutingInterfaceProxy->getSetRoutingReadyEvent().subscribe(std::bind(&CAmRoutingSenderService::onRoutingReadyEvent(),this));
- //mRoutingInterfaceProxy->getSetRoutingRundownEvent().subscribe(std::bind(&CAmRoutingSenderService::onRoutingReadyRundown,this));
-}
-
-CAmRoutingSenderService::~CAmRoutingSenderService() {
- mpWrapper = NULL;
- if(mRoutingInterfaceProxy)
- mRoutingInterfaceProxy.reset();
-}
-
-void CAmRoutingSenderService::onServiceStatusEvent(const CommonAPI::AvailabilityStatus& serviceStatus)
-{
- logInfo(__PRETTY_FUNCTION__);
- mIsDomainRegistred = false;
- mIsServiceAvailable = false;
- mIsReady = false;
- std::stringstream avail;
- avail << "(" << static_cast<int>(serviceStatus) << ")";
- logInfo("Domain test service status changed to ", avail.str());
- std::cout << std::endl << "Domain test service status changed to " << avail.str() << std::endl;
- if(serviceStatus==CommonAPI::AvailabilityStatus::AVAILABLE)
- {
- mIsServiceAvailable = true;
- CommonAPI::CallStatus callStatus;
- org::genivi::am::am_RoutingReady_e readyAttr;
- mRoutingInterfaceProxy->getRoutingReadyAttribute().getValue(callStatus,readyAttr);
- if (callStatus!=CommonAPI::CallStatus::SUCCESS)
- logError(__PRETTY_FUNCTION__,"Could not get RoutingReady");
- else
- mIsReady = readyAttr == org::genivi::am::am_RoutingReady_e::RR_READY ? true : false;
- }
-}
-
-void CAmRoutingSenderService::onRoutingReadyEvent()
-{
- logInfo(__PRETTY_FUNCTION__);
- mIsReady = true;
-}
-
-void CAmRoutingSenderService::onRoutingReadyRundown()
-{
- logInfo(__PRETTY_FUNCTION__);
- mIsReady = true;
- mIsDomainRegistred = false;
-}
-
-void CAmRoutingSenderService::setAbortHandle(org::genivi::am::am_Handle_s handle)
-{
- mAbortedHandle=handle;
-}
-
-void CAmRoutingSenderService::registerDomain()
-{
- if( mIsDomainRegistred || !mIsServiceAvailable || !mIsReady )
- return;
- mIsDomainRegistred = true;
- logInfo(__PRETTY_FUNCTION__,"start registering Domain...");
- org::genivi::am::am_Error_e error;
- mDomainData.name = "TestDomain";
- mDomainData.busname ="TestDomain";
- mDomainData.complete = true;
- mDomainData.domainID = 0;
- mDomainData.early = false;
- mDomainData.nodename = "Test";
- mDomainData.state = org::genivi::am::am_DomainState_e::DS_CONTROLLED;
- CommonAPI::CallStatus callStatus;
- mRoutingInterfaceProxy->registerDomain(mDomainData,
- CAPI_SENDER_INSTANCE,
- CAPI_SENDER_INTERFACE,
- callStatus,
- mDomainData.domainID,
- error);
- logInfo("Domain: got domainID", mDomainData.domainID);
-}
-
-org::genivi::am::am_Error_e CAmRoutingSenderService::errorForHandle(const org::genivi::am::am_Handle_s & handle)
-{
- org::genivi::am::am_Error_e error = org::genivi::am::am_Error_e::E_OK;
- if(handle==mAbortedHandle && mAbortedHandle.handle!=UINT_MAX)
- {
- error = org::genivi::am::am_Error_e::E_ABORTED;
- mAbortedHandle.handle = UINT_MAX;
- }
- return error;
-}
-
-void CAmRoutingSenderService::asyncSetSourceState(org::genivi::am::am_Handle_s handle, org::genivi::am::am_sourceID_t sourceID, org::genivi::am::am_SourceState_e sourceState) {
- logInfo(__FUNCTION__, " called");
- CommonAPI::CallStatus callStatus;
- mRoutingInterfaceProxy->ackSetSourceState(handle, errorForHandle(handle), callStatus);
-}
-
-void CAmRoutingSenderService::setDomainState(org::genivi::am::am_domainID_t domainID, org::genivi::am::am_DomainState_e domainState, org::genivi::am::am_Error_e& error) {
- logInfo(__FUNCTION__, " called");
- CommonAPI::CallStatus callStatus;
- error = org::genivi::am::am_Error_e::E_OK;
- mRoutingInterfaceProxy->hookDomainStateChange(domainID, domainState, callStatus);
-}
-
-void CAmRoutingSenderService::asyncSetSourceVolume(org::genivi::am::am_Handle_s handle, org::genivi::am::am_sourceID_t sourceID, org::genivi::am::am_volume_t volume, org::genivi::am::am_CustomRampType_t ramp, org::genivi::am::am_time_t time) {
- logInfo(__FUNCTION__, " called");
- CommonAPI::CallStatus callStatus;
- mRoutingInterfaceProxy->ackSetSourceVolumeChange(handle, volume, errorForHandle(handle), callStatus);
-}
-
-void CAmRoutingSenderService::asyncSetSinkVolume(org::genivi::am::am_Handle_s handle, org::genivi::am::am_sinkID_t sinkID, org::genivi::am::am_volume_t volume, org::genivi::am::am_CustomRampType_t ramp, org::genivi::am::am_time_t time) {
- logInfo(__FUNCTION__, " called");
- CommonAPI::CallStatus callStatus;
- mRoutingInterfaceProxy->ackSetSinkVolumeChange(handle, volume, errorForHandle(handle), callStatus);
-}
-
-void CAmRoutingSenderService::asyncConnect(org::genivi::am::am_Handle_s handle, org::genivi::am::am_connectionID_t connectionID, org::genivi::am::am_sourceID_t sourceID, org::genivi::am::am_sinkID_t sinkID, org::genivi::am::am_CustomConnectionFormat_t connectionFormat) {
- logInfo(__FUNCTION__, " called");
- CommonAPI::CallStatus callStatus;
- mRoutingInterfaceProxy->ackConnect(handle, connectionID, errorForHandle(handle), callStatus);
-}
-
-void CAmRoutingSenderService::asyncDisconnect(org::genivi::am::am_Handle_s handle, org::genivi::am::am_connectionID_t connectionID) {
- logInfo(__FUNCTION__, " called");
- CommonAPI::CallStatus callStatus;
- mRoutingInterfaceProxy->ackDisconnect(handle, connectionID, errorForHandle(handle), callStatus);
-}
-
-void CAmRoutingSenderService::asyncAbort(org::genivi::am::am_Handle_s handle) {
- logInfo(__FUNCTION__, " called");
- mAbortedHandle = handle;
-}
-
-void CAmRoutingSenderService::asyncSetSinkSoundProperties(org::genivi::am::am_Handle_s handle, org::genivi::am::am_sinkID_t sinkID, org::genivi::am::am_SoundProperty_L listSoundProperties) {
- logInfo(__FUNCTION__, " called");
- CommonAPI::CallStatus callStatus;
- mRoutingInterfaceProxy->ackSetSinkSoundProperties(handle, errorForHandle(handle), callStatus);
-}
-
-void CAmRoutingSenderService::asyncSetSinkSoundProperty(org::genivi::am::am_Handle_s handle, org::genivi::am::am_sinkID_t sinkID, org::genivi::am::am_SoundProperty_s soundProperty) {
- logInfo(__FUNCTION__, " called");
- CommonAPI::CallStatus callStatus;
- mRoutingInterfaceProxy->ackSetSinkSoundProperty(handle, errorForHandle(handle), callStatus);
-}
-
-void CAmRoutingSenderService::asyncSetSourceSoundProperties(org::genivi::am::am_Handle_s handle, org::genivi::am::am_sourceID_t sourceID, org::genivi::am::am_SoundProperty_L listSoundProperties) {
- logInfo(__FUNCTION__, " called");
- CommonAPI::CallStatus callStatus;
- mRoutingInterfaceProxy->ackSetSourceSoundProperties(handle, errorForHandle(handle), callStatus);
-}
-
-void CAmRoutingSenderService::asyncSetSourceSoundProperty(org::genivi::am::am_Handle_s handle, org::genivi::am::am_sourceID_t sourceID, org::genivi::am::am_SoundProperty_s soundProperty) {
- logInfo(__FUNCTION__, " called");
- CommonAPI::CallStatus callStatus;
- mRoutingInterfaceProxy->ackSetSourceSoundProperty(handle, errorForHandle(handle), callStatus);
-}
-
-void CAmRoutingSenderService::asyncCrossFade(org::genivi::am::am_Handle_s handle, org::genivi::am::am_crossfaderID_t crossfaderID, org::genivi::am::am_HotSink_e hotSink, org::genivi::am::am_CustomRampType_t rampType, org::genivi::am::am_time_t time) {
- logInfo(__FUNCTION__, " called");
- CommonAPI::CallStatus callStatus;
- mRoutingInterfaceProxy->ackCrossFading(handle, hotSink, (org::genivi::am::am_Error_e)errorForHandle(handle), callStatus);
-}
-
-void CAmRoutingSenderService::asyncSetVolumes(org::genivi::am::am_Handle_s handle, org::genivi::am::am_Volumes_L volumes) {
- logInfo(__FUNCTION__, " called");
- CommonAPI::CallStatus callStatus;
- mRoutingInterfaceProxy->ackSetVolumes(handle, volumes, errorForHandle(handle), callStatus);
-}
-
-void CAmRoutingSenderService::asyncSetSinkNotificationConfiguration(org::genivi::am::am_Handle_s handle, org::genivi::am::am_sinkID_t sinkID, org::genivi::am::am_NotificationConfiguration_s notificationConfiguration) {
- logInfo(__FUNCTION__, " called");
- CommonAPI::CallStatus callStatus;
- mRoutingInterfaceProxy->ackSinkNotificationConfiguration(handle, errorForHandle(handle), callStatus);
-}
-
-void CAmRoutingSenderService::asyncSetSourceNotificationConfiguration(org::genivi::am::am_Handle_s handle, org::genivi::am::am_sourceID_t sourceID, org::genivi::am::am_NotificationConfiguration_s notificationConfiguration) {
- logInfo(__FUNCTION__, " called");
- CommonAPI::CallStatus callStatus;
- mRoutingInterfaceProxy->ackSourceNotificationConfiguration(handle, errorForHandle(handle), callStatus);
-}
-
-} /* namespace org */
diff --git a/PluginRoutingInterfaceCAPI/test/CAmRoutingSenderService.h b/PluginRoutingInterfaceCAPI/test/CAmRoutingSenderService.h
deleted file mode 100644
index d115b73..0000000
--- a/PluginRoutingInterfaceCAPI/test/CAmRoutingSenderService.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/**
- * Copyright (c) 2012 BMW
- *
- * \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 CAMROUTINGSENDERSERVICE_H_
-#define CAMROUTINGSENDERSERVICE_H_
-
-#include "audiomanagertypes.h"
-#include <org/genivi/am/RoutingControlStubDefault.h>
-#include <org/genivi/am/RoutingControlObserverProxy.h>
-
-/**
- * GENERATED FROM CMAKE. PLEASE USE cmake/CAmRoutingSenderService.h.in IF YOU WANT TO MAKE CHANGES.
- */
-
-namespace am {
-
-using namespace CommonAPI;
-
-class CAmCommonAPIWrapper;
-
-/**
- * THE FOLLOWING DEFINES ARE POPULATED FROM THE CMAKELISTS.TXT .
- */
-#define CAPI_SENDER_INTERFACE "org.genivi.audiomanager.routingsender"
-#define CAPI_SENDER_INSTANCE "org.genivi.routingsender"
-#define CAPI_SENDER_PATH "/org/genivi/audiomanager/routingsender"
-
-#define CAPI_ROUTING_INTERFACE "org.genivi.audiomanager.routinginterface"
-#define CAPI_ROUTING_INSTANCE "org.genivi.audiomanager"
-#define CAPI_ROUTING_PATH "/org/genivi/audiomanager/routinginterface"
-
-
-/** Test class implementing the routing sender service.
-*
-* Please see cmake/CAmRoutingSenderService.h.in
-*/
-class CAmRoutingSenderService : public org::genivi::am::RoutingControlStubDefault {
-
- org::genivi::am::am_Domain_s mDomainData;
- org::genivi::am::am_Handle_s mAbortedHandle;
- bool mIsServiceAvailable;
- bool mIsDomainRegistred;
- bool mIsReady;
- CAmCommonAPIWrapper *mpWrapper;
- std::shared_ptr<org::genivi::am::RoutingControlObserverProxy<> > mRoutingInterfaceProxy;
-
-public:
-
- CAmRoutingSenderService();
- CAmRoutingSenderService(CAmCommonAPIWrapper * aWrapper);
- CAmRoutingSenderService(CAmCommonAPIWrapper * aWrapper, std::shared_ptr<org::genivi::am::RoutingControlObserverProxy<> > aProxy);
- virtual ~CAmRoutingSenderService();
-
- void onServiceStatusEvent(const CommonAPI::AvailabilityStatus& serviceStatus);
- void onRoutingReadyRundown();
- void onRoutingReadyEvent();
- void registerDomain();
- void setAbortHandle(org::genivi::am::am_Handle_s handle);
- org::genivi::am::am_Error_e errorForHandle(const org::genivi::am::am_Handle_s & handle);
-
- virtual void asyncSetSourceState(org::genivi::am::am_Handle_s handle, org::genivi::am::am_sourceID_t sourceID, org::genivi::am::am_SourceState_e sourceState);
-
- virtual void setDomainState(org::genivi::am::am_domainID_t domainID, org::genivi::am::am_DomainState_e domainState, org::genivi::am::am_Error_e& error);
-
- virtual void asyncSetSourceVolume(org::genivi::am::am_Handle_s handle, org::genivi::am::am_sourceID_t sourceID, org::genivi::am::am_volume_t volume, org::genivi::am::am_CustomRampType_t ramp, org::genivi::am::am_time_t time);
-
- virtual void asyncSetSinkVolume(org::genivi::am::am_Handle_s handle, org::genivi::am::am_sinkID_t sinkID, org::genivi::am::am_volume_t volume, org::genivi::am::am_CustomRampType_t ramp, org::genivi::am::am_time_t time);
-
- virtual void asyncConnect(org::genivi::am::am_Handle_s handle, org::genivi::am::am_connectionID_t connectionID, org::genivi::am::am_sourceID_t sourceID, org::genivi::am::am_sinkID_t sinkID, org::genivi::am::am_CustomConnectionFormat_t connectionFormat);
-
- virtual void asyncDisconnect(org::genivi::am::am_Handle_s handle, org::genivi::am::am_connectionID_t connectionID);
-
- virtual void asyncAbort(org::genivi::am::am_Handle_s handle);
-
- virtual void asyncSetSinkSoundProperties(org::genivi::am::am_Handle_s handle, org::genivi::am::am_sinkID_t sinkID, org::genivi::am::am_SoundProperty_L listSoundProperties);
-
- virtual void asyncSetSinkSoundProperty(org::genivi::am::am_Handle_s handle, org::genivi::am::am_sinkID_t sinkID, org::genivi::am::am_SoundProperty_s soundProperty);
-
- virtual void asyncSetSourceSoundProperties(org::genivi::am::am_Handle_s handle, org::genivi::am::am_sourceID_t sourceID, org::genivi::am::am_SoundProperty_L listSoundProperties);
-
- virtual void asyncSetSourceSoundProperty(org::genivi::am::am_Handle_s handle, org::genivi::am::am_sourceID_t sourceID, org::genivi::am::am_SoundProperty_s soundProperty);
-
- virtual void asyncCrossFade(org::genivi::am::am_Handle_s handle, org::genivi::am::am_crossfaderID_t crossfaderID, org::genivi::am::am_HotSink_e hotSink, org::genivi::am::am_CustomRampType_t rampType, org::genivi::am::am_time_t time);
-
- virtual void asyncSetVolumes(org::genivi::am::am_Handle_s handle, org::genivi::am::am_Volumes_L volumes);
-
- virtual void asyncSetSinkNotificationConfiguration(org::genivi::am::am_Handle_s handle, org::genivi::am::am_sinkID_t sinkID, org::genivi::am::am_NotificationConfiguration_s notificationConfiguration);
-
- virtual void asyncSetSourceNotificationConfiguration(org::genivi::am::am_Handle_s handle, org::genivi::am::am_sourceID_t sourceID, org::genivi::am::am_NotificationConfiguration_s notificationConfiguration);
-
- static const char * ROUTING_SENDER_SERVICE;
- static const char * ROUTING_INTERFACE_SERVICE;
-};
-
-
-} /* namespace am */
-#endif /* CAMROUTINGSENDERSERVICE_H_ */
diff --git a/PluginRoutingInterfaceCAPI/test/CAmTestCAPIWrapper.cpp b/PluginRoutingInterfaceCAPI/test/CAmTestCAPIWrapper.cpp
deleted file mode 100644
index 6134d62..0000000
--- a/PluginRoutingInterfaceCAPI/test/CAmTestCAPIWrapper.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * Copyright (c) 2012 BMW
- *
- * \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 "CAmTestCAPIWrapper.h"
-
-namespace am {
-
-CAmTestCAPIWrapper::CAmTestCAPIWrapper(CAmSocketHandler* socketHandler):CAmCommonAPIWrapper(socketHandler)
-{
-
-}
-
-CAmTestCAPIWrapper::~CAmTestCAPIWrapper() {
- // TODO Auto-generated destructor stub
-}
-
-} /* namespace am */
diff --git a/PluginRoutingInterfaceCAPI/test/CAmTestCAPIWrapper.h b/PluginRoutingInterfaceCAPI/test/CAmTestCAPIWrapper.h
deleted file mode 100644
index 90499f9..0000000
--- a/PluginRoutingInterfaceCAPI/test/CAmTestCAPIWrapper.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- * Copyright (c) 2012 BMW
- *
- * \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 CAMTESTCAPIWRAPPER_H_
-#define CAMTESTCAPIWRAPPER_H_
-
-#include "shared/CAmCommonAPIWrapper.h"
-
-namespace am {
-
-class CAmTestCAPIWrapper: public am::CAmCommonAPIWrapper {
-public:
- CAmTestCAPIWrapper(CAmSocketHandler* socketHandler);
- virtual ~CAmTestCAPIWrapper();
-};
-
-} /* namespace am */
-#endif /* CAMTESTCAPIWRAPPER_H_ */
diff --git a/PluginRoutingInterfaceCAPI/test/CMakeLists.txt b/PluginRoutingInterfaceCAPI/test/CMakeLists.txt
deleted file mode 100644
index 9803dc5..0000000
--- a/PluginRoutingInterfaceCAPI/test/CMakeLists.txt
+++ /dev/null
@@ -1,133 +0,0 @@
-# Copyright (c) 2012 GENIVI Alliance
-# Copyright (c) 2012 BMW
-#
-# 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/.
-#
-
-cmake_minimum_required(VERSION 2.6)
-
-PROJECT(CAmRoutingInterfaceCAPITests)
-
-set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w -g -DUNIT_TEST=1 -DDLT_CONTEXT=AudioManager")
-
-string (REPLACE "-g -Wall -Wextra" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
-string (REPLACE "-pedantic" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
-
-set(STD_INCLUDE_DIRS "/usr/include")
-set(EXECUTABLE_OUTPUT_PATH ${TEST_EXECUTABLE_OUTPUT_PATH})
-
-FIND_PACKAGE(Threads)
-FIND_PACKAGE(PkgConfig)
-FIND_PACKAGE(PythonLibs REQUIRED)
-FIND_PACKAGE(CommonAPI REQUIRED)
-
-
-IF(WITH_DLT)
- pkg_check_modules(DLT REQUIRED automotive-dlt>=2.2.0)
-ENDIF(WITH_DLT)
-
-INCLUDE_DIRECTORIES(
- ${STD_INCLUDE_DIRS}
- ${CMAKE_SOURCE_DIR}
- ${CMAKE_CURRENT_BINARY_DIR}
- ${AUDIO_INCLUDE_FOLDER}
- ${CMAKE_SOURCE_DIR}
- ${DLT_INCLUDE_DIRS}
- ${COMMON_API_INCLUDE_DIRS}
- ${COMMON_API_DBUS_INCLUDE_DIRS}
- ${COMMON_API_GEN_INCLUDE_DIR}
- ${INCLUDE_FOLDER}
- ${PYTHON_INCLUDE_DIRS}
- ${GOOGLE_TEST_INCLUDE_DIR}
- ${GMOCK_INCLUDE_DIR}
- "../../AudioManagerDaemon/include"
- "../include"
-)
-
-link_directories(
- ${LINK_DIRECTORIES}
- ${COMMON_API_LIBRARY_DIRS}
- ${COMMON_API_DBUS_LIBRARY_DIRS}
-)
-
-file(GLOB CAPI_PLUGIN_INTERFACE_SRCS_CXX
- "../../AudioManagerDaemon/src/CAmCommonAPIWrapper.cpp"
- "../../AudioManagerDaemon/src/CAmSocketHandler.cpp"
- "../../AudioManagerDaemon/src/CAmDltWrapper.cpp"
- "../src/*.cpp"
- "CAmRoutingInterfaceCAPITests.cpp"
- "CAmTestCAPIWrapper.cpp"
- "CAmCommandSenderCommon.cpp"
- "CAmRoutingSenderService.cpp"
- "IAmRoutingSenderBackdoor.cpp"
- ${COMMON_API_ROUTING_INTERFACE_GEN_SOURCES}
-)
-
-set (CAPI_SENDER_INTERFACE "org.genivi.audiomanager.routingsender")
-set (CAPI_SENDER_INSTANCE "org.genivi.routingsender")
-set (CAPI_SENDER_PATH "/org/genivi/audiomanager/routingsender")
-
-set (CAPI_SENDER_INTERFACE_H "\"${CAPI_SENDER_INTERFACE}\"")
-set (CAPI_SENDER_INSTANCE_H "\"${CAPI_SENDER_INSTANCE}\"")
-set (CAPI_SENDER_PATH_H "\"${CAPI_SENDER_PATH}\"")
-
-set (CAPI_ROUTING_INTERFACE "org.genivi.audiomanager.routinginterface")
-set (CAPI_ROUTING_INSTANCE "org.genivi.audiomanager")
-set (CAPI_ROUTING_PATH "/org/genivi/audiomanager/routinginterface")
-
-set (CAPI_ROUTING_INTERFACE_H "\"${CAPI_ROUTING_INTERFACE}\"")
-set (CAPI_ROUTING_INSTANCE_H "\"${CAPI_ROUTING_INSTANCE}\"")
-set (CAPI_ROUTING_PATH_H "\"${CAPI_ROUTING_PATH}\"")
-
-
-ADD_EXECUTABLE(AmRoutingInterfaceCAPITests ${CAPI_PLUGIN_INTERFACE_SRCS_CXX})
-
-TARGET_LINK_LIBRARIES(AmRoutingInterfaceCAPITests
- ${DLT_LIBRARIES}
- ${CMAKE_DL_LIBS}
- ${CMAKE_THREAD_LIBS_INIT}
- ${PYTHON_LIBRARY}
- ${PC_GSTREAMER_LIBRARIES}
- ${COMMON_API_LIBRARIES}
- ${COMMON_API_DBUS_LIBRARIES}
- gtest
- gmock
-)
-
-add_custom_command(
- PRE_BUILD
- OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/CAmRoutingSenderService.h
- COMMAND generateheader ${CMAKE_CURRENT_SOURCE_DIR}/cmake/CAmRoutingSenderService.h.in ${CMAKE_CURRENT_SOURCE_DIR}/CAmRoutingSenderService.h
- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/cmake/CAmRoutingSenderService.h.in
-)
-
-CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/RoutingSender_dbus.conf.in ${CMAKE_CURRENT_SOURCE_DIR}/RoutingSender_dbus.conf)
-CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/CAmRoutingSenderService.h.in ${CMAKE_CURRENT_SOURCE_DIR}/CAmRoutingSenderService.h)
-
-FILE(READ ${CMAKE_CURRENT_SOURCE_DIR}/RoutingSender_dbus.conf ROUTING_TESTDOMAININTERFACE_DBUS_CONF)
-CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/AmRoutingInterfaceCAPITests_dbus.conf.in ${EXECUTABLE_OUTPUT_PATH}/AmRoutingInterfaceCAPITests_dbus.conf)
-CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/AmRoutingInterfaceCAPITests_dbus.conf.in ${EXECUTABLE_OUTPUT_PATH}/AmRoutingSenderTestDomain_dbus.conf)
-
-INSTALL(TARGETS AmRoutingInterfaceCAPITests
- DESTINATION "~/AudioManagerTest/"
- PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
- COMPONENT tests
-)
-
-#execute_process(
-# COMMAND cp "${CMAKE_SOURCE_DIR}/PluginCommandInterfaceCAPI/fidls/PluginCommandInterfaceCAPI_dbus.conf" ${EXECUTABLE_OUTPUT_PATH})
-
-SET(ADD_DEPEND "audiomanager-bin" "sqlite3(>=3.6.22)" "dlt" "gtest" "libpthread-stubs0")
-set_property(GLOBAL APPEND PROPERTY tests_prop "${ADD_DEPEND}")
-
diff --git a/PluginRoutingInterfaceCAPI/test/IAmRoutingSenderBackdoor.cpp b/PluginRoutingInterfaceCAPI/test/IAmRoutingSenderBackdoor.cpp
deleted file mode 100644
index 945a5e9..0000000
--- a/PluginRoutingInterfaceCAPI/test/IAmRoutingSenderBackdoor.cpp
+++ /dev/null
@@ -1,87 +0,0 @@
-/**
- * Copyright (c) 2012 BMW
- *
- * \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 "IAmRoutingSenderBackdoor.h"
-#include "../include/CAmRoutingSenderCAPI.h"
-
-
-namespace am {
-
-bool IAmRoutingSenderBackdoor::containsDomainWithID(const am_domainID_t & domainID)
-{
- return NULL!=routingSender->mLookupData.getValueForKey(domainID, routingSender->mLookupData.mMapDomains);
-}
-
-bool IAmRoutingSenderBackdoor::containsSourceWithID(const am_sourceID_t & sourceID)
-{
- return NULL!=routingSender->mLookupData.getValueForKey(sourceID, routingSender->mLookupData.mMapSources);
-}
-
-bool IAmRoutingSenderBackdoor::containsSinkWithID(const am_sinkID_t & sinkID)
-{
- return NULL!=routingSender->mLookupData.getValueForKey(sinkID, routingSender->mLookupData.mMapSinks);
-}
-
-bool IAmRoutingSenderBackdoor::containsCrossfader(const am_crossfaderID_t & crossfaderID)
-{
- return routingSender->mLookupData.mMapCrossfaders.find(crossfaderID)!=routingSender->mLookupData.mMapCrossfaders.end();
-}
-
-bool IAmRoutingSenderBackdoor::containsHandle(const uint16_t & handle)
-{
- return routingSender->mLookupData.mMapHandles.find(handle)!=routingSender->mLookupData.mMapHandles.end();
-}
-
-bool IAmRoutingSenderBackdoor::containsConnection(const am_connectionID_t & connID)
-{
- return NULL!=routingSender->mLookupData.getValueForKey(connID, routingSender->mLookupData.mMapConnections);
-}
-
-unsigned IAmRoutingSenderBackdoor::domainsCount()
-{
- return routingSender->mLookupData.mMapDomains.size();
-}
-
-unsigned IAmRoutingSenderBackdoor::sourcesCount()
-{
- return routingSender->mLookupData.mMapSources.size();
-}
-
-unsigned IAmRoutingSenderBackdoor::sinksCount()
-{
- return routingSender->mLookupData.mMapSinks.size();
-}
-
-unsigned IAmRoutingSenderBackdoor::crossfadersCount()
-{
- return routingSender->mLookupData.mMapCrossfaders.size();
-}
-
-unsigned IAmRoutingSenderBackdoor::handlesCount()
-{
- return routingSender->mLookupData.mMapHandles.size();
-}
-
-unsigned IAmRoutingSenderBackdoor::connectionsCount()
-{
- return routingSender->mLookupData.mMapConnections.size();
-}
-
-
-}
-
-
diff --git a/PluginRoutingInterfaceCAPI/test/IAmRoutingSenderBackdoor.h b/PluginRoutingInterfaceCAPI/test/IAmRoutingSenderBackdoor.h
deleted file mode 100644
index 80d0f4e..0000000
--- a/PluginRoutingInterfaceCAPI/test/IAmRoutingSenderBackdoor.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/**
- * Copyright (c) 2012 BMW
- *
- * \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 ROUTINGSENDERINTERFACEBACKDOOR_H_
-#define ROUTINGSENDERINTERFACEBACKDOOR_H_
-
-#include "audiomanagertypes.h"
-
-namespace am
-{
-
-class CAmRoutingSenderCAPI;
-
-class IAmRoutingSenderBackdoor
-{
- CAmRoutingSenderCAPI *routingSender;
-public:
- IAmRoutingSenderBackdoor():routingSender(NULL){};
- IAmRoutingSenderBackdoor(CAmRoutingSenderCAPI *aSender):routingSender(aSender){};
- virtual ~IAmRoutingSenderBackdoor(){routingSender=NULL;};
-
- bool containsDomainWithID(const am_domainID_t & domainID);
- bool containsSourceWithID(const am_sourceID_t & sourceID);
- bool containsSinkWithID(const am_sinkID_t & sinkID);
- bool containsCrossfader(const am_crossfaderID_t & crossfaderID);
- bool containsHandle(const uint16_t & handle);
- bool containsConnection(const am_connectionID_t & connID);
- unsigned domainsCount();
- unsigned sourcesCount();
- unsigned sinksCount();
- unsigned crossfadersCount();
- unsigned handlesCount();
- unsigned connectionsCount();
-};
-
-}
-
-#endif /* ROUTINGSENDERINTERFACEBACKDOOR_H_ */
diff --git a/PluginRoutingInterfaceCAPI/test/MockIAmRoutingReceive.h b/PluginRoutingInterfaceCAPI/test/MockIAmRoutingReceive.h
deleted file mode 100644
index 0638aa4..0000000
--- a/PluginRoutingInterfaceCAPI/test/MockIAmRoutingReceive.h
+++ /dev/null
@@ -1,136 +0,0 @@
-/**
- * Copyright (c) 2012 BMW
- *
- * \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 MOCKROUTINGRECEIVENTERFACE_H_
-#define MOCKROUTINGRECEIVENTERFACE_H_
-
-#include "routing/IAmRoutingReceive.h"
-#include "gtest/gtest.h"
-#include "gmock/gmock.h"
-
-namespace am {
-
-class MockIAmRoutingReceive : public IAmRoutingReceive {
- public:
- MOCK_CONST_METHOD1(getInterfaceVersion,
- void(std::string& version));
- MOCK_METHOD3(ackConnect,
- void(const am_Handle_s handle, const am_connectionID_t connectionID, const am_Error_e error));
- MOCK_METHOD3(ackDisconnect,
- void(const am_Handle_s handle, const am_connectionID_t connectionID, const am_Error_e error));
- MOCK_METHOD3(ackSetSinkVolumeChange,
- void(const am_Handle_s handle, const am_volume_t volume, const am_Error_e error));
- MOCK_METHOD3(ackSetSourceVolumeChange,
- void(const am_Handle_s handle, const am_volume_t volume, const am_Error_e error));
- MOCK_METHOD2(ackSetSourceState,
- void(const am_Handle_s handle, const am_Error_e error));
- MOCK_METHOD2(ackSetSinkSoundProperties,
- void(const am_Handle_s handle, const am_Error_e error));
- MOCK_METHOD2(ackSetSinkSoundProperty,
- void(const am_Handle_s handle, const am_Error_e error));
- MOCK_METHOD2(ackSetSourceSoundProperties,
- void(const am_Handle_s handle, const am_Error_e error));
- MOCK_METHOD2(ackSetSourceSoundProperty,
- void(const am_Handle_s handle, const am_Error_e error));
- MOCK_METHOD3(ackCrossFading,
- void(const am_Handle_s handle, const am_HotSink_e hotSink, const am_Error_e error));
- MOCK_METHOD3(ackSourceVolumeTick,
- void(const am_Handle_s handle, const am_sourceID_t sourceID, const am_volume_t volume));
- MOCK_METHOD3(ackSinkVolumeTick,
- void(const am_Handle_s handle, const am_sinkID_t sinkID, const am_volume_t volume));
- MOCK_METHOD2(peekDomain,
- am_Error_e(const std::string& name, am_domainID_t& domainID));
- MOCK_METHOD2(registerDomain,
- am_Error_e(const am_Domain_s& domainData, am_domainID_t& domainID));
- MOCK_METHOD1(deregisterDomain,
- am_Error_e(const am_domainID_t domainID));
- MOCK_METHOD2(registerGateway,
- am_Error_e(const am_Gateway_s& gatewayData, am_gatewayID_t& gatewayID));
- MOCK_METHOD2(registerConverter,
- am_Error_e(const am_Converter_s& converterData, am_converterID_t& converterID));
- MOCK_METHOD1(deregisterGateway,
- am_Error_e(const am_gatewayID_t gatewayID));
- MOCK_METHOD1(deregisterConverter,
- am_Error_e(const am_converterID_t converterID));
- MOCK_METHOD2(peekSink,
- am_Error_e(const std::string& name, am_sinkID_t& sinkID));
- MOCK_METHOD2(registerSink,
- am_Error_e(const am_Sink_s& sinkData, am_sinkID_t& sinkID));
- MOCK_METHOD1(deregisterSink,
- am_Error_e(const am_sinkID_t sinkID));
- MOCK_METHOD2(peekSource,
- am_Error_e(const std::string& name, am_sourceID_t& sourceID));
- MOCK_METHOD2(registerSource,
- am_Error_e(const am_Source_s& sourceData, am_sourceID_t& sourceID));
- MOCK_METHOD1(deregisterSource,
- am_Error_e(const am_sourceID_t sourceID));
- MOCK_METHOD2(registerCrossfader,
- am_Error_e(const am_Crossfader_s& crossfaderData, am_crossfaderID_t& crossfaderID));
- MOCK_METHOD1(deregisterCrossfader,
- am_Error_e(const am_crossfaderID_t crossfaderID));
- MOCK_METHOD2(peekSourceClassID,
- am_Error_e(const std::string& name, am_sourceClass_t& sourceClassID));
- MOCK_METHOD2(peekSinkClassID,
- am_Error_e(const std::string& name, am_sinkClass_t& sinkClassID));
- MOCK_METHOD2(hookInterruptStatusChange,
- void(const am_sourceID_t sourceID, const am_InterruptState_e interruptState));
- MOCK_METHOD1(hookDomainRegistrationComplete,
- void(const am_domainID_t domainID));
- MOCK_METHOD2(hookSinkAvailablityStatusChange,
- void(const am_sinkID_t sinkID, const am_Availability_s& availability));
- MOCK_METHOD2(hookSourceAvailablityStatusChange,
- void(const am_sourceID_t sourceID, const am_Availability_s& availability));
- MOCK_METHOD2(hookDomainStateChange,
- void(const am_domainID_t domainID, const am_DomainState_e domainState));
- MOCK_METHOD2(hookTimingInformationChanged,
- void(const am_connectionID_t connectionID, const am_timeSync_t delay));
- MOCK_METHOD1(sendChangedData,
- void(const std::vector<am_EarlyData_s>& earlyData));
- MOCK_CONST_METHOD1(getDBusConnectionWrapper,
- am_Error_e(CAmDbusWrapper*& dbusConnectionWrapper));
- MOCK_CONST_METHOD1(getSocketHandler,
- am_Error_e(CAmSocketHandler*& socketHandler));
- MOCK_METHOD2(confirmRoutingReady,
- void(const uint16_t handle, const am_Error_e error));
- MOCK_METHOD2(confirmRoutingRundown,
- void(const uint16_t handle, const am_Error_e error));
- MOCK_METHOD4(updateGateway,
- am_Error_e(const am_gatewayID_t gatewayID, const std::vector<am_CustomConnectionFormat_t>& listSourceFormats, const std::vector<am_CustomConnectionFormat_t>& listSinkFormats, const std::vector<bool>& convertionMatrix));
- MOCK_METHOD4(updateConverter,
- am_Error_e(const am_converterID_t converterID, const std::vector<am_CustomConnectionFormat_t>& listSourceFormats, const std::vector<am_CustomConnectionFormat_t>& listSinkFormats, const std::vector<bool>& convertionMatrix));
- MOCK_METHOD5(updateSink,
- am_Error_e(const am_sinkID_t sinkID, const am_sinkClass_t sinkClassID, const std::vector<am_SoundProperty_s>& listSoundProperties, const std::vector<am_CustomConnectionFormat_t>& listConnectionFormats, const std::vector<am_MainSoundProperty_s>& listMainSoundProperties));
- MOCK_METHOD5(updateSource,
- am_Error_e(const am_sourceID_t sourceID, const am_sourceClass_t sourceClassID, const std::vector<am_SoundProperty_s>& listSoundProperties, const std::vector<am_CustomConnectionFormat_t>& listConnectionFormats, const std::vector<am_MainSoundProperty_s>& listMainSoundProperties));
- MOCK_METHOD3(ackSetVolumes,
- void(const am_Handle_s handle, const std::vector<am_Volumes_s>& listvolumes, const am_Error_e error));
- MOCK_METHOD2(ackSinkNotificationConfiguration,
- void(const am_Handle_s handle, const am_Error_e error));
- MOCK_METHOD2(ackSourceNotificationConfiguration,
- void(const am_Handle_s handle, const am_Error_e error));
- MOCK_METHOD2(hookSinkNotificationDataChange,
- void(const am_sinkID_t sinkID, const am_NotificationPayload_s& payload));
- MOCK_METHOD2(hookSourceNotificationDataChange,
- void(const am_sourceID_t sourceID, const am_NotificationPayload_s& payload));
- MOCK_METHOD2(getDomainOfSource,
- am_Error_e(const am_sourceID_t sourceID, am_domainID_t& domainID));
- MOCK_METHOD2(getDomainOfSink,
- am_Error_e(const am_sinkID_t sinkID, am_domainID_t& domainID));
-};
-
-} // namespace am
-#endif /* MOCKROUTINGRECEIVENTERFACE_H_ */
diff --git a/PluginRoutingInterfaceCAPI/test/RoutingSender_dbus.conf b/PluginRoutingInterfaceCAPI/test/RoutingSender_dbus.conf
deleted file mode 100755
index 30424b9..0000000
--- a/PluginRoutingInterfaceCAPI/test/RoutingSender_dbus.conf
+++ /dev/null
@@ -1,8 +0,0 @@
-##################################### Routing Test Domain Interface configuration ################################
-# RoutingSender_dbus.conf #
-# If you change something make sure you re-configure with 'ccmake..' which generates the *_dbus.conf file again. #
-##################################################################################################################
-[local:org.genivi.audiomanager.routingsender:org.genivi.routingsender]
-dbus_connection=org.genivi.routingsender
-dbus_object=/org/genivi/audiomanager/routingsender
-dbus_interface=org.genivi.audiomanager.routingsender
diff --git a/PluginRoutingInterfaceCAPI/test/cmake/AmRoutingInterfaceCAPITests_dbus.conf.in b/PluginRoutingInterfaceCAPI/test/cmake/AmRoutingInterfaceCAPITests_dbus.conf.in
deleted file mode 100755
index 95d09b2..0000000
--- a/PluginRoutingInterfaceCAPI/test/cmake/AmRoutingInterfaceCAPITests_dbus.conf.in
+++ /dev/null
@@ -1,3 +0,0 @@
-@ROUTING_INTERFACE_DBUS_CONF@
-
-@ROUTING_TESTDOMAININTERFACE_DBUS_CONF@ \ No newline at end of file
diff --git a/PluginRoutingInterfaceCAPI/test/cmake/CAmRoutingSenderService.h.in b/PluginRoutingInterfaceCAPI/test/cmake/CAmRoutingSenderService.h.in
deleted file mode 100644
index fdd6d9f..0000000
--- a/PluginRoutingInterfaceCAPI/test/cmake/CAmRoutingSenderService.h.in
+++ /dev/null
@@ -1,111 +0,0 @@
-/**
- * Copyright (c) 2012 BMW
- *
- * \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 CAMROUTINGSENDERSERVICE_H_
-#define CAMROUTINGSENDERSERVICE_H_
-
-#include "audiomanagertypes.h"
-#include <org/genivi/am/RoutingControlStubDefault.h>
-#include <org/genivi/am/RoutingControlObserverProxy.h>
-
-/**
- * GENERATED FROM CMAKE. PLEASE USE cmake/CAmRoutingSenderService.h.in IF YOU WANT TO MAKE CHANGES.
- */
-
-namespace am {
-
-using namespace CommonAPI;
-
-class CAmCommonAPIWrapper;
-
-/**
- * THE FOLLOWING DEFINES ARE POPULATED FROM THE CMAKELISTS.TXT .
- */
-#define CAPI_SENDER_INTERFACE @CAPI_SENDER_INTERFACE_H@
-#define CAPI_SENDER_INSTANCE @CAPI_SENDER_INSTANCE_H@
-#define CAPI_SENDER_PATH @CAPI_SENDER_PATH_H@
-
-#define CAPI_ROUTING_INTERFACE @CAPI_ROUTING_INTERFACE_H@
-#define CAPI_ROUTING_INSTANCE @CAPI_ROUTING_INSTANCE_H@
-#define CAPI_ROUTING_PATH @CAPI_ROUTING_PATH_H@
-
-
-/** Test class implementing the routing sender service.
-*
-* Please see cmake/CAmRoutingSenderService.h.in
-*/
-class CAmRoutingSenderService : public org::genivi::am::RoutingControlStubDefault {
-
- org::genivi::am::am_Domain_s mDomainData;
- org::genivi::am::am_Handle_s mAbortedHandle;
- bool mIsServiceAvailable;
- bool mIsDomainRegistred;
- bool mIsReady;
- CAmCommonAPIWrapper *mpWrapper;
- std::shared_ptr<org::genivi::am::RoutingControlObserverProxy<> > mRoutingInterfaceProxy;
-
-public:
-
- CAmRoutingSenderService();
- CAmRoutingSenderService(CAmCommonAPIWrapper * aWrapper);
- CAmRoutingSenderService(CAmCommonAPIWrapper * aWrapper, std::shared_ptr<org::genivi::am::RoutingControlObserverProxy<> > aProxy);
- virtual ~CAmRoutingSenderService();
-
- void onServiceStatusEvent(const CommonAPI::AvailabilityStatus& serviceStatus);
- void onRoutingReadyRundown();
- void onRoutingReadyEvent();
- void registerDomain();
- void setAbortHandle(org::genivi::am::am_Handle_s handle);
- org::genivi::am::am_Error_e errorForHandle(const org::genivi::am::am_Handle_s & handle);
-
- virtual void asyncSetSourceState(org::genivi::am::am_Handle_s handle, org::genivi::am::am_sourceID_t sourceID, org::genivi::am::am_SourceState_e sourceState);
-
- virtual void setDomainState(org::genivi::am::am_domainID_t domainID, org::genivi::am::am_DomainState_e domainState, org::genivi::am::am_Error_e& error);
-
- virtual void asyncSetSourceVolume(org::genivi::am::am_Handle_s handle, org::genivi::am::am_sourceID_t sourceID, org::genivi::am::am_volume_t volume, org::genivi::am::am_CustomRampType_t ramp, org::genivi::am::am_time_t time);
-
- virtual void asyncSetSinkVolume(org::genivi::am::am_Handle_s handle, org::genivi::am::am_sinkID_t sinkID, org::genivi::am::am_volume_t volume, org::genivi::am::am_CustomRampType_t ramp, org::genivi::am::am_time_t time);
-
- virtual void asyncConnect(org::genivi::am::am_Handle_s handle, org::genivi::am::am_connectionID_t connectionID, org::genivi::am::am_sourceID_t sourceID, org::genivi::am::am_sinkID_t sinkID, org::genivi::am::am_CustomConnectionFormat_t connectionFormat);
-
- virtual void asyncDisconnect(org::genivi::am::am_Handle_s handle, org::genivi::am::am_connectionID_t connectionID);
-
- virtual void asyncAbort(org::genivi::am::am_Handle_s handle);
-
- virtual void asyncSetSinkSoundProperties(org::genivi::am::am_Handle_s handle, org::genivi::am::am_sinkID_t sinkID, org::genivi::am::am_SoundProperty_L listSoundProperties);
-
- virtual void asyncSetSinkSoundProperty(org::genivi::am::am_Handle_s handle, org::genivi::am::am_sinkID_t sinkID, org::genivi::am::am_SoundProperty_s soundProperty);
-
- virtual void asyncSetSourceSoundProperties(org::genivi::am::am_Handle_s handle, org::genivi::am::am_sourceID_t sourceID, org::genivi::am::am_SoundProperty_L listSoundProperties);
-
- virtual void asyncSetSourceSoundProperty(org::genivi::am::am_Handle_s handle, org::genivi::am::am_sourceID_t sourceID, org::genivi::am::am_SoundProperty_s soundProperty);
-
- virtual void asyncCrossFade(org::genivi::am::am_Handle_s handle, org::genivi::am::am_crossfaderID_t crossfaderID, org::genivi::am::am_HotSink_e hotSink, org::genivi::am::am_CustomRampType_t rampType, org::genivi::am::am_time_t time);
-
- virtual void asyncSetVolumes(org::genivi::am::am_Handle_s handle, org::genivi::am::am_Volumes_L volumes);
-
- virtual void asyncSetSinkNotificationConfiguration(org::genivi::am::am_Handle_s handle, org::genivi::am::am_sinkID_t sinkID, org::genivi::am::am_NotificationConfiguration_s notificationConfiguration);
-
- virtual void asyncSetSourceNotificationConfiguration(org::genivi::am::am_Handle_s handle, org::genivi::am::am_sourceID_t sourceID, org::genivi::am::am_NotificationConfiguration_s notificationConfiguration);
-
- static const char * ROUTING_SENDER_SERVICE;
- static const char * ROUTING_INTERFACE_SERVICE;
-};
-
-
-} /* namespace am */
-#endif /* CAMROUTINGSENDERSERVICE_H_ */
diff --git a/PluginRoutingInterfaceCAPI/test/cmake/RoutingSender_dbus.conf.in b/PluginRoutingInterfaceCAPI/test/cmake/RoutingSender_dbus.conf.in
deleted file mode 100755
index bcd29a6..0000000
--- a/PluginRoutingInterfaceCAPI/test/cmake/RoutingSender_dbus.conf.in
+++ /dev/null
@@ -1,8 +0,0 @@
-##################################### Routing Test Domain Interface configuration ################################
-# RoutingSender_dbus.conf #
-# If you change something make sure you re-configure with 'ccmake..' which generates the *_dbus.conf file again. #
-##################################################################################################################
-[local:@CAPI_SENDER_INTERFACE@:@CAPI_SENDER_INSTANCE@]
-dbus_connection=@CAPI_SENDER_INSTANCE@
-dbus_object=@CAPI_SENDER_PATH@
-dbus_interface=@CAPI_SENDER_INTERFACE@ \ No newline at end of file
diff --git a/PluginRoutingInterfaceCAPI/test/cmake/config.cmake b/PluginRoutingInterfaceCAPI/test/cmake/config.cmake
deleted file mode 100644
index b2ef0b2..0000000
--- a/PluginRoutingInterfaceCAPI/test/cmake/config.cmake
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef _ROUTINGDBUS_CONFIG_H
-#define _ROUTINGDBUS_CONFIG_H
-
-#cmakedefine CAPI_SENDER_INTERFACE "@CAPI_SENDER_INTERFACE@"
-#cmakedefine CAPI_SENDER_INSTANCE "@CAPI_SENDER_INSTANCE@"
-#cmakedefine CAPI_SENDER_PATH "@CAPI_SENDER_PATH@"
-
-#endif /* _ROUTINGDBUS_CONFIG_H */
diff --git a/PluginRoutingInterfaceDbus/CMakeLists.txt b/PluginRoutingInterfaceDbus/CMakeLists.txt
deleted file mode 100644
index 5912e10..0000000
--- a/PluginRoutingInterfaceDbus/CMakeLists.txt
+++ /dev/null
@@ -1,107 +0,0 @@
-# Copyright (c) 2012 GENIVI Alliance
-# Copyright (c) 2012 BMW
-#
-# author Christian Mueller, christian.ei.mueller@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.6)
-
-PROJECT(PluginRoutingInterfaceDbus)
-
-OPTION(WITH_ROUTING_INTERFACE_DBUS
- "build with routing iterface dbus plugin" ON)
-
-IF(WITH_ROUTING_INTERFACE_DBUS)
-
-set(LIBRARY_OUTPUT_PATH ${PLUGINS_OUTPUT_PATH}/routing)
-set(DOC_OUTPUT_PATH ${DOC_OUTPUT_PATH}/RoutingPlugin)
-set(INCLUDE_FOLDER "include")
-
-SET(SHARED_FOLDER "${CMAKE_INSTALL_PREFIX}/share")
-FILE(READ "${AUDIO_INCLUDE_FOLDER}/routing/IAmRoutingSend.h" VERSION_BUFFER LIMIT 6000)
-STRING(REGEX MATCH "RoutingSendVersion*.[^0-9]*[0-9].[0-9]*[0-9]" LIB_INTERFACE_VERSION_STRING ${VERSION_BUFFER})
-STRING(REGEX REPLACE "RoutingSendVersion*.." "" LIB_INTERFACE_VERSION ${LIB_INTERFACE_VERSION_STRING})
-MESSAGE(STATUS "Building against routing interface version ${LIB_INTERFACE_VERSION}")
-
-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 ${SHARED_FOLDER}/audiomanager)
- SET(ROUTING_DBUS_INTROSPECTION_FILE ${SHARED_FOLDER}/audiomanager/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}
- ${PROJECT_INCLUDE_FOLDER}
- ${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 "${CMAKE_SOURCE_DIR}/bin"
- COMMAND cp "${CMAKE_SOURCE_DIR}/PluginRoutingInterfaceDbus/${INCLUDE_FOLDER}/RoutingReceiver.xml" ${EXECUTABLE_OUTPUT_PATH}/RoutingReceiver.xml)
- execute_process(
- COMMAND mkdir -p "${CMAKE_SOURCE_DIR}/bin"
- COMMAND cp "${CMAKE_SOURCE_DIR}/PluginRoutingInterfaceDbus/${INCLUDE_FOLDER}/RoutingSender.xml" ${EXECUTABLE_OUTPUT_PATH}/RoutingSender.xml)
-ENDIF(USE_BUILD_LIBS)
-
-
-#IF(WITH_DOCUMENTATION)
-# file(MAKE_DIRECTORY ${DOC_OUTPUT_PATH})
-# configure_file(${DOXY_FILE} ${DOC_OUTPUT_PATH}/Doxyfile @ONLY IMMEDIATE)
-# add_custom_target (PluginRoutingInterfaceDBusDocs ALL
-# COMMAND ${DOXYGEN_EXECUTABLE} ${DOC_OUTPUT_PATH}/Doxyfile WORKING_DIRECTORY ${DOC_OUTPUT_PATH}
-# SOURCES ${PROJECT_BINARY_DIR} ${DOC_OUTPUT_PATH}/Doxyfile
-# )
-#ENDIF(WITH_DOCUMENTATION)
-
-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 sampleplugins
-)
-
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/RoutingReceiver.xml
- DESTINATION "${ROUTING_DBUS_INTROSPECTION_FOLDER}"
- COMPONENT sampleplugins
-)
-
-
-SET(ADD_DEPEND "audiomanager-bin" "dlt" "libdbus-1-3(>=1.2.16)")
-set_property(GLOBAL APPEND PROPERTY sampleplugins_prop "${ADD_DEPEND}")
-
-ENDIF()
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 fb3160e..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 Mueller, christian.ei.mueller@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 b95c227..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 Mueller, christian.ei.mueller@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 3a863e6..0000000
--- a/PluginRoutingInterfaceDbus/include/CAmRoutingSenderDbus.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/**
- * Copyright (c) 2012 BMW
- *
- * \author Christian Mueller, christian.ei.mueller@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 "routing/IAmRoutingSend.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 b39b674..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 Mueller, christian.ei.mueller@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 87ab078..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 "/home/genius/workspace/AudioManager2/bin/RoutingReceiver.xml"
-
-#endif /* _ROUTINGDBUS_CONFIG_H */
diff --git a/PluginRoutingInterfaceDbus/src/CAmDbusMessageHandler.cpp b/PluginRoutingInterfaceDbus/src/CAmDbusMessageHandler.cpp
deleted file mode 100644
index 0426c10..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 Mueller, christian.ei.mueller@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 "config.h"
-#include <cstdlib>
-#include <cassert>
-#include <vector>
-#include "CAmRoutingSenderDbus.h"
-#include "shared/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 e3bb371..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 Mueller, christian.ei.mueller@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 "shared/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 306ad7f..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 Mueller, christian.ei.mueller@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 "shared/CAmDltWrapper.h"
-#include "shared/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 c2924ba..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 Mueller, christian.ei.mueller@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 "shared/CAmDbusWrapper.h"
-#include "shared/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/Plugins/README b/Plugins/README
new file mode 100644
index 0000000..9a69afd
--- /dev/null
+++ b/Plugins/README
@@ -0,0 +1 @@
+clone the plugin repository here (if you like)
diff --git a/README b/README
index 0b3cb49..2020626 100755
--- a/README
+++ b/README
@@ -18,14 +18,21 @@ This Source Code Form is subject to the terms of the
Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
this file, You can obtain one at http://mozilla.org/MPL/2.0/.
-author Christian Mueller, christian.linke@bmw.de BMW 2011,2012
+author Christian Linke = Christian Linke christian.linke@bmw.de BMW 2011-2015
For further information see http://projects.genivi.org/audio-manager/.
+== Repositories
+The main repository is http://git.projects.genivi.org-AudioManager.git
+
+The repository for example plugins can be found here: http://git.projects.genivi.org/AudioManagerPlugins.git
+
== License
The licenses of this project are split into two parts:
+
1) the AudioManagerDaemon, licensed under MPL 2.0
-2) all other parts that serve as example code that can be taken to build up an own project with it -
+
+2) the plugins that serve as example code that can be taken to build up an own project with it -
these parts are licensed with the MIT license
Contribution is done under GENIVI CLA or MPL2.0.
@@ -45,11 +52,15 @@ For the daemon the third number (for example 1.0.X) describes the patch version.
The versioning scheme is used for the AudioManager daemon itself and for each of it's interfaces. The versioning of the Interfaces in EA is defined via the tag "version" and the name of the interfaceversion versionName, for example "CommandReceiveVersion". This information is generated into the interface header files and is used then by cmake to set the interface versions.
Whenever changes are done, the minor version of the interface needs to be incremented.
+Since 7.0, the AudioManager follows a new versioning scheme. Please check the documentation for that.
+
== Documentation
A very detailed documentation is provided by doxygen. In order to use this, please compile the AudioManager with
----
cmake -DWITH_DOCUMENTATION=ON
make
+
+The README is compiled into README.html with asciidoc
----
== COMPILE PROGRAMS
@@ -57,62 +68,48 @@ make
=== Compile Options
These are the compile options with default values:
- BUILD_SHARED_LIBS OFF
- CMAKE_BUILD_TYPE
- CMAKE_INSTALL_PREFIX /usr/local
- COMMON_API_DBUS_LIBRARY /usr/local/lib/libCommonAPI-DBus.so
- COMMON_API_LIBRARY /usr/local/lib/libCommonAPI.so
- GLIB_DBUS_TYPES_TOLERANT ON
- USE_BUILD_LIBS ON
- WITH_COMMAND_INTERFACE_COMMON_ ON
- WITH_DATABASE_STORAGE OFF
- WITH_DLT ON
- WITH_DOCUMENTATION ON
- WITH_ENABLED_IPC CAPI
- WITH_LOGSTATE ON
- WITH_NSM ON
- WITH_OXF_ANIMATION OFF
- WITH_OXF_TRACE OFF
- WITH_PLUGIN_COMMAND ON
- WITH_PLUGIN_CONTROL ON
- WITH_PLUGIN_ROUTING ON
- WITH_ROUTING_INTERFACE_ASYNC OFF
- WITH_ROUTING_INTERFACE_CAPI ON
- WITH_SYSTEMD_WATCHDOG OFF
- WITH_TELNET ON
- WITH_TESTS ON
- WITH_TEST_CONTROLLER OFF
- gmock_build_tests OFF
- gtest_build_samples OFF
- gtest_build_tests OFF
- gtest_disable_pthreads OFF
- gtest_force_shared_crt OFF
+ AM_MAP_CAPACITY 10
+ AM_MAX_CONNECTIONS 0x1000
+ AM_SHARE_FOLDER /usr/local/share/audiomanager
+ BUILD_SHARED_LIBS OFF
+ CMAKE_BUILD_TYPE
+ CMAKE_INSTALL_PREFIX /usr/local
+ COMMON_API_DBUS_LIBRARY /usr/local/lib/libCommonAPI-DBus.so
+ COMMON_API_LIBRARY /usr/local/lib/libCommonAPI.so
+ DBUS_SERVICE_OBJECT_PATH /org/genivi/audiomanager
+ DBUS_SERVICE_PREFIX org.genivi.audiomanager
+ DEFAULT_TELNETPORT 6080
+ DOC_OUTPUT_PATH XXX/build/doc
+ DYNAMIC_ID_BOUNDARY 100
+ EXECUTABLE_OUTPUT_PATH XXX/build/bin
+ GLIB_DBUS_TYPES_TOLERANT ON
+ LIB_INSTALL_SUFFIX audiomanager
+ MAX_TELNETCONNECTIONS 3
+ NSM_BUS_INTERFACE org.genivi.NodeStateManager
+ NSM_INTERFACE org.genivi.NodeStateManager.Consumer
+ NSM_PATH /org/genivi/NodeStateManager
+ PLUGINS_OUTPUT_PATH XXX/build/plugins
+ TEST_EXECUTABLE_INSTALL_PATH ~/tests
+ TEST_EXECUTABLE_OUTPUT_PATH XXX/build/bin/tests
+ USE_BUILD_LIBS ON
+ WITH_DATABASE_STORAGE OFF
+ WITH_DLT ON
+ WITH_DOCUMENTATION OFF
+ WITH_ENABLED_IPC CAPI
+ WITH_NSM OFF
+ WITH_SYSTEMD_WATCHDOG OFF
+ WITH_TELNET ON
+ WITH_TESTS ON
+ gmock_build_tests OFF
+ gtest_build_samples OFF
+ gtest_build_tests OFF
+ gtest_disable_pthreads OFF
+ gtest_force_shared_crt OFF
=== Passing options to cmake:
-.-DVERSION="XXX"
-When building the AudioManager without taking it from the git (and thus having a .git folder), you can set the version via passing _-DVERSION="XXX"_ to cmake.
-
-.-DDBUS_SERVICE_PREFIX="XXX"
-sets the service prefix for Dbus, default "org.genivi.audiomanager\0"
-
-.-DDBUS_SERVICE_OBJECT_PATH="XXX"
-sets the object path for Dbus, default "/org/genivi/audiomanager\0"
-
-.-DDEFAULT_TELNETPORT="XXX"
-sets the default telnetport, default 6060. Can be overwriten by command line parameter
-
-.-DMAX_TELNETCONNECTIONS="XXX"
-sets the default maximum number of telnetconnections, default is 3
-
-.-DNSM_PATH="XXX"
-sets the path of the NSM DBUS interface
-
-.-DNSM_INTERFACE="XXX"
-sets the interface to the NSM DBUS interface
-
-In order to change these options, you can modify this values with ccmake, do the appropriate changes in
-CmakeList.txt or via the commandline for cmake or (when installed via ccmake)
+Standard CMake can be used to configure these options. Tools like ccmake can be used to visually change the values.
+For each option, some hints are given.
=== Build dependencies
Basically, all build dependencies are optional- but you might need to use some if you want to have support for Dbus,
@@ -131,15 +128,26 @@ To install them in a build environment like Ubuntu you can use:
sudo apt-get install libdbus-1-dev libsqlite3-dev doxygen git cmake build-essential
----
+=== AudioManagerUtilities
+
+In the AudioManagerUtilites you can find hany helper functions that can be reused by other projects as well.
+
=== The NodeStateManager
The nodestatemanager headers are needed to compile the audiomanager. If the nodestatemanagerincludes are not found,
the headers shipped with the audiomanager are used.
-The nodestatemanager can be retrieved from projects.genivi.org . You can install the headers on you system by
+The nodestatemanager can be retrieved from projects.genivi.org .
-----
-sudo make install-includeHEADERS
-----
+Please note that the NSM interface must be compatible with Dbus properties. This requires for CommonAPI to use the commonAPI fdepl.
+It used to work, but currently with CommmonAPI 2.6.1 the generation does not work anymore.
+
+=== CommonAPI File generation
+
+The audiomanager will search in /usr/share or /usr/local/share for a generator. He will generate all neccessary files with this generator into the build tree.
+
+The adresses used for commonAPI are fixed. If you need to change them, you can use a central or local configure file. More information on CommonAPI documentation: http://projects.genivi.org/commonapi/
+
+=== Tests
For building the tests, you will need the following packages:
@@ -167,50 +175,53 @@ cmake ..
make
----
-After the script finished, you should have:
-
-* a bin/ folder which contains all executables and the libraries:
-* a build/ folder which has all build objects (erase that if you need a clean build)
-* a doc/ folder in case you turned the documentation on
+The AudioManager executable will be placed in the bin folder of your build folder, tests in a subfolder below.-
In order to install the AudioManager, you can do
----
sudo make install
----
-Package generation is supported via CPack. To build packages, you have to
+this installs everything.
+
+== Build targets
+
+Several install targets exists:
+
+just install the audiomanager
----
-make genivi_package
+sudo make bin-install
----
-This will create one package if your CMake version is < 2.8.5 (all binaries stripped):
+just install the dev package with all headers and cmake file, needed to compile plugins out of source
----
-AudioManager-<git verison>-Linux.deb
+sudo make dev-install
----
-If your version is above 2.8.5, you will get 4 packages (all binaries stripped) :
-
-* AudioManager-<git verison>-Linux-bin.deb [AudioManager binary]
-* AudioManager-<git verison>-Linux-dev.deb [header files needed to compile plugins]
-* AudioManager-<git verison>-Linux-sampleplugins.deb [sample plugins]
-* AudioManager-<git verison>-Linux-tests.deb [tests including tests for sample plugins, installed in the ~/AudioMAnagerTests]
+just install the tests
+----
+sudo make test-install
+----
-In order to create a tar.gz file of all sources (not including .git, build and bin folder,config files), you can do:
+just install the plugins (only available if plugins are compiled)
----
-make package_source
+sudo make plugins-install
----
-This will create the following package:
-'AudioManager-<git verison>-Source.tar.gz'
+just install the test for the plugins (only available if plugins are compiled)
+----
+sudo make plugin-test-install
+----
+
+If you want to compile the Audiomanager together with the plugins, simply clone the plugins into a folder
+Plugins on the mainlevel. The Plugins will be then compiled together with the AudioManager.
-All packages will be placed in a folder called packages
+If the plugins are compiled seperatly, the AudioManager needs to be installed on the system. The plugins will find and read the important CMake variables and use them.
=== Adding own plugins
-The AudioManager needs to be completed with on plugins. To keep the own sources away from the GENIVI code the project specific elements can be reconfigured with own type definitions.
+To keep the own sources away from the GENIVI code the project specific elements can be reconfigured with own type definitions.
+You can copy paste the CMake scripts from the example plugins for example.
-TIP: Using this feature is simple: +
-Create in your projects an own projecttypes.h. The name is no naming convention given. The file is your project specific type definition which will be only referenced by the HMI, Routing Adapters and the Controller Plug-in.
-
.The are already examples given in audiomanagertypes.h:
----
/**
@@ -339,7 +350,7 @@ If you compile your AudioManager with TelnetServer support (cmake -DWITH_TELNET=
set with commandline argument -t the port number and with -m the maximum supported connections.
The default telnet port is 6060.
-.For example, launch a telnet session on port 6060:
+.For example, launch a telnet session on port 6080:
telnet localhost 6060
#>Welcome to GENIVI AudioManager ver-0.0.1-37-ga004215
@@ -403,7 +414,7 @@ The default telnet port is 6060.
== Code Formatting
-The source code if formatted with eclipse, the style sheet used can be found in the cmake folder:
+The source code if formatted with eclipse, the style sheet used can be found in the Foo folder:
----
cmake/AudioManager_Codestyle.xml
----
diff --git a/README.html b/README.html
index 6fa0e72..b73bd2d 100644
--- a/README.html
+++ b/README.html
@@ -751,16 +751,23 @@ Contribution License Agreements or MPL 2.0 .</p></div>
This Source Code Form is subject to the terms of the
Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
this file, You can obtain one at <a href="http://mozilla.org/MPL/2.0/">http://mozilla.org/MPL/2.0/</a>.</p></div>
-<div class="paragraph"><p>author Christian Mueller, <a href="mailto:christian.linke@bmw.de">christian.linke@bmw.de</a> BMW 2011,2012</p></div>
+<div class="paragraph"><p>author Christian Linke = Christian Linke <a href="mailto:christian.linke@bmw.de">christian.linke@bmw.de</a> BMW 2011-2015</p></div>
<div class="paragraph"><p>For further information see <a href="http://projects.genivi.org/audio-manager/">http://projects.genivi.org/audio-manager/</a>.</p></div>
</div>
</div>
<div class="sect1">
+<h2 id="_repositories">Repositories</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>The main repository is <a href="http://git.projects.genivi.org-AudioManager.git">http://git.projects.genivi.org-AudioManager.git</a></p></div>
+<div class="paragraph"><p>The repository for example plugins can be found here: <a href="http://git.projects.genivi.org/AudioManagerPlugins.git">http://git.projects.genivi.org/AudioManagerPlugins.git</a></p></div>
+</div>
+</div>
+<div class="sect1">
<h2 id="_license">License</h2>
<div class="sectionbody">
-<div class="paragraph"><p>The licenses of this project are split into two parts:
-1) the AudioManagerDaemon, licensed under MPL 2.0
-2) all other parts that serve as example code that can be taken to build up an own project with it -
+<div class="paragraph"><p>The licenses of this project are split into two parts:</p></div>
+<div class="paragraph"><p>1) the AudioManagerDaemon, licensed under MPL 2.0</p></div>
+<div class="paragraph"><p>2) the plugins that serve as example code that can be taken to build up an own project with it -
these parts are licensed with the MIT license</p></div>
<div class="paragraph"><p>Contribution is done under GENIVI CLA or MPL2.0.</p></div>
</div>
@@ -780,6 +787,7 @@ The next commit on the master branch gets then the new first numner (3) and star
<div class="paragraph"><p>For the daemon the third number (for example 1.0.X) describes the patch version. The versions are automatically created by git during the build process.
The versioning scheme is used for the AudioManager daemon itself and for each of it&#8217;s interfaces. The versioning of the Interfaces in EA is defined via the tag "version" and the name of the interfaceversion versionName, for example "CommandReceiveVersion". This information is generated into the interface header files and is used then by cmake to set the interface versions.
Whenever changes are done, the minor version of the interface needs to be incremented.</p></div>
+<div class="paragraph"><p>Since 7.0, the AudioManager follows a new versioning scheme. Please check the documentation for that.</p></div>
</div>
</div>
</div>
@@ -790,7 +798,9 @@ Whenever changes are done, the minor version of the interface needs to be increm
<div class="listingblock">
<div class="content">
<pre><tt>cmake -DWITH_DOCUMENTATION=ON
-make</tt></pre>
+make
+
+The README is compiled into README.html with asciidoc</tt></pre>
</div></div>
</div>
</div>
@@ -802,31 +812,38 @@ make</tt></pre>
<div class="paragraph"><p>These are the compile options with default values:</p></div>
<div class="literalblock">
<div class="content">
-<pre><tt>BUILD_SHARED_LIBS OFF
+<pre><tt>AM_MAP_CAPACITY 10
+AM_MAX_CONNECTIONS 0x1000
+AM_SHARE_FOLDER /usr/local/share/audiomanager
+BUILD_SHARED_LIBS OFF
CMAKE_BUILD_TYPE
CMAKE_INSTALL_PREFIX /usr/local
COMMON_API_DBUS_LIBRARY /usr/local/lib/libCommonAPI-DBus.so
COMMON_API_LIBRARY /usr/local/lib/libCommonAPI.so
+DBUS_SERVICE_OBJECT_PATH /org/genivi/audiomanager
+DBUS_SERVICE_PREFIX org.genivi.audiomanager
+DEFAULT_TELNETPORT 6080
+DOC_OUTPUT_PATH XXX/build/doc
+DYNAMIC_ID_BOUNDARY 100
+EXECUTABLE_OUTPUT_PATH XXX/build/bin
GLIB_DBUS_TYPES_TOLERANT ON
+LIB_INSTALL_SUFFIX audiomanager
+MAX_TELNETCONNECTIONS 3
+NSM_BUS_INTERFACE org.genivi.NodeStateManager
+NSM_INTERFACE org.genivi.NodeStateManager.Consumer
+NSM_PATH /org/genivi/NodeStateManager
+PLUGINS_OUTPUT_PATH XXX/build/plugins
+TEST_EXECUTABLE_INSTALL_PATH ~/tests
+TEST_EXECUTABLE_OUTPUT_PATH XXX/build/bin/tests
USE_BUILD_LIBS ON
-WITH_COMMAND_INTERFACE_COMMON_ ON
WITH_DATABASE_STORAGE OFF
WITH_DLT ON
-WITH_DOCUMENTATION ON
+WITH_DOCUMENTATION OFF
WITH_ENABLED_IPC CAPI
-WITH_LOGSTATE ON
-WITH_NSM ON
-WITH_OXF_ANIMATION OFF
-WITH_OXF_TRACE OFF
-WITH_PLUGIN_COMMAND ON
-WITH_PLUGIN_CONTROL ON
-WITH_PLUGIN_ROUTING ON
-WITH_ROUTING_INTERFACE_ASYNC OFF
-WITH_ROUTING_INTERFACE_CAPI ON
+WITH_NSM OFF
WITH_SYSTEMD_WATCHDOG OFF
WITH_TELNET ON
WITH_TESTS ON
-WITH_TEST_CONTROLLER OFF
gmock_build_tests OFF
gtest_build_samples OFF
gtest_build_tests OFF
@@ -836,15 +853,8 @@ gtest_force_shared_crt OFF</tt></pre>
</div>
<div class="sect2">
<h3 id="_passing_options_to_cmake">Passing options to cmake:</h3>
-<div class="paragraph"><div class="title">-DVERSION="XXX"</div><p>When building the AudioManager without taking it from the git (and thus having a .git folder), you can set the version via passing <em>-DVERSION="XXX"</em> to cmake.</p></div>
-<div class="paragraph"><div class="title">-DDBUS_SERVICE_PREFIX="XXX"</div><p>sets the service prefix for Dbus, default "org.genivi.audiomanager\0"</p></div>
-<div class="paragraph"><div class="title">-DDBUS_SERVICE_OBJECT_PATH="XXX"</div><p>sets the object path for Dbus, default "/org/genivi/audiomanager\0"</p></div>
-<div class="paragraph"><div class="title">-DDEFAULT_TELNETPORT="XXX"</div><p>sets the default telnetport, default 6060. Can be overwriten by command line parameter</p></div>
-<div class="paragraph"><div class="title">-DMAX_TELNETCONNECTIONS="XXX"</div><p>sets the default maximum number of telnetconnections, default is 3</p></div>
-<div class="paragraph"><div class="title">-DNSM_PATH="XXX"</div><p>sets the path of the NSM DBUS interface</p></div>
-<div class="paragraph"><div class="title">-DNSM_INTERFACE="XXX"</div><p>sets the interface to the NSM DBUS interface</p></div>
-<div class="paragraph"><p>In order to change these options, you can modify this values with ccmake, do the appropriate changes in
-CmakeList.txt or via the commandline for cmake or (when installed via ccmake)</p></div>
+<div class="paragraph"><p>Standard CMake can be used to configure these options. Tools like ccmake can be used to visually change the values.
+For each option, some hints are given.</p></div>
</div>
<div class="sect2">
<h3 id="_build_dependencies">Build dependencies</h3>
@@ -885,14 +895,24 @@ commonAPI [version &gt; 2.1] (only with WITH_ENABLED_IPC CAPI), more information
</div></div>
</div>
<div class="sect2">
+<h3 id="_audiomanagerutilities">AudioManagerUtilities</h3>
+<div class="paragraph"><p>In the AudioManagerUtilites you can find hany helper functions that can be reused by other projects as well.</p></div>
+</div>
+<div class="sect2">
<h3 id="_the_nodestatemanager">The NodeStateManager</h3>
<div class="paragraph"><p>The nodestatemanager headers are needed to compile the audiomanager. If the nodestatemanagerincludes are not found,
the headers shipped with the audiomanager are used.
-The nodestatemanager can be retrieved from projects.genivi.org . You can install the headers on you system by</p></div>
-<div class="listingblock">
-<div class="content">
-<pre><tt>sudo make install-includeHEADERS</tt></pre>
-</div></div>
+The nodestatemanager can be retrieved from projects.genivi.org .</p></div>
+<div class="paragraph"><p>Please note that the NSM interface must be compatible with Dbus properties. This requires for CommonAPI to use the commonAPI fdepl.
+It used to work, but currently with CommmonAPI 2.6.1 the generation does not work anymore.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_commonapi_file_generation">CommonAPI File generation</h3>
+<div class="paragraph"><p>The audiomanager will search in /usr/share or /usr/local/share for a generator. He will generate all neccessary files with this generator into the build tree.</p></div>
+<div class="paragraph"><p>The adresses used for commonAPI are fixed. If you need to change them, you can use a central or local configure file. More information on CommonAPI documentation: <a href="http://projects.genivi.org/commonapi/">http://projects.genivi.org/commonapi/</a></p></div>
+</div>
+<div class="sect2">
+<h3 id="_tests">Tests</h3>
<div class="paragraph"><p>For building the tests, you will need the following packages:</p></div>
<div class="ulist"><ul>
<li>
@@ -924,101 +944,150 @@ cd build
cmake ..
make</tt></pre>
</div></div>
-<div class="paragraph"><p>After the script finished, you should have:</p></div>
-<div class="ulist"><ul>
-<li>
-<p>
-a bin/ folder which contains all executables and the libraries:
-</p>
-</li>
-<li>
-<p>
-a build/ folder which has all build objects (erase that if you need a clean build)
-</p>
-</li>
-<li>
-<p>
-a doc/ folder in case you turned the documentation on
-</p>
-</li>
-</ul></div>
+<div class="paragraph"><p>The AudioManager executable will be placed in the bin folder of your build folder, tests in a subfolder below.-</p></div>
<div class="paragraph"><p>In order to install the AudioManager, you can do</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>sudo make install</tt></pre>
</div></div>
-<div class="paragraph"><p>Package generation is supported via CPack. To build packages, you have to</p></div>
+<div class="paragraph"><p>this installs everything.</p></div>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_build_targets">Build targets</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>Several install targets exists:</p></div>
+<div class="paragraph"><p>just install the audiomanager</p></div>
<div class="listingblock">
<div class="content">
-<pre><tt>make genivi_package</tt></pre>
+<pre><tt>sudo make bin-install</tt></pre>
</div></div>
-<div class="paragraph"><p>This will create one package if your CMake version is &lt; 2.8.5 (all binaries stripped):</p></div>
+<div class="paragraph"><p>just install the dev package with all headers and cmake file, needed to compile plugins out of source</p></div>
<div class="listingblock">
<div class="content">
-<pre><tt>AudioManager-&lt;git verison&gt;-Linux.deb</tt></pre>
+<pre><tt>sudo make dev-install</tt></pre>
</div></div>
-<div class="paragraph"><p>If your version is above 2.8.5, you will get 4 packages (all binaries stripped) :</p></div>
-<div class="ulist"><ul>
-<li>
-<p>
-AudioManager-&lt;git verison&gt;-Linux-bin.deb [AudioManager binary]
-</p>
-</li>
-<li>
-<p>
-AudioManager-&lt;git verison&gt;-Linux-dev.deb [header files needed to compile plugins]
-</p>
-</li>
-<li>
-<p>
-AudioManager-&lt;git verison&gt;-Linux-sampleplugins.deb [sample plugins]
-</p>
-</li>
-<li>
-<p>
-AudioManager-&lt;git verison&gt;-Linux-tests.deb [tests including tests for sample plugins, installed in the ~/AudioMAnagerTests]
-</p>
-</li>
-</ul></div>
-<div class="paragraph"><p>In order to create a tar.gz file of all sources (not including .git, build and bin folder,config files), you can do:</p></div>
+<div class="paragraph"><p>just install the tests</p></div>
<div class="listingblock">
<div class="content">
-<pre><tt>make package_source</tt></pre>
+<pre><tt>sudo make test-install</tt></pre>
</div></div>
-<div class="paragraph"><p>This will create the following package:
-<em>AudioManager-&lt;git verison&gt;-Source.tar.gz</em></p></div>
-<div class="paragraph"><p>All packages will be placed in a folder called packages</p></div>
-</div>
+<div class="paragraph"><p>just install the plugins (only available if plugins are compiled)</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt>sudo make plugins-install</tt></pre>
+</div></div>
+<div class="paragraph"><p>just install the test for the plugins (only available if plugins are compiled)</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt>sudo make plugin-test-install</tt></pre>
+</div></div>
+<div class="paragraph"><p>If you want to compile the Audiomanager together with the plugins, simply clone the plugins into a folder
+Plugins on the mainlevel. The Plugins will be then compiled together with the AudioManager.</p></div>
+<div class="paragraph"><p>If the plugins are compiled seperatly, the AudioManager needs to be installed on the system. The plugins will find and read the important CMake variables and use them.</p></div>
<div class="sect2">
<h3 id="_adding_own_plugins">Adding own plugins</h3>
-<div class="paragraph"><p>Since the AudioManager needs to be completed with on plugins before it can be used, it provides a mechanism to keep the own sources away from the GENIVI code but compile them together.</p></div>
-<div class="admonitionblock">
-<table><tr>
-<td class="icon">
-<div class="title">Tip</div>
-</td>
-<td class="content">Using this feature is simple:<br />
-Just add a folder with the name <em>ProjectSpecific</em> (be sure to name it excactly like this!) on the main level of the AudioManager folder. CMake will look for CMakeLists.txt in this folder and add all files that it finds in /include to the include path. You can use this to add subfolders with your own plugins and includes, and overwrite productspecific.h for example.</td>
-</tr></table>
-</div>
+<div class="paragraph"><p>To keep the own sources away from the GENIVI code the project specific elements can be reconfigured with own type definitions.
+You can copy paste the CMake scripts from the example plugins for example.</p></div>
<div class="listingblock">
-<div class="title">Here is a sample CMakeLists.txt that can be placed in ProjectSpecific folder:</div>
+<div class="title">The are already examples given in audiomanagertypes.h:</div>
<div class="content">
-<pre><tt>cmake_minimum_required(VERSION 2.6)
-
-### set your own buildflags:
-set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -Wextra -std=c++98 -D_GNU_SOURCE -pedantic -Wno-variadic-macros")
-
-##overwrite priojecttypes.h:
-CONFIGURE_FILE( ${CMAKE_SOURCE_DIR}/ProjectSpecific/overwrite/projecttypes.h ${CMAKE_SOURCE_DIR}/include/projecttypes.h COPYONLY)
-
-if(WITH_PLUGIN_ROUTING)
- add_subdirectory (../PluginRoutingInterfaceMyRoutingPlugin ${CMAKE_CURRENT_BINARY_DIR}/PluginRoutingInterfaceMyRoutingPlugin )
-endif(WITH_PLUGIN_ROUTING)
+<pre><tt>/**
+ * This type gives the information about reason for Source/Sink change
+ */
+typedef uint16_t am_CustomAvailabilityReason_t;
+static const am_CustomAvailabilityReason_t AR_UNKNOWN = 0;
+/** new media was entered */
+static const am_CustomAvailabilityReason_t AR_GENIVI_NEWMEDIA = 1;
+/** same media was entered */
+static const am_CustomAvailabilityReason_t AR_GENIVI_SAMEMEDIA = 2;
+/** there is no media or media is removed */
+static const am_CustomAvailabilityReason_t AR_GENIVI_NOMEDIA = 3;
+/** there was a temperature event */
+static const am_CustomAvailabilityReason_t AR_GENIVI_TEMPERATURE = 4;
+/** there was a voltage event */
+static const am_CustomAvailabilityReason_t AR_GENIVI_VOLTAGE = 5;
+/** fatal errors on reading or accessing media */
+static const am_CustomAvailabilityReason_t AR_GENIVI_ERRORMEDIA = 6;
+
+/**
+ * This is a custom specific identifier of property. It can be used to
+ * differentiate between interrupt source/sink, main source/sink, etc.
+ */
+typedef uint16_t am_CustomClassProperty_t;
+static const am_CustomClassProperty_t CP_UNKNOWN = 0;
+static const am_CustomClassProperty_t CP_GENIVI_SOURCE_TYPE = 1;
+static const am_CustomClassProperty_t CP_GENIVI_SINK_TYPE = 2;
+
+/**
+ * This type classifies the format in which data is exchanged within a connection.
+ * The type itself is project specific although there are some standard formats
+ * defined.
+ */
+typedef uint16_t am_CustomConnectionFormat_t;
+static const am_CustomConnectionFormat_t CF_UNKNOWN = 0;
+/** plain mono */
+static const am_CustomConnectionFormat_t CF_GENIVI_MONO = 1;
+/** stereo connection */
+static const am_CustomConnectionFormat_t CF_GENIVI_STEREO = 2;
+/** analog connection */
+static const am_CustomConnectionFormat_t CF_GENIVI_ANALOG = 3;
+/** automatic connection. */
+static const am_CustomConnectionFormat_t CF_GENIVI_AUTO = 4;
+
+/**
+ * Here are all SoundProperties that can be set via the CommandInterface.
+ * This type is product specific and can be changed or extended.
+ */
+typedef uint16_t am_CustomMainSoundPropertyType_t;
+static const am_CustomMainSoundPropertyType_t MSP_UNKNOWN = 0;
+/** example value between -10 and +10 */
+static const am_CustomMainSoundPropertyType_t MSP_GENIVI_TREBLE = 1;
+/** example value between -10 and +10 */
+static const am_CustomMainSoundPropertyType_t MSP_GENIVI_MID = 2;
+/** example value between -10 and +10 */
+static const am_CustomMainSoundPropertyType_t MSP_GENIVI_BASS = 3;
+
+/**
+ * The notification types are project specific.
+ */
+typedef uint16_t am_CustomNotificationType_t;
+static const am_CustomNotificationType_t NT_UNKNOWN = 0;
-if(WITH_PLUGIN_CONTROL)
- add_subdirectory ( ../PluginControlInterfaceMyControlPlugin ${CMAKE_CURRENT_BINARY_DIR}/PluginControlInterfaceMyControlPlugin)
-endif(WITH_PLUGIN_CONTROL)</tt></pre>
+/**
+ * The given ramp types here are just examples. For products, different ramp types
+ * can be defined here. It is in the responsibility of the product to make sure
+ * that the routing plugins are aware of the ramp types used.
+ */
+typedef uint16_t am_CustomRampType_t;
+static const am_CustomRampType_t RAMP_UNKNOWN = 0;
+/** sets directly the value without a ramp */
+static const am_CustomRampType_t RAMP_GENIVI_DIRECT = 1;
+/** Sets the volume as fast as possible */
+static const am_CustomRampType_t RAMP_GENIVI_NO_PLOP = 2;
+static const am_CustomRampType_t RAMP_GENIVI_EXP_INV = 3;
+static const am_CustomRampType_t RAMP_GENIVI_LINEAR = 4;
+static const am_CustomRampType_t RAMP_GENIVI_EXP = 5;
+
+/**
+ * Within genivi only the some example properties are defined.
+ * For products these should be changed or extended.
+ */
+typedef uint16_t am_CustomSoundPropertyType_t;
+static const am_CustomSoundPropertyType_t SP_UNKNOWN = 0;
+/** example treble value min =-10 max =10 */
+static const am_CustomSoundPropertyType_t SP_GENIVI_TREBLE = 1;
+/** example mid value min =-10 max =10 */
+static const am_CustomSoundPropertyType_t SP_GENIVI_MID = 2;
+/** example bass value min =-10 max =10 */
+static const am_CustomSoundPropertyType_t SP_GENIVI_BASS = 3;
+
+/**
+ * Describes the different system properties which are project specific.
+ */
+typedef uint16_t am_CustomSystemPropertyType_t;
+static const am_CustomSystemPropertyType_t SYP_UNKNOWN = 0;</tt></pre>
</div></div>
</div>
<div class="sect2">
@@ -1054,7 +1123,7 @@ If you compile your AudioManager with TelnetServer support (cmake -DWITH_TELNET=
set with commandline argument -t the port number and with -m the maximum supported connections.
The default telnet port is 6060.</p></div>
<div class="literalblock">
-<div class="title">For example, launch a telnet session on port 6060:</div>
+<div class="title">For example, launch a telnet session on port 6080:</div>
<div class="content">
<pre><tt>telnet localhost 6060</tt></pre>
</div></div>
@@ -1126,7 +1195,7 @@ The default telnet port is 6060.</p></div>
<div class="sect1">
<h2 id="_code_formatting">Code Formatting</h2>
<div class="sectionbody">
-<div class="paragraph"><p>The source code if formatted with eclipse, the style sheet used can be found in the cmake folder:</p></div>
+<div class="paragraph"><p>The source code if formatted with eclipse, the style sheet used can be found in the Foo folder:</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>cmake/AudioManager_Codestyle.xml</tt></pre>
@@ -1220,7 +1289,7 @@ handle later on.</p></div>
<div id="footnotes"><hr /></div>
<div id="footer">
<div id="footer-text">
-Last updated 2013-09-12 10:26:35 CEST
+Last updated 2015-03-11 15:31:03 CET
</div>
</div>
</body>
diff --git a/cmake/CommonAPIGenerator.cmake b/cmake/CommonAPIGenerator.cmake
index e828f09..332f9e6 100755
--- a/cmake/CommonAPIGenerator.cmake
+++ b/cmake/CommonAPIGenerator.cmake
@@ -119,7 +119,7 @@ IF(COMMON_API_FOUND AND COMMON_API_DBUS_FOUND)
# execute the generate command ...
execute_process(COMMAND ${COMMONAPI_GENERATOR_EXE}/commonapi_generator -dest ${PARAMS_DESTINATION} ${ARGS} ${FIDLS}
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
RESULT_VARIABLE EXIT_CODE
OUTPUT_VARIABLE GENERATOR_OUTPUT
ERROR_VARIABLE GENERATOR_OUTPUT
diff --git a/cmake/FindNSM.cmake b/cmake/FindNSM.cmake
index df7b11e..1b34c45 100644
--- a/cmake/FindNSM.cmake
+++ b/cmake/FindNSM.cmake
@@ -16,17 +16,19 @@
#
FIND_PATH (NSM_INCLUDE_DIR NodeStateManager.h
- DOC "The nodestatemanager include directory"
-)
+ PATHS
+ ${CMAKE_INSTALL_PATH}
+ "/usr/include"
+ "/usr/local/include"
+ DOC "The nodestatemanager include directory")
-IF(NSM_INCLUDE_DIR)
+if(NSM_INCLUDE_DIR)
+ set (NSM_FOUND "YES")
message(STATUS "Found NSM include: ${NSM_INCLUDE_DIR}")
-ELSE(NSM_INCLUDE_DIR)
- SET(NSM_FOUND "YES")
- SET (NSM_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/nodeStateManagerIncludes")
+else(NSM_INCLUDE_DIR)
+ set (NSM_FOUND "YES")
+ set (NSM_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/nodeStateManagerIncludes")
message(STATUS "Did not find NSM include, using own include dir: ${NSM_INCLUDE_DIR}")
-ENDIF(NSM_INCLUDE_DIR)
+endif(NSM_INCLUDE_DIR)
-MARK_AS_ADVANCED(
- NSM_INCLUDE_DIR
-) \ No newline at end of file
+ mark_as_advanced(NSM_INCLUDE_DIR) \ No newline at end of file
diff --git a/cmake/MacroInterfaceVersions.cmake b/cmake/MacroInterfaceVersions.cmake
new file mode 100644
index 0000000..eb64c75
--- /dev/null
+++ b/cmake/MacroInterfaceVersions.cmake
@@ -0,0 +1,24 @@
+
+ macro(GET_COMMAND_INTERFACE_VERSION INCLUDE_FOLDER)
+
+ FILE(READ "${INCLUDE_FOLDER}/command/IAmCommandSend.h" VERSION_BUFFER LIMIT 6000)
+ STRING(REGEX MATCH "CommandSendVersion*.[^0-9]*[0-9].[0-9]*[0-9]" LIB_COMMAND_INTERFACE_VERSION ${VERSION_BUFFER})
+ STRING(REGEX REPLACE "CommandSendVersion*.." "" LIB_COMMAND_INTERFACE_VERSION ${LIB_COMMAND_INTERFACE_VERSION})
+
+ endmacro(GET_COMMAND_INTERFACE_VERSION INCLUDE_FOLDER)
+
+ macro(GET_ROUTING_INTERFACE_VERSION INCLUDE_FOLDER)
+
+ FILE(READ "${INCLUDE_FOLDER}/routing/IAmRoutingSend.h" VERSION_BUFFER LIMIT 6000)
+ STRING(REGEX MATCH "RoutingSendVersion*.[^0-9]*[0-9].[0-9]*[0-9]" LIB_ROUTING_INTERFACE_VERSION ${VERSION_BUFFER})
+ STRING(REGEX REPLACE "RoutingSendVersion*.." "" LIB_ROUTING_INTERFACE_VERSION ${LIB_ROUTING_INTERFACE_VERSION})
+
+ endmacro(GET_ROUTING_INTERFACE_VERSION INCLUDE_FOLDER)
+
+ macro(GET_CONTROL_INTERFACE_VERSION INCLUDE_FOLDER)
+
+ FILE(READ "${INCLUDE_FOLDER}/control/IAmControlSend.h" VERSION_BUFFER LIMIT 6000)
+ STRING(REGEX MATCH "ControlSendVersion*.[^0-9]*[0-9].[0-9]*[0-9]" LIB_CONTROL_INTERFACE_VERSION ${VERSION_BUFFER})
+ STRING(REGEX REPLACE "ControlSendVersion*.." "" LIB_CONTROL_INTERFACE_VERSION ${LIB_CONTROL_INTERFACE_VERSION})
+
+ endmacro(GET_CONTROL_INTERFACE_VERSION INCLUDE_FOLDER) \ No newline at end of file
diff --git a/cmake/MacroVersionFromGit.cmake b/cmake/MacroVersionFromGit.cmake
new file mode 100644
index 0000000..1687443
--- /dev/null
+++ b/cmake/MacroVersionFromGit.cmake
@@ -0,0 +1,23 @@
+# get the current git version
+execute_process(COMMAND git describe --tags WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ OUTPUT_VARIABLE DAEMONVERSION
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+if (NOT DAEMONVERSION)
+ #Can be changed via passing -DVERSION="XXX" to cmake
+ if(NOT DEFINED VERSION)
+ set( DAEMONVERSION "homebrew-${CMAKE_SOURCE_DIR}" )
+ else (NOT DEFINED VERSION)
+ set( DAEMONVERSION "${VERSION}" )
+ endif(NOT DEFINED VERSION)
+else (NOT DAEMONVERSION)
+ STRING(REGEX REPLACE "(-)[^-]+$" "" DAEMONVERSION ${DAEMONVERSION})
+ STRING(REGEX REPLACE "-" "." DAEMONVERSION ${DAEMONVERSION})
+endif(NOT DAEMONVERSION)
+
+message(STATUS "Build Version ${DAEMONVERSION}")
+
+
+execute_process(COMMAND git log --pretty=short WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ OUTPUT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/CHANGELOG)
+
diff --git a/cmake/add_package_dependencies.sh b/cmake/add_package_dependencies.sh
deleted file mode 100755
index 773528c..0000000
--- a/cmake/add_package_dependencies.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-# Copyright (C) 2012, BMW AG
-#
-# This file is part of GENIVI Project AudioManager.
-#
-# Contributions are licensed to the GENIVI Alliance under one or more
-# Contribution License Agreements.
-#
-# copyright
-# This Source Code Form is subject to the terms of the
-# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
-# this file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
-#
-# For further information see http://www.genivi.org/.
-#
-
-PACKAGE_NAME=$1
-PACKAGE_NAME_PATH=$2/$PACKAGE_NAME
-TMPDIR=`mktemp -d /tmp/gen.XXXXXXXXXX` || exit 1
-dpkg-deb -x "$PACKAGE_NAME_PATH" "$TMPDIR"
-dpkg-deb --control "$PACKAGE_NAME_PATH" "$TMPDIR"/DEBIAN
-cat "$TMPDIR"/DEBIAN/control | sed -e "s/Depends.*$/Depends: $3/" > "$TMPDIR"/DEBIAN/control_
-cp "$TMPDIR"/DEBIAN/control_ "$TMPDIR"/DEBIAN/control
-dpkg -b "$TMPDIR" "$PACKAGE_NAME_PATH"
-rm -r "$TMPDIR"
-
diff --git a/cmake/audiomanagerConfig.cmake.in b/cmake/audiomanagerConfig.cmake.in
new file mode 100644
index 0000000..d27ec98
--- /dev/null
+++ b/cmake/audiomanagerConfig.cmake.in
@@ -0,0 +1,44 @@
+set(AudioManagerVersion @DAEMONVERSION@ )
+
+@PACKAGE_INIT@
+
+
+set_and_check(CMAKE_MODULE_PATH "@CMAKE_MODULE_PATH@")
+set(NSM_INCLUDE_DIR "@NSM_INCLUDE_DIR@")
+set(TEST_EXECUTABLE_OUTPUT_PATH "@TEST_EXECUTABLE_OUTPUT_PATH@")
+set(TEST_EXECUTABLE_INSTALL_PATH "@TEST_EXECUTABLE_INSTALL_PATH@")
+set(AM_SHARE_FOLDER "@AM_SHARE_FOLDER@")
+set(WITH_TESTS "@WITH_TESTS@")
+set(AUDIOMANAGER_DAEMON_FOLDER "@AUDIOMANAGER_DAEMON_FOLDER@")
+set(WITH_DOCUMENTATION "@WITH_DOCUMENTATION@")
+set(WITH_DLT "@WITH_DLT@")
+set(WITH_ENABLED_IPC "@WITH_ENABLED_IPC@")
+set(DBUS_SERVICE_PREFIX "@DBUS_SERVICE_PREFIX@")
+set(DBUS_SERVICE_OBJECT_PATH "@DBUS_SERVICE_OBJECT_PATH@")
+set(DYNAMIC_ID_BOUNDARY "@DYNAMIC_ID_BOUNDARY@")
+set(DEFAULT_PLUGIN_COMMAND_DIR "@DEFAULT_PLUGIN_COMMAND_DIR@")
+set(DEFAULT_PLUGIN_ROUTING_DIR "@DEFAULT_PLUGIN_ROUTING_DIR@")
+set(CONTROLLER_PLUGIN "@CONTROLLER_PLUGIN@")
+set(LIB_INSTALL_SUFFIX "@LIB_INSTALL_SUFFIX@")
+set(COMMONAPI_DBUS_CONFIGURATIONS "@COMMONAPI_DBUS_CONFIGURATIONS")
+set(LIB_CONTROL_INTERFACE_VERSION "@LIB_CONTROL_INTERFACE_VERSION")
+set(LIB_ROUTING_INTERFACE_VERSION "@LIB_ROUTING_INTERFACE_VERSION")
+set(LIB_COMMAND_INTERFACE_VERSION "@LIB_COMMAND_INTERFACE_VERSION")
+set(CMAKE_CXX_FLAGS "@CMAKE_CXX_FLAGS@")
+set(CMAKE_CXX_FLAGS_DEBUG "@CMAKE_CXX_FLAGS_DEBUG@")
+set(CMAKE_CXX_FLAGS_RELEASE "@CMAKE_CXX_FLAGS_RELEASE@")
+set(AUDIOMANAGER_UTILITIES_SRC "@AUDIOMANAGER_UTILITIES_SRC@")
+set(WITH_COMMON_API_GEN "@WITH_COMMON_API_GEN@")
+set(WRITE_COMMONAPI_DBUS_CONFIG_FILE "@WRITE_COMMONAPI_DBUS_CONFIG_FILE@")
+
+
+IF(WITH_TESTS)
+ set_and_check(GOOGLE_MOCK_PROJECT_FOLDER "@GOOGLE_MOCK_PROJECT_FOLDER@")
+ set_and_check(GMOCK_INCLUDE_DIR "@GMOCK_INCLUDE_DIR@")
+ set_and_check(GOOGLE_TEST_INCLUDE_DIR "@GOOGLE_TEST_INCLUDE_DIR@")
+ENDIF(WITH_TESTS)
+
+check_required_components(AudioManagerDaemon)
+
+
+
diff --git a/cmake/cmake_uninstall.cmake.in b/cmake/cmake_uninstall.cmake.in
deleted file mode 100755
index 648ad51..0000000
--- a/cmake/cmake_uninstall.cmake.in
+++ /dev/null
@@ -1,43 +0,0 @@
-# Copyright (C) 2012, GENIVI Alliance, Inc.
-# Copyright (C) 2012, BMW AG
-#
-# This file is part of GENIVI Project AudioManager.
-#
-# Contributions are licensed to the GENIVI Alliance under one or more
-# Contribution License Agreements.
-#
-# copyright
-# This Source Code Form is subject to the terms of the
-# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
-# this file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
-#
-# For further information see http://www.genivi.org/.
-#
-
-IF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
- MESSAGE(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
-ENDIF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
-
-FILE(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
-STRING(REGEX REPLACE "\n" ";" files "${files}")
-FOREACH(file ${files})
- MESSAGE(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
- IF(EXISTS "$ENV{DESTDIR}${file}")
- EXEC_PROGRAM(
- "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
- OUTPUT_VARIABLE rm_out
- RETURN_VALUE rm_retval
- )
- IF(NOT "${rm_retval}" STREQUAL 0)
- MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
- ENDIF(NOT "${rm_retval}" STREQUAL 0)
- ELSE(EXISTS "$ENV{DESTDIR}${file}")
- MESSAGE(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
- ENDIF(EXISTS "$ENV{DESTDIR}${file}")
-ENDFOREACH(file)
-
-#remove the libraries in lib
-MESSAGE(STATUS "Removing libs")
-execute_process(COMMAND rm -R "@CMAKE_INSTALL_PREFIX@/lib/@LIB_INSTALL_SUFFIX@")
diff --git a/cmake/config.cmake b/cmake/config.cmake.in
index fcfdc7f..fcfdc7f 100644
--- a/cmake/config.cmake
+++ b/cmake/config.cmake.in