summaryrefslogtreecommitdiff
path: root/AudioManagerDaemon
diff options
context:
space:
mode:
authorAleksandar Donchev <aleksander.donchev@partner.bmw.de>2013-09-02 11:57:28 +0200
committerChristian Linke <Christian.Linke@bmw.de>2013-09-03 17:26:04 +0200
commita2edae5cee4254b933f42399edc0e092abd4f5cf (patch)
treeead58f525b947deed4b8c76ab9c89c80b5056227 /AudioManagerDaemon
parent7aee1baeea1777318932cc49a8eac18f194233cd (diff)
downloadaudiomanager-a2edae5cee4254b933f42399edc0e092abd4f5cf.tar.gz
*PluginCommandInterfaceCAPI, PluginRoutingInterfaceCAPI, NodeStateCommunicatorCAPI with unit tests first version.
Choosing between DBUS and Common-API via cmake. CommonAPI - legacy support for DBus properties (Set 1) Signed-off-by: Christian Linke <christian.linke@bmw.de> (cherry picked from commit ea96ef59e29466667c90b506426e2a5a9cdb82d2)
Diffstat (limited to 'AudioManagerDaemon')
-rw-r--r--AudioManagerDaemon/CMakeLists.txt84
-rw-r--r--AudioManagerDaemon/fidls/NodeStateAccessStub_model_org.genivi.NodeStateManager.Consumer.fdepl6
-rwxr-xr-xAudioManagerDaemon/fidls/NodeStateAccessStub_model_org.genivi.NodeStateManager.Consumer.fidl127
-rwxr-xr-xAudioManagerDaemon/fidls/NodeStateAccessStub_model_org.genivi.NodeStateManager.LifecycleConsumer.fidl16
-rwxr-xr-xAudioManagerDaemon/fidls/NodeStateManager_dbus.conf33
-rwxr-xr-xAudioManagerDaemon/fidls/amTypes.fidl330
-rw-r--r--AudioManagerDaemon/include/CAmNodeStateCommunicator.h66
-rw-r--r--AudioManagerDaemon/include/CAmNodeStateCommunicatorCAPI.h101
-rw-r--r--AudioManagerDaemon/include/CAmNodeStateCommunicatorDBus.h63
-rw-r--r--AudioManagerDaemon/include/TAmPluginTemplate.h3
-rw-r--r--AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/Consumer.h70
-rw-r--r--AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerDBusProxy.cpp292
-rw-r--r--AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerDBusProxy.h114
-rw-r--r--AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerDBusStubAdapter.cpp374
-rw-r--r--AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerDBusStubAdapter.h68
-rw-r--r--AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerProxy.h619
-rw-r--r--AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerProxyBase.h114
-rw-r--r--AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerStub.h170
-rw-r--r--AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerStubDefault.cpp240
-rw-r--r--AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerStubDefault.h141
-rw-r--r--AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumer.h70
-rw-r--r--AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumerDBusProxy.cpp82
-rw-r--r--AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumerDBusProxy.h68
-rw-r--r--AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumerDBusStubAdapter.cpp82
-rw-r--r--AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumerDBusStubAdapter.h61
-rw-r--r--AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumerProxy.h166
-rw-r--r--AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumerProxyBase.h58
-rw-r--r--AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumerStub.h93
-rw-r--r--AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumerStubDefault.cpp51
-rw-r--r--AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumerStubDefault.h74
-rw-r--r--AudioManagerDaemon/src/CAmCommonAPIWrapper.cpp275
-rw-r--r--AudioManagerDaemon/src/CAmDatabaseHandlerMap.cpp2
-rw-r--r--AudioManagerDaemon/src/CAmDbusWrapper.cpp2
-rw-r--r--AudioManagerDaemon/src/CAmNodeStateCommunicatorCAPI.cpp361
-rw-r--r--AudioManagerDaemon/src/CAmNodeStateCommunicatorDBus.cpp (renamed from AudioManagerDaemon/src/CAmNodeStateCommunicator.cpp)163
-rw-r--r--AudioManagerDaemon/src/CAmRoutingReceiver.cpp4
-rwxr-xr-xAudioManagerDaemon/src/main.cpp45
-rw-r--r--AudioManagerDaemon/test/AmControlInterfaceTest/CMakeLists.txt2
-rw-r--r--AudioManagerDaemon/test/AmDatabaseHandlerTest/CMakeLists.txt2
-rw-r--r--AudioManagerDaemon/test/AmMapHandlerTest/CMakeLists.txt2
-rw-r--r--AudioManagerDaemon/test/AmNodeStateCommunicatorCAPITest/CAmNodeStateCommunicatorTest.cpp262
-rw-r--r--AudioManagerDaemon/test/AmNodeStateCommunicatorCAPITest/CAmNodeStateCommunicatorTest.h65
-rw-r--r--AudioManagerDaemon/test/AmNodeStateCommunicatorCAPITest/CMakeLists.txt119
-rw-r--r--AudioManagerDaemon/test/AmNodeStateCommunicatorCAPITest/nsm.py179
-rw-r--r--AudioManagerDaemon/test/AmNodeStateCommunicatorCAPITest/org.genivi.NodeStateManager.Consumer.xml (renamed from AudioManagerDaemon/test/AmNodeStateCommunicatorTest/org.genivi.NodeStateManager.Consumer.xml)0
-rw-r--r--AudioManagerDaemon/test/AmNodeStateCommunicatorCAPITest/send2nsm.py (renamed from AudioManagerDaemon/test/AmNodeStateCommunicatorTest/send2nsm.py)0
-rw-r--r--AudioManagerDaemon/test/AmNodeStateCommunicatorDBusTest/CAmNodeStateCommunicatorTest.cpp (renamed from AudioManagerDaemon/test/AmNodeStateCommunicatorTest/CAmNodeStateCommunicatorTest.cpp)7
-rw-r--r--AudioManagerDaemon/test/AmNodeStateCommunicatorDBusTest/CAmNodeStateCommunicatorTest.h (renamed from AudioManagerDaemon/test/AmNodeStateCommunicatorTest/CAmNodeStateCommunicatorTest.h)4
-rw-r--r--AudioManagerDaemon/test/AmNodeStateCommunicatorDBusTest/CMakeLists.txt (renamed from AudioManagerDaemon/test/AmNodeStateCommunicatorTest/CMakeLists.txt)12
-rw-r--r--AudioManagerDaemon/test/AmNodeStateCommunicatorDBusTest/nsm.py (renamed from AudioManagerDaemon/test/AmNodeStateCommunicatorTest/nsm.py)0
-rw-r--r--AudioManagerDaemon/test/AmNodeStateCommunicatorDBusTest/org.genivi.NodeStateManager.Consumer.xml259
-rw-r--r--AudioManagerDaemon/test/AmNodeStateCommunicatorDBusTest/send2nsm.py68
-rw-r--r--AudioManagerDaemon/test/AmRouterMapTest/CMakeLists.txt6
-rw-r--r--AudioManagerDaemon/test/AmRouterTest/CMakeLists.txt6
-rw-r--r--AudioManagerDaemon/test/AmRoutingInterfaceTest/CMakeLists.txt6
-rw-r--r--AudioManagerDaemon/test/AmTelnetServerTest/CMakeLists.txt6
-rw-r--r--AudioManagerDaemon/test/CAmCommonFunctions.cpp2
-rw-r--r--AudioManagerDaemon/test/CMakeLists.txt7
58 files changed, 5518 insertions, 184 deletions
diff --git a/AudioManagerDaemon/CMakeLists.txt b/AudioManagerDaemon/CMakeLists.txt
index 66931f7..c122841 100644
--- a/AudioManagerDaemon/CMakeLists.txt
+++ b/AudioManagerDaemon/CMakeLists.txt
@@ -44,6 +44,11 @@ ENDIF(WITH_DBUS_WRAPPER)
FIND_PACKAGE(NSM REQUIRED)
+IF(WITH_CAPI_WRAPPER)
+ FIND_PACKAGE(CommonAPI REQUIRED)
+ FIND_PACKAGE(CommonAPI_DBus REQUIRED)
+ENDIF(WITH_CAPI_WRAPPER)
+
SET(AUDIOMAN_SRCS_CXX
src/main.cpp
src/CAmCommandReceiver.cpp
@@ -56,6 +61,7 @@ SET(AUDIOMAN_SRCS_CXX
src/CAmRouter.cpp
src/CAmSocketHandler.cpp
src/CAmDltWrapper.cpp
+ src/CAmLog.cpp
)
# Preallocation variable for the map.
@@ -95,11 +101,25 @@ IF(WITH_DBUS_WRAPPER)
)
ENDIF(WITH_DBUS_WRAPPER)
-IF(WITH_NSM)
+IF(WITH_CAPI_WRAPPER)
SET (AUDIOMAN_SRCS_CXX
${AUDIOMAN_SRCS_CXX}
- src/CAmNodeStateCommunicator.cpp
+ src/CAmCommonAPIWrapper.cpp
)
+ENDIF(WITH_CAPI_WRAPPER)
+
+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
+ ${AUDIOMAN_SRCS_CXX}
+ src/CAmNodeStateCommunicatorCAPI.cpp
+ )
+ ENDIF(WITH_DBUS_WRAPPER)
ENDIF(WITH_NSM)
IF(WITH_DATABASE_STORAGE)
@@ -123,6 +143,14 @@ INCLUDE_DIRECTORIES(
${NSM_INCLUDE_DIR}
)
+IF(WITH_CAPI_WRAPPER)
+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}
@@ -136,22 +164,27 @@ INCLUDE_DIRECTORIES(${INCLUDE_DIRECTORIES}
)
ENDIF(WITH_DBUS_WRAPPER)
-ADD_EXECUTABLE(AudioManager ${AUDIOMAN_SRCS_CXX})
+file(GLOB ${AUDIOMAN_SRCS_CXX} ${COMMON_API_GEN_SOURCES})
-IF(WITH_DBUS_WRAPPER)
+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
- ${SQLITE_LIBRARIES}
- ${CMAKE_DL_LIBS}
${DBUS_LIBRARY}
rt
)
-ELSE(WITH_DBUS_WRAPPER)
+ELSEIF(WITH_CAPI_WRAPPER)
TARGET_LINK_LIBRARIES(AudioManager
- ${SQLITE_LIBRARIES}
- ${CMAKE_DL_LIBS}
+ ${COMMON_API_LIBRARIES}
+ ${COMMON_API_DBUS_LIBRARIES}
rt
)
-ENDIF(WITH_DBUS_WRAPPER)
+ENDIF()
IF(WITH_DLT)
TARGET_LINK_LIBRARIES(AudioManager
@@ -165,14 +198,18 @@ IF (SYSTEMD_FOUND)
)
ENDIF (SYSTEMD_FOUND)
-#IF(WITH_DOCUMENTATION)
-# file(MAKE_DIRECTORY ${DOC_OUTPUT_PATH})
-# configure_file(${DOXY_FILE} ${DOC_OUTPUT_PATH}/Doxyfile @ONLY IMMEDIATE)
-# add_custom_target (Docs ALL
-# COMMAND ${DOXYGEN_EXECUTABLE} ${DOC_OUTPUT_PATH}/Doxyfile WORKING_DIRECTORY ${DOC_OUTPUT_PATH}
-# SOURCES ${PROJECT_BINARY_DIR} ${DOC_OUTPUT_PATH}/Doxyfile
-# )
-#ENDIF(WITH_DOCUMENTATION)
+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)
+
INSTALL(TARGETS AudioManager
RUNTIME
@@ -191,11 +228,12 @@ IF(WITH_NSM)
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_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 ${CMAKE_INSTALL_PREFIX}/share/audiomanager/LifeCycleConsumer.xml)
+ SET(NSM_INTROSPECTION_FILE ${CMAKE_INSTALL_PREFIX}/share/audiomanager/LifecycleConsumer.xml)
INSTALL(
- FILES ${CMAKE_SOURCE_DIR}/cmake/LifecycleConsumer.xml
+ FILES ${CMAKE_SOURCE_DIR}/cmake/LifecycleConsumer.xml #${CMAKE_BINARY_DIR}/AudioManager_dbus.conf
DESTINATION "${NSM_INTROSPECTION_FILE}"
COMPONENT bin)
ENDIF(USE_BUILD_LIBS)
@@ -219,11 +257,13 @@ ENDIF(WITH_DLT)
IF(WITH_DBUS_WRAPPER)
SET(ADD_DEPEND_BIN_PROP ${ADD_DEPEND_BIN_PROP} "libdbus-1-3(>=1.2.16)")
-ENDIF()
+ENDIF(WITH_DBUS_WRAPPER)
# Additional Dev packet dependency
SET(ADD_DEPEND_DEV_PROP "audiomanager-bin" ${ADD_DEPEND_BIN_PROP})
+set(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}")
diff --git a/AudioManagerDaemon/fidls/NodeStateAccessStub_model_org.genivi.NodeStateManager.Consumer.fdepl b/AudioManagerDaemon/fidls/NodeStateAccessStub_model_org.genivi.NodeStateManager.Consumer.fdepl
new file mode 100644
index 0000000..b92bb71
--- /dev/null
+++ b/AudioManagerDaemon/fidls/NodeStateAccessStub_model_org.genivi.NodeStateManager.Consumer.fdepl
@@ -0,0 +1,6 @@
+import "platform:/plugin/org.genivi.commonapi.dbus/deployment/deployment.fdepl"
+import "NodeStateAccessStub_model_org.genivi.NodeStateManager.Consumer.fidl"
+
+define org.genivi.commonapi.dbus.deployment.deployment for interface org.genivi.NodeStateManager.Consumer.Consumer {
+ PropertiesType=freedesktop
+}
diff --git a/AudioManagerDaemon/fidls/NodeStateAccessStub_model_org.genivi.NodeStateManager.Consumer.fidl b/AudioManagerDaemon/fidls/NodeStateAccessStub_model_org.genivi.NodeStateManager.Consumer.fidl
new file mode 100755
index 0000000..6e6f224
--- /dev/null
+++ b/AudioManagerDaemon/fidls/NodeStateAccessStub_model_org.genivi.NodeStateManager.Consumer.fidl
@@ -0,0 +1,127 @@
+package org.genivi.NodeStateManager.Consumer
+
+//interface org.genivi.NodeStateManager.Consumer {
+interface Consumer {
+
+ version { major 0 minor 1 }
+
+ attribute Int32 RestartReason
+
+ attribute Int32 ShutdownReason
+
+ attribute Int32 WakeUpReason
+
+ attribute Int32 BootMode
+
+ method GetNodeState {
+ out {
+ Int32 NodeStateId
+ Int32 ErrorCode
+ }
+ }
+ method SetSessionState {
+ in {
+ String SessionName
+ String SessionOwner
+ Int32 SeatID
+ Int32 SessionState
+ }
+ out {
+ Int32 ErrorCode
+ }
+ }
+ method GetSessionState {
+ in {
+ String SessionName
+ Int32 SeatID
+ }
+ out {
+ Int32 SessionState
+ Int32 ErrorCode
+ }
+ }
+ method GetApplicationMode {
+ out {
+ Int32 ApplicationModeId
+ Int32 ErrorCode
+ }
+ }
+ method RegisterShutdownClient {
+ in {
+ String BusName
+ String ObjName
+ UInt32 ShutdownMode
+ UInt32 TimeoutMs
+ }
+ out {
+ Int32 ErrorCode
+ }
+ }
+ method UnRegisterShutdownClient {
+ in {
+ String BusName
+ String ObjName
+ UInt32 ShutdownMode
+ }
+ out {
+ Int32 ErrorCode
+ }
+ }
+ method RegisterSession {
+ in {
+ String SessionName
+ String SessionOwner
+ Int32 SeatID
+ Int32 SessionState
+ }
+ out {
+ Int32 ErrorCode
+ }
+ }
+ method UnRegisterSession {
+ in {
+ String SessionName
+ String SessionOwner
+ Int32 SeatID
+ }
+ out {
+ Int32 ErrorCode
+ }
+ }
+ method GetAppHealthCount {
+ out {
+ UInt32 Count
+ }
+ }
+ method GetInterfaceVersion {
+ out {
+ UInt32 Version
+ }
+ }
+ method LifecycleRequestComplete {
+ in {
+ UInt32 RequestId
+ Int32 Status
+ }
+ out {
+ Int32 ErrorCode
+ }
+ }
+ broadcast NodeState {
+ out {
+ Int32 NodeState
+ }
+ }
+ broadcast NodeApplicationMode {
+ out {
+ Int32 ApplicationModeId
+ }
+ }
+ broadcast SessionStateChanged {
+ out {
+ String SessionStateName
+ Int32 SeatID
+ Int32 SessionState
+ }
+ }
+} \ No newline at end of file
diff --git a/AudioManagerDaemon/fidls/NodeStateAccessStub_model_org.genivi.NodeStateManager.LifecycleConsumer.fidl b/AudioManagerDaemon/fidls/NodeStateAccessStub_model_org.genivi.NodeStateManager.LifecycleConsumer.fidl
new file mode 100755
index 0000000..e32c1c6
--- /dev/null
+++ b/AudioManagerDaemon/fidls/NodeStateAccessStub_model_org.genivi.NodeStateManager.LifecycleConsumer.fidl
@@ -0,0 +1,16 @@
+package org.genivi.NodeStateManager.LifeCycleConsumer
+
+//interface org.genivi.NodeStateManager.LifeCycleConsumer {
+interface LifeCycleConsumer {
+
+ version { major 0 minor 1 }
+ method LifecycleRequest {
+ in {
+ UInt32 Request
+ UInt32 RequestId
+ }
+ out {
+ Int32 ErrorCode
+ }
+ }
+} \ No newline at end of file
diff --git a/AudioManagerDaemon/fidls/NodeStateManager_dbus.conf b/AudioManagerDaemon/fidls/NodeStateManager_dbus.conf
new file mode 100755
index 0000000..3f0b04e
--- /dev/null
+++ b/AudioManagerDaemon/fidls/NodeStateManager_dbus.conf
@@ -0,0 +1,33 @@
+######################################### 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.audiomanger]
+dbus_connection=org.genivi.audiomanager
+dbus_object=/org/genivi/audiomanager/LifeCycleConsumer
+dbus_interface=org.genivi.NodeStateManager.LifeCycleConsumer
+dbus_predefined=true \ No newline at end of file
diff --git a/AudioManagerDaemon/fidls/amTypes.fidl b/AudioManagerDaemon/fidls/amTypes.fidl
new file mode 100755
index 0000000..9798dd7
--- /dev/null
+++ b/AudioManagerDaemon/fidls/amTypes.fidl
@@ -0,0 +1,330 @@
+package org.genivi
+
+typeCollection am
+{
+ typedef am_sourceID_t is UInt16
+ typedef am_sinkID_t is UInt16
+ typedef am_gatewayID_t is UInt16
+ typedef gongHandle is Int16
+ typedef am_sourceClass_t is UInt16
+ typedef am_sinkClass_t is UInt16
+ typedef am_volume_t is Int16
+ typedef am_mainVolume_t is Int16
+ typedef am_handle_t is UInt16
+ typedef am_time_t is UInt16
+ typedef am_connectionID_t is UInt16
+
+ enumeration gp_indicatorDirection_e
+ {
+ INDICATOR_RIGHT ="0x00"
+ INDICATOR_LEFT="0x01"
+ INDICATOR_WARNING="0x02"
+ }
+
+ enumeration am_RampType_e
+ {
+ RAMP_UNKNOWN = "0x00"
+ RAMP_GENIVI_DIRECT = "0x01"
+ RAMP_GENIVI_NO_PLOP = "0x02"
+ RAMP_GENIVI_EXP_INV = "0x03"
+ RAMP_GENIVI_LINEAR = "0x04"
+ RAMP_GENIVI_EXP = "0x05"
+ RAMP_MAX
+ }
+
+ enumeration am_MuteState_e
+ {
+ MS_UNKNOWN = "0x00"
+ MS_MUTED = "0x01"
+ MS_UNMUTED = "0x02"
+ MS_MAX
+ }
+
+ enumeration am_SourceState_e
+ {
+ SS_UNKNNOWN = "0x00"
+ SS_ON = "0x01"
+ SS_OFF = "0x02"
+ SS_PAUSED = "0x03"
+ SS_MAX
+ }
+ enumeration am_Error_e
+ {
+ E_OK = "0x00"
+ E_UNKNOWN = "0x01"
+ E_OUT_OF_RANGE = "0x02"
+ E_NOT_USED = "0x03"
+ E_DATABASE_ERROR = "0x04"
+ E_ALREADY_EXISTS = "0x05"
+ E_NO_CHANGE = "0x06"
+ E_NOT_POSSIBLE = "0x07"
+ E_NON_EXISTENT = "0x08"
+ E_ABORTED = "0x09"
+ E_WRONG_FORMAT = "0xA"
+ E_MAX
+ }
+
+ enumeration am_DomainState_e
+ {
+
+ DS_UNKNOWN = "0"
+ DS_CONTROLLED = "1"
+ DS_INDEPENDENT_STARTUP = "2"
+ DS_INDEPENDENT_RUNDOWN = "3"
+ DS_MAX
+ }
+
+ enumeration gongType_e
+ {
+ AT_NUN = "0x01"
+ AT_POC = "0x02"
+ AT_QUE = "0x03"
+ AT_IWA = "0x04"
+ AT_WA = "0x05"
+ AT_ETC_F = "0x06"
+ AT_ETC_F2 = "0x07"
+ AT_ETC_ST = "0x08"
+ AT_ETC_S = "0x09"
+ AT_REV = "0x0A"
+ AT_ESU = "0x0B"
+ AT_ESD = "0x0C"
+ AT_DG = "0x0D"
+ AT_SG = "0x0E"
+ AT_IDG = "0x0F"
+ AT_ION = "0x10"
+ AT_IOFF = "0x11"
+ AT_FBS = "0x12"
+ AT_VFS = "0x13"
+ AT_GES = "0x14"
+ AT_UEE = "0x15"
+ }
+
+ enumeration gp_indicatorStatus_e
+ {
+ IS_ON = "0x00"
+ IS_OFF = "0x01"
+ }
+
+ enumeration gongStatus_e
+ {
+ NOT_PLAYING = "0x00"
+ PLAYING = "0x01"
+ INTERRUPTED = "0x02"
+ }
+
+ enumeration gongError_e
+ {
+ SUCCESS = "0x00"
+ ERROR = "0x01"
+ LOW_PRIORITY = "0x02"
+ }
+
+ enumeration gongClass_e
+ {
+ GONGCLASS_1 = "0x01"
+ GONGCLASS_2 = "0x02"
+ GONGCLASS_PDC = "0x03"
+ GONGCLASS_TURN = "0x04"
+ GONGCLASS_OBSTACLE = "0x05"
+ }
+
+ enumeration sampleSet_e
+ {
+ setBMW = "0x00"
+ setMini = "0x01"
+ setRR = "0x02"
+ }
+
+ enumeration am_Availability_e
+ {
+ A_UNKNOWN = "0x00"
+ A_AVAILABLE = "0x01"
+ A_UNAVAILABLE = "0x02"
+ A_MAX
+ }
+ enumeration am_AvailabilityReason_e
+ {
+ AR_UNKNOWN = "0x00"
+ AR_GENIVI_NEWMEDIA = "0x01"
+ AR_GENIVI_SAMEMEDIA = "0x02"
+ AR_GENIVI_NOMEDIA = "0x03"
+ AR_GENIVI_TEMPERATURE = "0x04"
+ AR_GENIVI_VOLTAGE = "0x05"
+ AR_GENIVI_ERRORMEDIA = "0x06"
+ AR_MAX
+ }
+
+ enumeration am_InterruptState_e
+ {
+ IS_UNKNOWN = "0x00"
+ IS_OFF = "0x01"
+ IS_INTERRUPTED = "0x02"
+ IS_MAX
+ }
+
+ enumeration am_SoundPropertyType_e
+ {
+ SP_UNKNOWN = "0x00"
+ SP_EXAMPLE_TREBLE = "0x01"
+ SP_EXAMPLE_MID = "0x02"
+ SP_EXAMPLE_BASS = "0x03"
+ SP_ENTER_SINKID = "0x04"
+ SP_INTERR_SUPERSEEDINGID = "0x05"
+ SP_INTERR_OVERLAYID = "0x06"
+ SP_PRIORITY = "0x07"
+ SP_MAX
+ }
+
+ enumeration am_ConnectionFormat_e
+ {
+ CF_UNKNOWN = "0x00"
+ CF_GENIVI_MONO = "0x01"
+ CF_GENIVI_STEREO = "0x02"
+ CF_GENIVI_ANALOG = "0x03"
+ CF_GENIVI_AUTO = "0x04"
+ CF_MAX
+ }
+ array am_ConnectionFormat_L of am_ConnectionFormat_e
+
+ enumeration am_MainSoundPropertyType_e
+ {
+ MSP_UNKNOWN = "0x00"
+ MSP_EXAMPLE_TREBLE = "0x01"
+ MSP_EXAMPLE_MID = "0x02"
+ MSP_EXAMPLE_BASS = "0x03"
+ MSP_SOURCE_TYPE = "0x04"
+ MSP_MAX
+ }
+
+ enumeration am_NotificationType_e
+ {
+ NT_UNKNOWN = "0x00"
+ NT_LOUDNESS = "0x01"
+ NT_MAX
+ }
+
+ enumeration am_NotificationStatus_e
+ {
+ NS_UNKNOWN = "0x00"
+ NS_OFF = "0x01"
+ NS_PERIODIC = "0x02"
+ NS_MINIMUM = "0x03"
+ NS_MAXIMUM = "0x04"
+ NS_CHANGE = "0x05"
+ NS_MAX
+ }
+
+ struct distanceInformation_s
+ {
+ Int32 FrontLeft
+ Int32 FrontRight
+ Int32 RearLeft
+ Int32 RearRight
+ }
+
+ struct sampleNames_s
+ {
+ sampleSet_e sample
+ String sampleName
+ } array listSampleNamesL of sampleNames_s
+
+ typedef am_domainID_t is UInt16
+
+ struct am_Domain_s
+ {
+ am_domainID_t domainID
+ String name
+ String busname
+ String nodename
+ Boolean early
+ Boolean complete
+ am_DomainState_e ^state
+ }
+
+ struct notificationPayload_s
+ {
+ Int16 type
+ Int16 payload
+ }
+
+ struct am_Availability_s
+ {
+ am_Availability_e availability
+ am_AvailabilityReason_e availabilityReason
+ }
+
+ struct am_SoundProperty_s
+ {
+ am_SoundPropertyType_e type
+ Int16 value
+ }
+ array am_SoundProperty_L of am_SoundProperty_s
+
+ struct am_MainSoundProperty_s
+ {
+ am_MainSoundPropertyType_e type
+ Int16 value
+ }
+ array am_MainSoundProperty_L of am_MainSoundProperty_s
+
+ struct am_NotificationConfiguration_s
+ {
+ am_NotificationType_e type
+ am_NotificationStatus_e status
+ Int16 parameter
+ }
+ array am_NotificationConfiguration_L of am_NotificationConfiguration_s
+
+
+ array bool_L of Boolean
+
+ struct sourceData_s
+ {
+ am_sourceID_t sourceID
+ am_domainID_t domainID
+ String name
+ am_sourceClass_t sourceClassID
+ am_SourceState_e sourceState
+ am_volume_t volume
+ Boolean visible
+ am_Availability_s available
+ am_InterruptState_e interruptState
+ am_SoundProperty_L listSoundProperties
+ am_ConnectionFormat_L listConnectionFormats
+ am_MainSoundProperty_L listMainSoundProperties
+ am_NotificationConfiguration_L listMainNotificationConfigurations
+ am_NotificationConfiguration_L listNotificationConfigurations
+ }
+
+ struct sinkData_s
+ {
+ am_sinkID_t sinkID
+ String name
+ am_domainID_t domainID
+ am_sinkClass_t sinkClassID
+ am_volume_t volume
+ Boolean visible
+ am_Availability_s available
+ am_MuteState_e muteState
+ am_mainVolume_t mainVolume
+ am_SoundProperty_L listSoundProperties
+ am_ConnectionFormat_L listConnectionFormats
+ am_MainSoundProperty_L listMainSoundProperties
+ am_NotificationConfiguration_L listMainNotificationConfigurations
+ am_NotificationConfiguration_L listNotificationConfigurations
+ }
+
+ struct am_Gateway_s
+ {
+ am_gatewayID_t gatewayID
+ String name
+ am_sinkID_t sinkID
+ am_sourceID_t sourceID
+ am_domainID_t domainSinkID
+ am_domainID_t domainSourceID
+ am_domainID_t controlDomainID
+ am_ConnectionFormat_L listSourceFormats
+ am_ConnectionFormat_L listSinkFormats
+ bool_L convertionMatrix
+ }
+} \ No newline at end of file
diff --git a/AudioManagerDaemon/include/CAmNodeStateCommunicator.h b/AudioManagerDaemon/include/CAmNodeStateCommunicator.h
index dfc6689..8cf0dce 100644
--- a/AudioManagerDaemon/include/CAmNodeStateCommunicator.h
+++ b/AudioManagerDaemon/include/CAmNodeStateCommunicator.h
@@ -13,16 +13,22 @@
*
*
* \author Christian Linke, christian.linke@bmw.de BMW 2012
+ * \author Aleksandar Donchev, aleksander.donchev@partner.bmw.de BMW 2013
*
* \file CAmNodeStateCommunicator.h
* For further information see http://www.genivi.org/.
*
*/
-#ifndef CAMNODESTATECOMMUNICATOR_H_
-#define CAMNODESTATECOMMUNICATOR_H_
-#include "shared/CAmDbusWrapper.h"
+#ifndef CAMNODESTATECOMMUNICATORBASE_H_
+#define CAMNODESTATECOMMUNICATORBASE_H_
+
+#include <assert.h>
+#include "config.h"
#include "NodeStateManager.h"
+#include "audiomanagertypes.h"
+
+
namespace am
{
@@ -30,43 +36,37 @@ namespace am
class CAmControlSender;
/** communicates with the NSM
- * The CAmNodeStateCommunicator communicates with the NodeStateManager via Dbus. Only works, if CAmDBusWrapper is enabled.
+ * The CAmNodeStateCommunicator communicates with the NodeStateManager.
* The CAmNodeStateCommunicator is triggered via CAmControlReceiver, so you can communicate from the ControllerPlugin with it.
- * Most if the interfaces are passive, so you get the information you need via retrieving it. If you need to register the AudioManager
+ * Most of the interfaces are passive, so you get the information you need via retrieving it. If you need to register the AudioManager
* as LifeCycleConsumer, you need to call CAmNodeStateCommunicator::nsmRegisterShutdownClient which can be undone with CAmNodeStateCommunicator::nsmUnRegisterShutdownClient.
* After you have registered, you will get hookSystemLifecycleRequest on the ControlSendInterface of the controller.
* You should answer this within your set timeout with CAmNodeStateCommunicator::nsmSendLifecycleRequestComplete.
*/
+
class CAmNodeStateCommunicator
{
-public:
- CAmNodeStateCommunicator(CAmDbusWrapper* iDbusWrapper);
- virtual ~CAmNodeStateCommunicator();
- am_Error_e nsmGetRestartReasonProperty(NsmRestartReason_e& restartReason) ;
- am_Error_e nsmGetShutdownReasonProperty(NsmShutdownReason_e& ShutdownReason) ;
- am_Error_e nsmGetRunningReasonProperty(NsmRunningReason_e& nsmRunningReason) ;
- NsmErrorStatus_e nsmGetNodeState(NsmNodeState_e& nsmNodeState) ;
- NsmErrorStatus_e nsmGetSessionState(const std::string& sessionName, const NsmSeat_e& seatID, NsmSessionState_e& sessionState) ;
- NsmErrorStatus_e nsmGetApplicationMode(NsmApplicationMode_e& applicationMode) ;
- NsmErrorStatus_e nsmRegisterShutdownClient(const uint32_t shutdownMode, const uint32_t timeoutMs) ;
- NsmErrorStatus_e nsmUnRegisterShutdownClient(const uint32_t shutdownMode) ;
- am_Error_e nsmGetInterfaceVersion(uint32_t& version) ;
- NsmErrorStatus_e nsmSendLifecycleRequestComplete(const uint32_t RequestId, const NsmErrorStatus_e status) ;
-
- void registerControlSender(CAmControlSender* iControlSender);
- static DBusHandlerResult receiveCallback(DBusConnection *conn, DBusMessage *msg, void *user_data);
- static DBusHandlerResult signalCallback(DBusConnection *conn, DBusMessage *msg, void *user_data);
-
-
-private:
- void sendIntrospection(DBusConnection* conn, DBusMessage* msg);
- void sendMessage(DBusMessage* message, DBusMessage* origMessage);
- DBusHandlerResult receiveCallbackDelegate(DBusConnection *conn, DBusMessage *msg);
- am_Error_e readIntegerProperty(const std::string property, int32_t &value);
- CAmDbusWrapper* mpDbusWrapper;
+protected:
CAmControlSender* mpControlSender;
- DBusConnection* mpDBusConnection;
+public:
+ CAmNodeStateCommunicator():mpControlSender(NULL) {}
+ virtual ~CAmNodeStateCommunicator() {}
+ virtual am_Error_e nsmGetRestartReasonProperty(NsmRestartReason_e& restartReason) = 0;
+ virtual am_Error_e nsmGetShutdownReasonProperty(NsmShutdownReason_e& ShutdownReason) = 0;
+ virtual am_Error_e nsmGetRunningReasonProperty(NsmRunningReason_e& nsmRunningReason) = 0;
+ virtual NsmErrorStatus_e nsmGetNodeState(NsmNodeState_e& nsmNodeState) = 0;
+ virtual NsmErrorStatus_e nsmGetSessionState(const std::string& sessionName, const NsmSeat_e& seatID, NsmSessionState_e& sessionState) = 0;
+ virtual NsmErrorStatus_e nsmGetApplicationMode(NsmApplicationMode_e& applicationMode) = 0;
+ virtual NsmErrorStatus_e nsmRegisterShutdownClient(const uint32_t shutdownMode, const uint32_t timeoutMs) = 0;
+ virtual NsmErrorStatus_e nsmUnRegisterShutdownClient(const uint32_t shutdownMode) = 0;
+ virtual am_Error_e nsmGetInterfaceVersion(uint32_t& version) = 0;
+ virtual NsmErrorStatus_e nsmSendLifecycleRequestComplete(const uint32_t RequestId, const NsmErrorStatus_e status) = 0;
+ virtual void registerControlSender(CAmControlSender* iControlSender) {
+ assert(NULL!=iControlSender);
+ mpControlSender = iControlSender;
+ }
};
-} /* namespace am */
-#endif /* CAMNODESTATECOMMUNICATOR_H_ */
+}
+
+#endif /* CAMNODESTATECOMMUNICATORBASE_H_ */
diff --git a/AudioManagerDaemon/include/CAmNodeStateCommunicatorCAPI.h b/AudioManagerDaemon/include/CAmNodeStateCommunicatorCAPI.h
new file mode 100644
index 0000000..6c063e5
--- /dev/null
+++ b/AudioManagerDaemon/include/CAmNodeStateCommunicatorCAPI.h
@@ -0,0 +1,101 @@
+/**
+ * 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
+ *
+ * \file CAmNodeStateCommunicatorCAPI.h
+ * For further information see http://www.genivi.org/.
+ *
+ */
+#ifndef CAMNODESTATECOMMUNICATORCAPI_H_
+#define CAMNODESTATECOMMUNICATORCAPI_H_
+
+#include <org/genivi/NodeStateManager/Consumer/ConsumerProxy.h>
+#include "CAmNodeStateCommunicator.h"
+#include "LifeCycleConsumerStubDefault.h"
+
+namespace am
+{
+using namespace CommonAPI;
+using namespace org::genivi::NodeStateManager::Consumer;
+using namespace org::genivi::NodeStateManager::LifeCycleConsumer;
+
+
+class CAmCommonAPIWrapper;
+/** communicates with the NSM
+ * The CAmNodeStateCommunicator communicates with the NodeStateManager via Dbus Common-API's wrapping mechanism. Only works, if CAmCommonAPIWrapper is enabled.
+ */
+class CAmNodeStateCommunicatorCAPI : public CAmNodeStateCommunicator
+{
+ /* A concrete implementation of the life cycle stub.
+ * An object from this class is instantiated from the common-api factory.
+ * It forwards the invocations to its delegate CAmNodeStateCommunicatorCAPI.
+ */
+ class CAmNodeStateCommunicatorServiceImpl : public LifeCycleConsumerStubDefault
+ {
+ CAmNodeStateCommunicatorCAPI *mpDelegate;
+ public:
+ CAmNodeStateCommunicatorServiceImpl ():mpDelegate(NULL) {}
+ CAmNodeStateCommunicatorServiceImpl (CAmNodeStateCommunicatorCAPI *aNSCommunicator):mpDelegate(aNSCommunicator) {}
+ ~CAmNodeStateCommunicatorServiceImpl() { mpDelegate = NULL; }
+
+ CAmNodeStateCommunicatorCAPI *getDelegate() { return mpDelegate; };
+ void setDelegate(CAmNodeStateCommunicatorCAPI *aDelegate) { mpDelegate = aDelegate; };
+
+ void LifecycleRequest(uint32_t Request, uint32_t RequestId, int32_t& ErrorCode) {
+ if(mpDelegate)
+ mpDelegate->cbReceivedLifecycleRequest(Request, RequestId, ErrorCode);
+ }
+ };
+
+ CAmCommonAPIWrapper *mpCAPIWrapper;
+ std::shared_ptr<ConsumerProxy<> > mNSMProxy;
+ std::shared_ptr<CAmNodeStateCommunicatorCAPI::CAmNodeStateCommunicatorServiceImpl> mNSMStub;
+public:
+ CAmNodeStateCommunicatorCAPI(CAmCommonAPIWrapper* iCAPIWrapper);
+ virtual ~CAmNodeStateCommunicatorCAPI();
+
+ am_Error_e nsmGetRestartReasonProperty(NsmRestartReason_e& restartReason) ;
+ am_Error_e nsmGetShutdownReasonProperty(NsmShutdownReason_e& ShutdownReason) ;
+ am_Error_e nsmGetRunningReasonProperty(NsmRunningReason_e& nsmRunningReason) ;
+ NsmErrorStatus_e nsmGetNodeState(NsmNodeState_e& nsmNodeState) ;
+ NsmErrorStatus_e nsmGetSessionState(const std::string& sessionName, const NsmSeat_e& seatID, NsmSessionState_e& sessionState) ;
+ NsmErrorStatus_e nsmGetApplicationMode(NsmApplicationMode_e& applicationMode) ;
+ NsmErrorStatus_e nsmRegisterShutdownClient(const uint32_t shutdownMode, const uint32_t timeoutMs) ;
+ NsmErrorStatus_e nsmUnRegisterShutdownClient(const uint32_t shutdownMode) ;
+ am_Error_e nsmGetInterfaceVersion(uint32_t& version) ;
+ NsmErrorStatus_e nsmSendLifecycleRequestComplete(const uint32_t RequestId, const NsmErrorStatus_e status) ;
+
+ bool isServiceAvailable();
+
+ static const char * CLIENT_STRING;
+ static const char * SERVER_STRING;
+ static const char * OBJECT_NAME;
+ static const char * BUS_NAME;
+
+private:
+ /* Client events */
+ void onNodeStateEvent(const int32_t nodeState);
+ void onNodeApplicationModeEvent(const int32_t nodeApplicationMode);
+ void onSessionStateChangedEvent(const std::string & sessionName, const int32_t seatID, const int32_t sessionState);
+ void onServiceStatusEvent(const CommonAPI::AvailabilityStatus& serviceStatus);
+ /* Service callbacks */
+ void cbReceivedLifecycleRequest(uint32_t Request, uint32_t RequestId, int32_t& ErrorCode);
+protected:
+ bool mIsServiceAvailable;
+};
+
+}
+/* namespace am */
+#endif /* CAMNODESTATECOMMUNICATORCAPI_H_ */
diff --git a/AudioManagerDaemon/include/CAmNodeStateCommunicatorDBus.h b/AudioManagerDaemon/include/CAmNodeStateCommunicatorDBus.h
new file mode 100644
index 0000000..cb78f0f
--- /dev/null
+++ b/AudioManagerDaemon/include/CAmNodeStateCommunicatorDBus.h
@@ -0,0 +1,63 @@
+/**
+ * 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 Linke, christian.linke@bmw.de BMW 2012
+ *
+ * \file CAmNodeStateCommunicatorDBus.h
+ * For further information see http://www.genivi.org/.
+ *
+ */
+#ifndef CAMNODESTATECOMMUNICATORDBUS_H_
+#define CAMNODESTATECOMMUNICATORDBUS_H_
+
+#include "shared/CAmDbusWrapper.h"
+#include "CAmNodeStateCommunicator.h"
+
+namespace am
+{
+/** communicates with the NSM
+ * The CAmNodeStateCommunicator communicates with the NodeStateManager via Dbus. Only works, if CAmDbusWrapper is enabled.
+ */
+
+class CAmNodeStateCommunicatorDBus : public CAmNodeStateCommunicator
+{
+public:
+ CAmNodeStateCommunicatorDBus(CAmDbusWrapper* iDbusWrapper);
+ virtual ~CAmNodeStateCommunicatorDBus();
+ am_Error_e nsmGetRestartReasonProperty(NsmRestartReason_e& restartReason) ;
+ am_Error_e nsmGetShutdownReasonProperty(NsmShutdownReason_e& ShutdownReason) ;
+ am_Error_e nsmGetRunningReasonProperty(NsmRunningReason_e& nsmRunningReason) ;
+ NsmErrorStatus_e nsmGetNodeState(NsmNodeState_e& nsmNodeState) ;
+ NsmErrorStatus_e nsmGetSessionState(const std::string& sessionName, const NsmSeat_e& seatID, NsmSessionState_e& sessionState) ;
+ NsmErrorStatus_e nsmGetApplicationMode(NsmApplicationMode_e& applicationMode) ;
+ NsmErrorStatus_e nsmRegisterShutdownClient(const uint32_t shutdownMode, const uint32_t timeoutMs) ;
+ NsmErrorStatus_e nsmUnRegisterShutdownClient(const uint32_t shutdownMode) ;
+ am_Error_e nsmGetInterfaceVersion(uint32_t& version) ;
+ NsmErrorStatus_e nsmSendLifecycleRequestComplete(const uint32_t RequestId, const NsmErrorStatus_e status) ;
+
+ static DBusHandlerResult receiveCallback(DBusConnection *conn, DBusMessage *msg, void *user_data);
+ static DBusHandlerResult signalCallback(DBusConnection *conn, DBusMessage *msg, void *user_data);
+
+
+private:
+ void sendIntrospection(DBusConnection* conn, DBusMessage* msg);
+ void sendMessage(DBusMessage* message, DBusMessage* origMessage);
+ DBusHandlerResult receiveCallbackDelegate(DBusConnection *conn, DBusMessage *msg);
+ am_Error_e readIntegerProperty(const std::string property, int32_t &value);
+ CAmDbusWrapper* mpDbusWrapper;
+ DBusConnection* mpDBusConnection;
+};
+
+} /* namespace am */
+#endif /* CAMNODESTATECOMMUNICATORDBUS_H_ */
diff --git a/AudioManagerDaemon/include/TAmPluginTemplate.h b/AudioManagerDaemon/include/TAmPluginTemplate.h
index 2959b04..a421cd1 100644
--- a/AudioManagerDaemon/include/TAmPluginTemplate.h
+++ b/AudioManagerDaemon/include/TAmPluginTemplate.h
@@ -46,10 +46,9 @@ template<class T> T* getCreateFunction(const std::string& libname, void*& librar
// cut off "lib" in front and cut off .so end"
std::string createFunctionName = libFileName.substr(3, libFileName.length() - 6) + "Factory";
-
// open library
dlerror(); // Clear any existing error
- libraryHandle = dlopen(libname.c_str(), RTLD_LAZY);
+ libraryHandle = dlopen(libname.c_str(), RTLD_LAZY );
const char* dlopen_error = dlerror();
if (!libraryHandle || dlopen_error)
{
diff --git a/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/Consumer.h b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/Consumer.h
new file mode 100644
index 0000000..345bd3b
--- /dev/null
+++ b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/Consumer.h
@@ -0,0 +1,70 @@
+/*
+* This file was generated by the CommonAPI Generators.
+*
+ * 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/.
+*/
+#ifndef ORG_GENIVI_NODESTATEMANAGER_CONSUMER_Consumer_H_
+#define ORG_GENIVI_NODESTATEMANAGER_CONSUMER_Consumer_H_
+
+
+
+#define COMMONAPI_INTERNAL_COMPILATION
+
+#include <CommonAPI/types.h>
+
+#undef COMMONAPI_INTERNAL_COMPILATION
+
+namespace org {
+namespace genivi {
+namespace NodeStateManager {
+namespace Consumer {
+
+class Consumer {
+ public:
+ virtual ~Consumer() { }
+
+ static inline const char* getInterfaceId();
+ static inline CommonAPI::Version getInterfaceVersion();
+};
+
+const char* Consumer::getInterfaceId() {
+ return "org.genivi.NodeStateManager.Consumer.Consumer";
+}
+
+CommonAPI::Version Consumer::getInterfaceVersion() {
+ return CommonAPI::Version(0, 1);
+}
+
+
+} // namespace Consumer
+} // namespace NodeStateManager
+} // namespace genivi
+} // namespace org
+
+namespace CommonAPI {
+
+}
+
+
+namespace std {
+ //hashes for types
+
+ //hashes for error types
+}
+
+#endif // ORG_GENIVI_NODESTATEMANAGER_CONSUMER_Consumer_H_
diff --git a/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerDBusProxy.cpp b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerDBusProxy.cpp
new file mode 100644
index 0000000..e920d51
--- /dev/null
+++ b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerDBusProxy.cpp
@@ -0,0 +1,292 @@
+/*
+* This file was generated by the CommonAPI Generators.
+*
+ * 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/.
+*/
+#include "ConsumerDBusProxy.h"
+
+namespace org {
+namespace genivi {
+namespace NodeStateManager {
+namespace Consumer {
+
+std::shared_ptr<CommonAPI::DBus::DBusProxy> createConsumerDBusProxy(
+ const std::string& commonApiAddress,
+ const std::string& interfaceName,
+ const std::string& busName,
+ const std::string& objectPath,
+ const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection>& dbusProxyConnection) {
+ return std::make_shared<ConsumerDBusProxy>(commonApiAddress, interfaceName, busName, objectPath, dbusProxyConnection);
+}
+
+__attribute__((constructor)) void registerConsumerDBusProxy(void) {
+ CommonAPI::DBus::DBusFactory::registerProxyFactoryMethod(Consumer::getInterfaceId(),
+ &createConsumerDBusProxy);
+}
+
+ConsumerDBusProxy::ConsumerDBusProxy(
+ const std::string& commonApiAddress,
+ const std::string& interfaceName,
+ const std::string& busName,
+ const std::string& objectPath,
+ const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection>& dbusProxyconnection):
+ CommonAPI::DBus::DBusProxy(commonApiAddress, interfaceName, busName, objectPath, dbusProxyconnection)
+, restartReason_(*this, interfaceName.c_str(), "RestartReason"),
+ shutdownReason_(*this, interfaceName.c_str(), "ShutdownReason"),
+ wakeUpReason_(*this, interfaceName.c_str(), "WakeUpReason"),
+ bootMode_(*this, interfaceName.c_str(), "BootMode")
+, nodeState_(*this, "NodeState", "i"),
+ nodeApplicationMode_(*this, "NodeApplicationMode", "i"),
+ sessionStateChanged_(*this, "SessionStateChanged", "sii")
+ {
+}
+
+ConsumerDBusProxy::RestartReasonAttribute& ConsumerDBusProxy::getRestartReasonAttribute() {
+ return restartReason_;
+}
+ConsumerDBusProxy::ShutdownReasonAttribute& ConsumerDBusProxy::getShutdownReasonAttribute() {
+ return shutdownReason_;
+}
+ConsumerDBusProxy::WakeUpReasonAttribute& ConsumerDBusProxy::getWakeUpReasonAttribute() {
+ return wakeUpReason_;
+}
+ConsumerDBusProxy::BootModeAttribute& ConsumerDBusProxy::getBootModeAttribute() {
+ return bootMode_;
+}
+
+ConsumerDBusProxy::NodeStateEvent& ConsumerDBusProxy::getNodeStateEvent() {
+ return nodeState_;
+}
+ConsumerDBusProxy::NodeApplicationModeEvent& ConsumerDBusProxy::getNodeApplicationModeEvent() {
+ return nodeApplicationMode_;
+}
+ConsumerDBusProxy::SessionStateChangedEvent& ConsumerDBusProxy::getSessionStateChangedEvent() {
+ return sessionStateChanged_;
+}
+
+void ConsumerDBusProxy::GetNodeState(CommonAPI::CallStatus& callStatus, int32_t& NodeStateId, int32_t& ErrorCode) {
+ CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<>,
+ CommonAPI::DBus::DBusSerializableArguments<int32_t, int32_t> >::callMethodWithReply(
+ *this,
+ "GetNodeState",
+ "",
+ callStatus
+ , NodeStateId, ErrorCode);
+}
+std::future<CommonAPI::CallStatus> ConsumerDBusProxy::GetNodeStateAsync(GetNodeStateAsyncCallback callback) {
+ return CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<>,
+ CommonAPI::DBus::DBusSerializableArguments<int32_t, int32_t> >::callMethodAsync(
+ *this,
+ "GetNodeState",
+ "",
+ std::move(callback));
+}
+void ConsumerDBusProxy::SetSessionState(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, const int32_t& SessionState, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode) {
+ CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<std::string, std::string, int32_t, int32_t>,
+ CommonAPI::DBus::DBusSerializableArguments<int32_t> >::callMethodWithReply(
+ *this,
+ "SetSessionState",
+ "ssii",
+ SessionName, SessionOwner, SeatID, SessionState,
+ callStatus
+ , ErrorCode);
+}
+std::future<CommonAPI::CallStatus> ConsumerDBusProxy::SetSessionStateAsync(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, const int32_t& SessionState, SetSessionStateAsyncCallback callback) {
+ return CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<std::string, std::string, int32_t, int32_t>,
+ CommonAPI::DBus::DBusSerializableArguments<int32_t> >::callMethodAsync(
+ *this,
+ "SetSessionState",
+ "ssii",
+ SessionName, SessionOwner, SeatID, SessionState,
+ std::move(callback));
+}
+void ConsumerDBusProxy::GetSessionState(const std::string& SessionName, const int32_t& SeatID, CommonAPI::CallStatus& callStatus, int32_t& SessionState, int32_t& ErrorCode) {
+ CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<std::string, int32_t>,
+ CommonAPI::DBus::DBusSerializableArguments<int32_t, int32_t> >::callMethodWithReply(
+ *this,
+ "GetSessionState",
+ "si",
+ SessionName, SeatID,
+ callStatus
+ , SessionState, ErrorCode);
+}
+std::future<CommonAPI::CallStatus> ConsumerDBusProxy::GetSessionStateAsync(const std::string& SessionName, const int32_t& SeatID, GetSessionStateAsyncCallback callback) {
+ return CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<std::string, int32_t>,
+ CommonAPI::DBus::DBusSerializableArguments<int32_t, int32_t> >::callMethodAsync(
+ *this,
+ "GetSessionState",
+ "si",
+ SessionName, SeatID,
+ std::move(callback));
+}
+void ConsumerDBusProxy::GetApplicationMode(CommonAPI::CallStatus& callStatus, int32_t& ApplicationModeId, int32_t& ErrorCode) {
+ CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<>,
+ CommonAPI::DBus::DBusSerializableArguments<int32_t, int32_t> >::callMethodWithReply(
+ *this,
+ "GetApplicationMode",
+ "",
+ callStatus
+ , ApplicationModeId, ErrorCode);
+}
+std::future<CommonAPI::CallStatus> ConsumerDBusProxy::GetApplicationModeAsync(GetApplicationModeAsyncCallback callback) {
+ return CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<>,
+ CommonAPI::DBus::DBusSerializableArguments<int32_t, int32_t> >::callMethodAsync(
+ *this,
+ "GetApplicationMode",
+ "",
+ std::move(callback));
+}
+void ConsumerDBusProxy::RegisterShutdownClient(const std::string& BusName, const std::string& ObjName, const uint32_t& ShutdownMode, const uint32_t& TimeoutMs, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode) {
+ CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<std::string, std::string, uint32_t, uint32_t>,
+ CommonAPI::DBus::DBusSerializableArguments<int32_t> >::callMethodWithReply(
+ *this,
+ "RegisterShutdownClient",
+ "ssuu",
+ BusName, ObjName, ShutdownMode, TimeoutMs,
+ callStatus
+ , ErrorCode);
+}
+std::future<CommonAPI::CallStatus> ConsumerDBusProxy::RegisterShutdownClientAsync(const std::string& BusName, const std::string& ObjName, const uint32_t& ShutdownMode, const uint32_t& TimeoutMs, RegisterShutdownClientAsyncCallback callback) {
+ return CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<std::string, std::string, uint32_t, uint32_t>,
+ CommonAPI::DBus::DBusSerializableArguments<int32_t> >::callMethodAsync(
+ *this,
+ "RegisterShutdownClient",
+ "ssuu",
+ BusName, ObjName, ShutdownMode, TimeoutMs,
+ std::move(callback));
+}
+void ConsumerDBusProxy::UnRegisterShutdownClient(const std::string& BusName, const std::string& ObjName, const uint32_t& ShutdownMode, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode) {
+ CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<std::string, std::string, uint32_t>,
+ CommonAPI::DBus::DBusSerializableArguments<int32_t> >::callMethodWithReply(
+ *this,
+ "UnRegisterShutdownClient",
+ "ssu",
+ BusName, ObjName, ShutdownMode,
+ callStatus
+ , ErrorCode);
+}
+std::future<CommonAPI::CallStatus> ConsumerDBusProxy::UnRegisterShutdownClientAsync(const std::string& BusName, const std::string& ObjName, const uint32_t& ShutdownMode, UnRegisterShutdownClientAsyncCallback callback) {
+ return CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<std::string, std::string, uint32_t>,
+ CommonAPI::DBus::DBusSerializableArguments<int32_t> >::callMethodAsync(
+ *this,
+ "UnRegisterShutdownClient",
+ "ssu",
+ BusName, ObjName, ShutdownMode,
+ std::move(callback));
+}
+void ConsumerDBusProxy::RegisterSession(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, const int32_t& SessionState, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode) {
+ CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<std::string, std::string, int32_t, int32_t>,
+ CommonAPI::DBus::DBusSerializableArguments<int32_t> >::callMethodWithReply(
+ *this,
+ "RegisterSession",
+ "ssii",
+ SessionName, SessionOwner, SeatID, SessionState,
+ callStatus
+ , ErrorCode);
+}
+std::future<CommonAPI::CallStatus> ConsumerDBusProxy::RegisterSessionAsync(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, const int32_t& SessionState, RegisterSessionAsyncCallback callback) {
+ return CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<std::string, std::string, int32_t, int32_t>,
+ CommonAPI::DBus::DBusSerializableArguments<int32_t> >::callMethodAsync(
+ *this,
+ "RegisterSession",
+ "ssii",
+ SessionName, SessionOwner, SeatID, SessionState,
+ std::move(callback));
+}
+void ConsumerDBusProxy::UnRegisterSession(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode) {
+ CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<std::string, std::string, int32_t>,
+ CommonAPI::DBus::DBusSerializableArguments<int32_t> >::callMethodWithReply(
+ *this,
+ "UnRegisterSession",
+ "ssi",
+ SessionName, SessionOwner, SeatID,
+ callStatus
+ , ErrorCode);
+}
+std::future<CommonAPI::CallStatus> ConsumerDBusProxy::UnRegisterSessionAsync(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, UnRegisterSessionAsyncCallback callback) {
+ return CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<std::string, std::string, int32_t>,
+ CommonAPI::DBus::DBusSerializableArguments<int32_t> >::callMethodAsync(
+ *this,
+ "UnRegisterSession",
+ "ssi",
+ SessionName, SessionOwner, SeatID,
+ std::move(callback));
+}
+void ConsumerDBusProxy::GetAppHealthCount(CommonAPI::CallStatus& callStatus, uint32_t& Count) {
+ CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<>,
+ CommonAPI::DBus::DBusSerializableArguments<uint32_t> >::callMethodWithReply(
+ *this,
+ "GetAppHealthCount",
+ "",
+ callStatus
+ , Count);
+}
+std::future<CommonAPI::CallStatus> ConsumerDBusProxy::GetAppHealthCountAsync(GetAppHealthCountAsyncCallback callback) {
+ return CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<>,
+ CommonAPI::DBus::DBusSerializableArguments<uint32_t> >::callMethodAsync(
+ *this,
+ "GetAppHealthCount",
+ "",
+ std::move(callback));
+}
+void ConsumerDBusProxy::GetInterfaceVersion(CommonAPI::CallStatus& callStatus, uint32_t& Version) {
+ CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<>,
+ CommonAPI::DBus::DBusSerializableArguments<uint32_t> >::callMethodWithReply(
+ *this,
+ "GetInterfaceVersion",
+ "",
+ callStatus
+ , Version);
+}
+std::future<CommonAPI::CallStatus> ConsumerDBusProxy::GetInterfaceVersionAsync(GetInterfaceVersionAsyncCallback callback) {
+ return CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<>,
+ CommonAPI::DBus::DBusSerializableArguments<uint32_t> >::callMethodAsync(
+ *this,
+ "GetInterfaceVersion",
+ "",
+ std::move(callback));
+}
+void ConsumerDBusProxy::LifecycleRequestComplete(const uint32_t& RequestId, const int32_t& Status, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode) {
+ CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<uint32_t, int32_t>,
+ CommonAPI::DBus::DBusSerializableArguments<int32_t> >::callMethodWithReply(
+ *this,
+ "LifecycleRequestComplete",
+ "ui",
+ RequestId, Status,
+ callStatus
+ , ErrorCode);
+}
+std::future<CommonAPI::CallStatus> ConsumerDBusProxy::LifecycleRequestCompleteAsync(const uint32_t& RequestId, const int32_t& Status, LifecycleRequestCompleteAsyncCallback callback) {
+ return CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<uint32_t, int32_t>,
+ CommonAPI::DBus::DBusSerializableArguments<int32_t> >::callMethodAsync(
+ *this,
+ "LifecycleRequestComplete",
+ "ui",
+ RequestId, Status,
+ std::move(callback));
+}
+
+void ConsumerDBusProxy::getOwnVersion(uint16_t& ownVersionMajor, uint16_t& ownVersionMinor) const {
+ ownVersionMajor = 0;
+ ownVersionMinor = 1;
+}
+
+} // namespace Consumer
+} // namespace NodeStateManager
+} // namespace genivi
+} // namespace org
diff --git a/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerDBusProxy.h b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerDBusProxy.h
new file mode 100644
index 0000000..c3db1df
--- /dev/null
+++ b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerDBusProxy.h
@@ -0,0 +1,114 @@
+/*
+* This file was generated by the CommonAPI Generators.
+*
+ * 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/.
+*/
+#ifndef ORG_GENIVI_NODESTATEMANAGER_CONSUMER_Consumer_DBUS_PROXY_H_
+#define ORG_GENIVI_NODESTATEMANAGER_CONSUMER_Consumer_DBUS_PROXY_H_
+
+#include <org/genivi/NodeStateManager/Consumer/ConsumerProxyBase.h>
+
+#define COMMONAPI_INTERNAL_COMPILATION
+
+#include <CommonAPI/DBus/DBusFactory.h>
+#include <CommonAPI/DBus/DBusProxy.h>
+#include <CommonAPI/DBus/DBusAttribute.h>
+#include <CommonAPI/DBus/DBusEvent.h>
+
+#undef COMMONAPI_INTERNAL_COMPILATION
+
+#include <string>
+
+namespace org {
+namespace genivi {
+namespace NodeStateManager {
+namespace Consumer {
+
+class ConsumerDBusProxy: virtual public ConsumerProxyBase, virtual public CommonAPI::DBus::DBusProxy {
+ public:
+ ConsumerDBusProxy(
+ const std::string& commonApiAddress,
+ const std::string& interfaceName,
+ const std::string& busName,
+ const std::string& objectPath,
+ const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection>& dbusProxyconnection);
+
+ virtual ~ConsumerDBusProxy() { }
+
+ virtual RestartReasonAttribute& getRestartReasonAttribute();
+ virtual ShutdownReasonAttribute& getShutdownReasonAttribute();
+ virtual WakeUpReasonAttribute& getWakeUpReasonAttribute();
+ virtual BootModeAttribute& getBootModeAttribute();
+
+ virtual NodeStateEvent& getNodeStateEvent();
+ virtual NodeApplicationModeEvent& getNodeApplicationModeEvent();
+ virtual SessionStateChangedEvent& getSessionStateChangedEvent();
+
+
+ virtual void GetNodeState(CommonAPI::CallStatus& callStatus, int32_t& NodeStateId, int32_t& ErrorCode);
+ virtual std::future<CommonAPI::CallStatus> GetNodeStateAsync(GetNodeStateAsyncCallback callback);
+
+ virtual void SetSessionState(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, const int32_t& SessionState, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode);
+ virtual std::future<CommonAPI::CallStatus> SetSessionStateAsync(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, const int32_t& SessionState, SetSessionStateAsyncCallback callback);
+
+ virtual void GetSessionState(const std::string& SessionName, const int32_t& SeatID, CommonAPI::CallStatus& callStatus, int32_t& SessionState, int32_t& ErrorCode);
+ virtual std::future<CommonAPI::CallStatus> GetSessionStateAsync(const std::string& SessionName, const int32_t& SeatID, GetSessionStateAsyncCallback callback);
+
+ virtual void GetApplicationMode(CommonAPI::CallStatus& callStatus, int32_t& ApplicationModeId, int32_t& ErrorCode);
+ virtual std::future<CommonAPI::CallStatus> GetApplicationModeAsync(GetApplicationModeAsyncCallback callback);
+
+ virtual void RegisterShutdownClient(const std::string& BusName, const std::string& ObjName, const uint32_t& ShutdownMode, const uint32_t& TimeoutMs, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode);
+ virtual std::future<CommonAPI::CallStatus> RegisterShutdownClientAsync(const std::string& BusName, const std::string& ObjName, const uint32_t& ShutdownMode, const uint32_t& TimeoutMs, RegisterShutdownClientAsyncCallback callback);
+
+ virtual void UnRegisterShutdownClient(const std::string& BusName, const std::string& ObjName, const uint32_t& ShutdownMode, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode);
+ virtual std::future<CommonAPI::CallStatus> UnRegisterShutdownClientAsync(const std::string& BusName, const std::string& ObjName, const uint32_t& ShutdownMode, UnRegisterShutdownClientAsyncCallback callback);
+
+ virtual void RegisterSession(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, const int32_t& SessionState, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode);
+ virtual std::future<CommonAPI::CallStatus> RegisterSessionAsync(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, const int32_t& SessionState, RegisterSessionAsyncCallback callback);
+
+ virtual void UnRegisterSession(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode);
+ virtual std::future<CommonAPI::CallStatus> UnRegisterSessionAsync(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, UnRegisterSessionAsyncCallback callback);
+
+ virtual void GetAppHealthCount(CommonAPI::CallStatus& callStatus, uint32_t& Count);
+ virtual std::future<CommonAPI::CallStatus> GetAppHealthCountAsync(GetAppHealthCountAsyncCallback callback);
+
+ virtual void GetInterfaceVersion(CommonAPI::CallStatus& callStatus, uint32_t& Version);
+ virtual std::future<CommonAPI::CallStatus> GetInterfaceVersionAsync(GetInterfaceVersionAsyncCallback callback);
+
+ virtual void LifecycleRequestComplete(const uint32_t& RequestId, const int32_t& Status, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode);
+ virtual std::future<CommonAPI::CallStatus> LifecycleRequestCompleteAsync(const uint32_t& RequestId, const int32_t& Status, LifecycleRequestCompleteAsyncCallback callback);
+
+ virtual void getOwnVersion(uint16_t& ownVersionMajor, uint16_t& ownVersionMinor) const;
+
+ private:
+ CommonAPI::DBus::DBusFreedesktopObservableAttribute<CommonAPI::DBus::DBusFreedesktopAttribute<RestartReasonAttribute>> restartReason_;
+ CommonAPI::DBus::DBusFreedesktopObservableAttribute<CommonAPI::DBus::DBusFreedesktopAttribute<ShutdownReasonAttribute>> shutdownReason_;
+ CommonAPI::DBus::DBusFreedesktopObservableAttribute<CommonAPI::DBus::DBusFreedesktopAttribute<WakeUpReasonAttribute>> wakeUpReason_;
+ CommonAPI::DBus::DBusFreedesktopObservableAttribute<CommonAPI::DBus::DBusFreedesktopAttribute<BootModeAttribute>> bootMode_;
+
+ CommonAPI::DBus::DBusEvent<NodeStateEvent> nodeState_;
+ CommonAPI::DBus::DBusEvent<NodeApplicationModeEvent> nodeApplicationMode_;
+ CommonAPI::DBus::DBusEvent<SessionStateChangedEvent> sessionStateChanged_;
+};
+
+} // namespace Consumer
+} // namespace NodeStateManager
+} // namespace genivi
+} // namespace org
+
+#endif // ORG_GENIVI_NODESTATEMANAGER_CONSUMER_Consumer_DBUS_PROXY_H_
diff --git a/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerDBusStubAdapter.cpp b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerDBusStubAdapter.cpp
new file mode 100644
index 0000000..a72ba16
--- /dev/null
+++ b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerDBusStubAdapter.cpp
@@ -0,0 +1,374 @@
+/*
+* This file was generated by the CommonAPI Generators.
+*
+ * 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/.
+*/
+#include "ConsumerDBusStubAdapter.h"
+#include <org/genivi/NodeStateManager/Consumer/Consumer.h>
+
+namespace org {
+namespace genivi {
+namespace NodeStateManager {
+namespace Consumer {
+
+std::shared_ptr<CommonAPI::DBus::DBusStubAdapter> createConsumerDBusStubAdapter(
+ const std::string& commonApiAddress,
+ const std::string& interfaceName,
+ const std::string& busName,
+ const std::string& objectPath,
+ const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection>& dbusProxyConnection,
+ const std::shared_ptr<CommonAPI::StubBase>& stubBase) {
+ return std::make_shared<ConsumerDBusStubAdapter>(commonApiAddress, interfaceName, busName, objectPath, dbusProxyConnection, stubBase);
+}
+
+__attribute__((constructor)) void registerConsumerDBusStubAdapter(void) {
+ CommonAPI::DBus::DBusFactory::registerAdapterFactoryMethod(Consumer::getInterfaceId(),
+ &createConsumerDBusStubAdapter);
+}
+
+ConsumerDBusStubAdapter::ConsumerDBusStubAdapter(
+ const std::string& commonApiAddress,
+ const std::string& dbusInterfaceName,
+ const std::string& dbusBusName,
+ const std::string& dbusObjectPath,
+ const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection>& dbusConnection,
+ const std::shared_ptr<CommonAPI::StubBase>& stub):
+ ConsumerDBusStubAdapterHelper(commonApiAddress, dbusInterfaceName, dbusBusName, dbusObjectPath, dbusConnection, std::dynamic_pointer_cast<ConsumerStub>(stub)) {
+}
+
+const char* ConsumerDBusStubAdapter::getMethodsDBusIntrospectionXmlData() const {
+ return
+ "<method name=\"getRestartReasonAttribute\">\n"
+ "<arg name=\"value\" type=\"i\" direction=\"out\" />"
+ "</method>\n"
+ "<method name=\"setRestartReasonAttribute\">\n"
+ "<arg name=\"requestedValue\" type=\"i\" direction=\"in\" />\n"
+ "<arg name=\"setValue\" type=\"i\" direction=\"out\" />\n"
+ "</method>\n"
+ "<signal name=\"onRestartReasonAttributeChanged\">\n"
+ "<arg name=\"changedValue\" type=\"i\" />\n"
+ "</signal>\n"
+ "<method name=\"getShutdownReasonAttribute\">\n"
+ "<arg name=\"value\" type=\"i\" direction=\"out\" />"
+ "</method>\n"
+ "<method name=\"setShutdownReasonAttribute\">\n"
+ "<arg name=\"requestedValue\" type=\"i\" direction=\"in\" />\n"
+ "<arg name=\"setValue\" type=\"i\" direction=\"out\" />\n"
+ "</method>\n"
+ "<signal name=\"onShutdownReasonAttributeChanged\">\n"
+ "<arg name=\"changedValue\" type=\"i\" />\n"
+ "</signal>\n"
+ "<method name=\"getWakeUpReasonAttribute\">\n"
+ "<arg name=\"value\" type=\"i\" direction=\"out\" />"
+ "</method>\n"
+ "<method name=\"setWakeUpReasonAttribute\">\n"
+ "<arg name=\"requestedValue\" type=\"i\" direction=\"in\" />\n"
+ "<arg name=\"setValue\" type=\"i\" direction=\"out\" />\n"
+ "</method>\n"
+ "<signal name=\"onWakeUpReasonAttributeChanged\">\n"
+ "<arg name=\"changedValue\" type=\"i\" />\n"
+ "</signal>\n"
+ "<method name=\"getBootModeAttribute\">\n"
+ "<arg name=\"value\" type=\"i\" direction=\"out\" />"
+ "</method>\n"
+ "<method name=\"setBootModeAttribute\">\n"
+ "<arg name=\"requestedValue\" type=\"i\" direction=\"in\" />\n"
+ "<arg name=\"setValue\" type=\"i\" direction=\"out\" />\n"
+ "</method>\n"
+ "<signal name=\"onBootModeAttributeChanged\">\n"
+ "<arg name=\"changedValue\" type=\"i\" />\n"
+ "</signal>\n"
+ "<signal name=\"NodeState\">\n"
+ "<arg name=\"NodeState\" type=\"i\" />\n"
+ "</signal>\n"
+ "<signal name=\"NodeApplicationMode\">\n"
+ "<arg name=\"ApplicationModeId\" type=\"i\" />\n"
+ "</signal>\n"
+ "<signal name=\"SessionStateChanged\">\n"
+ "<arg name=\"SessionStateName\" type=\"s\" />\n"
+ "<arg name=\"SeatID\" type=\"i\" />\n"
+ "<arg name=\"SessionState\" type=\"i\" />\n"
+ "</signal>\n"
+ "<method name=\"GetNodeState\">\n"
+ "<arg name=\"NodeStateId\" type=\"i\" direction=\"out\" />\n"
+ "<arg name=\"ErrorCode\" type=\"i\" direction=\"out\" />\n"
+ "</method>\n"
+ "<method name=\"SetSessionState\">\n"
+ "<arg name=\"SessionName\" type=\"s\" direction=\"in\" />\n"
+ "<arg name=\"SessionOwner\" type=\"s\" direction=\"in\" />\n"
+ "<arg name=\"SeatID\" type=\"i\" direction=\"in\" />\n"
+ "<arg name=\"SessionState\" type=\"i\" direction=\"in\" />\n"
+ "<arg name=\"ErrorCode\" type=\"i\" direction=\"out\" />\n"
+ "</method>\n"
+ "<method name=\"GetSessionState\">\n"
+ "<arg name=\"SessionName\" type=\"s\" direction=\"in\" />\n"
+ "<arg name=\"SeatID\" type=\"i\" direction=\"in\" />\n"
+ "<arg name=\"SessionState\" type=\"i\" direction=\"out\" />\n"
+ "<arg name=\"ErrorCode\" type=\"i\" direction=\"out\" />\n"
+ "</method>\n"
+ "<method name=\"GetApplicationMode\">\n"
+ "<arg name=\"ApplicationModeId\" type=\"i\" direction=\"out\" />\n"
+ "<arg name=\"ErrorCode\" type=\"i\" direction=\"out\" />\n"
+ "</method>\n"
+ "<method name=\"RegisterShutdownClient\">\n"
+ "<arg name=\"BusName\" type=\"s\" direction=\"in\" />\n"
+ "<arg name=\"ObjName\" type=\"s\" direction=\"in\" />\n"
+ "<arg name=\"ShutdownMode\" type=\"u\" direction=\"in\" />\n"
+ "<arg name=\"TimeoutMs\" type=\"u\" direction=\"in\" />\n"
+ "<arg name=\"ErrorCode\" type=\"i\" direction=\"out\" />\n"
+ "</method>\n"
+ "<method name=\"UnRegisterShutdownClient\">\n"
+ "<arg name=\"BusName\" type=\"s\" direction=\"in\" />\n"
+ "<arg name=\"ObjName\" type=\"s\" direction=\"in\" />\n"
+ "<arg name=\"ShutdownMode\" type=\"u\" direction=\"in\" />\n"
+ "<arg name=\"ErrorCode\" type=\"i\" direction=\"out\" />\n"
+ "</method>\n"
+ "<method name=\"RegisterSession\">\n"
+ "<arg name=\"SessionName\" type=\"s\" direction=\"in\" />\n"
+ "<arg name=\"SessionOwner\" type=\"s\" direction=\"in\" />\n"
+ "<arg name=\"SeatID\" type=\"i\" direction=\"in\" />\n"
+ "<arg name=\"SessionState\" type=\"i\" direction=\"in\" />\n"
+ "<arg name=\"ErrorCode\" type=\"i\" direction=\"out\" />\n"
+ "</method>\n"
+ "<method name=\"UnRegisterSession\">\n"
+ "<arg name=\"SessionName\" type=\"s\" direction=\"in\" />\n"
+ "<arg name=\"SessionOwner\" type=\"s\" direction=\"in\" />\n"
+ "<arg name=\"SeatID\" type=\"i\" direction=\"in\" />\n"
+ "<arg name=\"ErrorCode\" type=\"i\" direction=\"out\" />\n"
+ "</method>\n"
+ "<method name=\"GetAppHealthCount\">\n"
+ "<arg name=\"Count\" type=\"u\" direction=\"out\" />\n"
+ "</method>\n"
+ "<method name=\"GetInterfaceVersion\">\n"
+ "<arg name=\"Version\" type=\"u\" direction=\"out\" />\n"
+ "</method>\n"
+ "<method name=\"LifecycleRequestComplete\">\n"
+ "<arg name=\"RequestId\" type=\"u\" direction=\"in\" />\n"
+ "<arg name=\"Status\" type=\"i\" direction=\"in\" />\n"
+ "<arg name=\"ErrorCode\" type=\"i\" direction=\"out\" />\n"
+ "</method>\n"
+ ;
+}
+
+
+static CommonAPI::DBus::DBusGetAttributeStubDispatcher<
+ ConsumerStub,
+ int32_t
+ > getRestartReasonAttributeStubDispatcher(&ConsumerStub::getRestartReasonAttribute, "i");
+static CommonAPI::DBus::DBusSetObservableAttributeStubDispatcher<
+ ConsumerStub,
+ int32_t
+ > setRestartReasonAttributeStubDispatcher(
+ &ConsumerStub::getRestartReasonAttribute,
+ &ConsumerStubRemoteEvent::onRemoteSetRestartReasonAttribute,
+ &ConsumerStubRemoteEvent::onRemoteRestartReasonAttributeChanged,
+ &ConsumerStubAdapter::fireRestartReasonAttributeChanged,
+ "i");
+
+static CommonAPI::DBus::DBusGetAttributeStubDispatcher<
+ ConsumerStub,
+ int32_t
+ > getShutdownReasonAttributeStubDispatcher(&ConsumerStub::getShutdownReasonAttribute, "i");
+static CommonAPI::DBus::DBusSetObservableAttributeStubDispatcher<
+ ConsumerStub,
+ int32_t
+ > setShutdownReasonAttributeStubDispatcher(
+ &ConsumerStub::getShutdownReasonAttribute,
+ &ConsumerStubRemoteEvent::onRemoteSetShutdownReasonAttribute,
+ &ConsumerStubRemoteEvent::onRemoteShutdownReasonAttributeChanged,
+ &ConsumerStubAdapter::fireShutdownReasonAttributeChanged,
+ "i");
+
+static CommonAPI::DBus::DBusGetAttributeStubDispatcher<
+ ConsumerStub,
+ int32_t
+ > getWakeUpReasonAttributeStubDispatcher(&ConsumerStub::getWakeUpReasonAttribute, "i");
+static CommonAPI::DBus::DBusSetObservableAttributeStubDispatcher<
+ ConsumerStub,
+ int32_t
+ > setWakeUpReasonAttributeStubDispatcher(
+ &ConsumerStub::getWakeUpReasonAttribute,
+ &ConsumerStubRemoteEvent::onRemoteSetWakeUpReasonAttribute,
+ &ConsumerStubRemoteEvent::onRemoteWakeUpReasonAttributeChanged,
+ &ConsumerStubAdapter::fireWakeUpReasonAttributeChanged,
+ "i");
+
+static CommonAPI::DBus::DBusGetAttributeStubDispatcher<
+ ConsumerStub,
+ int32_t
+ > getBootModeAttributeStubDispatcher(&ConsumerStub::getBootModeAttribute, "i");
+static CommonAPI::DBus::DBusSetObservableAttributeStubDispatcher<
+ ConsumerStub,
+ int32_t
+ > setBootModeAttributeStubDispatcher(
+ &ConsumerStub::getBootModeAttribute,
+ &ConsumerStubRemoteEvent::onRemoteSetBootModeAttribute,
+ &ConsumerStubRemoteEvent::onRemoteBootModeAttributeChanged,
+ &ConsumerStubAdapter::fireBootModeAttributeChanged,
+ "i");
+
+
+static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher<
+ ConsumerStub,
+ std::tuple<>,
+ std::tuple<int32_t, int32_t>
+ > getNodeStateStubDispatcher(&ConsumerStub::GetNodeState, "ii");
+static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher<
+ ConsumerStub,
+ std::tuple<std::string, std::string, int32_t, int32_t>,
+ std::tuple<int32_t>
+ > setSessionStateStubDispatcher(&ConsumerStub::SetSessionState, "i");
+static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher<
+ ConsumerStub,
+ std::tuple<std::string, int32_t>,
+ std::tuple<int32_t, int32_t>
+ > getSessionStateStubDispatcher(&ConsumerStub::GetSessionState, "ii");
+static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher<
+ ConsumerStub,
+ std::tuple<>,
+ std::tuple<int32_t, int32_t>
+ > getApplicationModeStubDispatcher(&ConsumerStub::GetApplicationMode, "ii");
+static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher<
+ ConsumerStub,
+ std::tuple<std::string, std::string, uint32_t, uint32_t>,
+ std::tuple<int32_t>
+ > registerShutdownClientStubDispatcher(&ConsumerStub::RegisterShutdownClient, "i");
+static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher<
+ ConsumerStub,
+ std::tuple<std::string, std::string, uint32_t>,
+ std::tuple<int32_t>
+ > unRegisterShutdownClientStubDispatcher(&ConsumerStub::UnRegisterShutdownClient, "i");
+static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher<
+ ConsumerStub,
+ std::tuple<std::string, std::string, int32_t, int32_t>,
+ std::tuple<int32_t>
+ > registerSessionStubDispatcher(&ConsumerStub::RegisterSession, "i");
+static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher<
+ ConsumerStub,
+ std::tuple<std::string, std::string, int32_t>,
+ std::tuple<int32_t>
+ > unRegisterSessionStubDispatcher(&ConsumerStub::UnRegisterSession, "i");
+static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher<
+ ConsumerStub,
+ std::tuple<>,
+ std::tuple<uint32_t>
+ > getAppHealthCountStubDispatcher(&ConsumerStub::GetAppHealthCount, "u");
+static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher<
+ ConsumerStub,
+ std::tuple<>,
+ std::tuple<uint32_t>
+ > getInterfaceVersionStubDispatcher(&ConsumerStub::GetInterfaceVersion, "u");
+static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher<
+ ConsumerStub,
+ std::tuple<uint32_t, int32_t>,
+ std::tuple<int32_t>
+ > lifecycleRequestCompleteStubDispatcher(&ConsumerStub::LifecycleRequestComplete, "i");
+
+void ConsumerDBusStubAdapter::fireRestartReasonAttributeChanged(const int32_t& value) {
+ CommonAPI::DBus::DBusStubSignalHelper<CommonAPI::DBus::DBusSerializableArguments<int32_t>>
+ ::sendSignal(
+ *this,
+ "onRestartReasonAttributeChanged",
+ "i",
+ value
+ );
+}
+void ConsumerDBusStubAdapter::fireShutdownReasonAttributeChanged(const int32_t& value) {
+ CommonAPI::DBus::DBusStubSignalHelper<CommonAPI::DBus::DBusSerializableArguments<int32_t>>
+ ::sendSignal(
+ *this,
+ "onShutdownReasonAttributeChanged",
+ "i",
+ value
+ );
+}
+void ConsumerDBusStubAdapter::fireWakeUpReasonAttributeChanged(const int32_t& value) {
+ CommonAPI::DBus::DBusStubSignalHelper<CommonAPI::DBus::DBusSerializableArguments<int32_t>>
+ ::sendSignal(
+ *this,
+ "onWakeUpReasonAttributeChanged",
+ "i",
+ value
+ );
+}
+void ConsumerDBusStubAdapter::fireBootModeAttributeChanged(const int32_t& value) {
+ CommonAPI::DBus::DBusStubSignalHelper<CommonAPI::DBus::DBusSerializableArguments<int32_t>>
+ ::sendSignal(
+ *this,
+ "onBootModeAttributeChanged",
+ "i",
+ value
+ );
+}
+
+void ConsumerDBusStubAdapter::fireNodeStateEvent(const int32_t& NodeState) {
+ CommonAPI::DBus::DBusStubSignalHelper<CommonAPI::DBus::DBusSerializableArguments<int32_t>>
+ ::sendSignal(
+ *this,
+ "NodeState",
+ "i",
+ NodeState
+ );
+}
+void ConsumerDBusStubAdapter::fireNodeApplicationModeEvent(const int32_t& ApplicationModeId) {
+ CommonAPI::DBus::DBusStubSignalHelper<CommonAPI::DBus::DBusSerializableArguments<int32_t>>
+ ::sendSignal(
+ *this,
+ "NodeApplicationMode",
+ "i",
+ ApplicationModeId
+ );
+}
+void ConsumerDBusStubAdapter::fireSessionStateChangedEvent(const std::string& SessionStateName, const int32_t& SeatID, const int32_t& SessionState) {
+ CommonAPI::DBus::DBusStubSignalHelper<CommonAPI::DBus::DBusSerializableArguments<std::string, int32_t, int32_t>>
+ ::sendSignal(
+ *this,
+ "SessionStateChanged",
+ "sii",
+ SessionStateName, SeatID, SessionState
+ );
+}
+
+} // namespace Consumer
+} // namespace NodeStateManager
+} // namespace genivi
+} // namespace org
+
+template<>
+const org::genivi::NodeStateManager::Consumer::ConsumerDBusStubAdapterHelper::StubDispatcherTable org::genivi::NodeStateManager::Consumer::ConsumerDBusStubAdapterHelper::stubDispatcherTable_ = {
+ { { "getRestartReasonAttribute", "" }, &org::genivi::NodeStateManager::Consumer::getRestartReasonAttributeStubDispatcher }
+ , { { "setRestartReasonAttribute", "i" }, &org::genivi::NodeStateManager::Consumer::setRestartReasonAttributeStubDispatcher },
+ { { "getShutdownReasonAttribute", "" }, &org::genivi::NodeStateManager::Consumer::getShutdownReasonAttributeStubDispatcher }
+ , { { "setShutdownReasonAttribute", "i" }, &org::genivi::NodeStateManager::Consumer::setShutdownReasonAttributeStubDispatcher },
+ { { "getWakeUpReasonAttribute", "" }, &org::genivi::NodeStateManager::Consumer::getWakeUpReasonAttributeStubDispatcher }
+ , { { "setWakeUpReasonAttribute", "i" }, &org::genivi::NodeStateManager::Consumer::setWakeUpReasonAttributeStubDispatcher },
+ { { "getBootModeAttribute", "" }, &org::genivi::NodeStateManager::Consumer::getBootModeAttributeStubDispatcher }
+ , { { "setBootModeAttribute", "i" }, &org::genivi::NodeStateManager::Consumer::setBootModeAttributeStubDispatcher }
+ ,
+ { { "GetNodeState", "" }, &org::genivi::NodeStateManager::Consumer::getNodeStateStubDispatcher },
+ { { "SetSessionState", "ssii" }, &org::genivi::NodeStateManager::Consumer::setSessionStateStubDispatcher },
+ { { "GetSessionState", "si" }, &org::genivi::NodeStateManager::Consumer::getSessionStateStubDispatcher },
+ { { "GetApplicationMode", "" }, &org::genivi::NodeStateManager::Consumer::getApplicationModeStubDispatcher },
+ { { "RegisterShutdownClient", "ssuu" }, &org::genivi::NodeStateManager::Consumer::registerShutdownClientStubDispatcher },
+ { { "UnRegisterShutdownClient", "ssu" }, &org::genivi::NodeStateManager::Consumer::unRegisterShutdownClientStubDispatcher },
+ { { "RegisterSession", "ssii" }, &org::genivi::NodeStateManager::Consumer::registerSessionStubDispatcher },
+ { { "UnRegisterSession", "ssi" }, &org::genivi::NodeStateManager::Consumer::unRegisterSessionStubDispatcher },
+ { { "GetAppHealthCount", "" }, &org::genivi::NodeStateManager::Consumer::getAppHealthCountStubDispatcher },
+ { { "GetInterfaceVersion", "" }, &org::genivi::NodeStateManager::Consumer::getInterfaceVersionStubDispatcher },
+ { { "LifecycleRequestComplete", "ui" }, &org::genivi::NodeStateManager::Consumer::lifecycleRequestCompleteStubDispatcher }
+};
diff --git a/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerDBusStubAdapter.h b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerDBusStubAdapter.h
new file mode 100644
index 0000000..8b43c21
--- /dev/null
+++ b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerDBusStubAdapter.h
@@ -0,0 +1,68 @@
+/*
+* This file was generated by the CommonAPI Generators.
+*
+ * 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/.
+*/
+#ifndef ORG_GENIVI_NODESTATEMANAGER_CONSUMER_Consumer_DBUS_STUB_ADAPTER_H_
+#define ORG_GENIVI_NODESTATEMANAGER_CONSUMER_Consumer_DBUS_STUB_ADAPTER_H_
+
+#include <org/genivi/NodeStateManager/Consumer/ConsumerStub.h>
+
+#define COMMONAPI_INTERNAL_COMPILATION
+
+#include <CommonAPI/DBus/DBusStubAdapterHelper.h>
+#include <CommonAPI/DBus/DBusFactory.h>
+
+#undef COMMONAPI_INTERNAL_COMPILATION
+
+namespace org {
+namespace genivi {
+namespace NodeStateManager {
+namespace Consumer {
+
+typedef CommonAPI::DBus::DBusStubAdapterHelper<ConsumerStub> ConsumerDBusStubAdapterHelper;
+
+class ConsumerDBusStubAdapter: public ConsumerStubAdapter, public ConsumerDBusStubAdapterHelper {
+ public:
+ ConsumerDBusStubAdapter(
+ const std::string& commonApiAddress,
+ const std::string& dbusInterfaceName,
+ const std::string& dbusBusName,
+ const std::string& dbusObjectPath,
+ const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection>& dbusConnection,
+ const std::shared_ptr<CommonAPI::StubBase>& stub);
+
+ void fireRestartReasonAttributeChanged(const int32_t& value);
+ void fireShutdownReasonAttributeChanged(const int32_t& value);
+ void fireWakeUpReasonAttributeChanged(const int32_t& value);
+ void fireBootModeAttributeChanged(const int32_t& value);
+
+ void fireNodeStateEvent(const int32_t& NodeState);
+ void fireNodeApplicationModeEvent(const int32_t& ApplicationModeId);
+ void fireSessionStateChangedEvent(const std::string& SessionStateName, const int32_t& SeatID, const int32_t& SessionState);
+
+ protected:
+ virtual const char* getMethodsDBusIntrospectionXmlData() const;
+};
+
+} // namespace Consumer
+} // namespace NodeStateManager
+} // namespace genivi
+} // namespace org
+
+#endif // ORG_GENIVI_NODESTATEMANAGER_CONSUMER_Consumer_DBUS_STUB_ADAPTER_H_
diff --git a/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerProxy.h b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerProxy.h
new file mode 100644
index 0000000..273fa8b
--- /dev/null
+++ b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerProxy.h
@@ -0,0 +1,619 @@
+/*
+* This file was generated by the CommonAPI Generators.
+*
+ * 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/.
+*/
+#ifndef ORG_GENIVI_NODESTATEMANAGER_CONSUMER_Consumer_PROXY_H_
+#define ORG_GENIVI_NODESTATEMANAGER_CONSUMER_Consumer_PROXY_H_
+
+#include "ConsumerProxyBase.h"
+
+#define COMMONAPI_INTERNAL_COMPILATION
+
+#include <CommonAPI/AttributeExtension.h>
+#include <CommonAPI/Factory.h>
+
+#undef COMMONAPI_INTERNAL_COMPILATION
+
+namespace org {
+namespace genivi {
+namespace NodeStateManager {
+namespace Consumer {
+
+template <typename ... _AttributeExtensions>
+class ConsumerProxy: virtual public Consumer, virtual public ConsumerProxyBase, public _AttributeExtensions... {
+ public:
+ ConsumerProxy(std::shared_ptr<CommonAPI::Proxy> delegate);
+ ~ConsumerProxy();
+
+ /// Returns the wrapper class that provides access to the attribute RestartReason.
+ virtual RestartReasonAttribute& getRestartReasonAttribute() {
+ return delegate_->getRestartReasonAttribute();
+ }
+
+ /// Returns the wrapper class that provides access to the attribute ShutdownReason.
+ virtual ShutdownReasonAttribute& getShutdownReasonAttribute() {
+ return delegate_->getShutdownReasonAttribute();
+ }
+
+ /// Returns the wrapper class that provides access to the attribute WakeUpReason.
+ virtual WakeUpReasonAttribute& getWakeUpReasonAttribute() {
+ return delegate_->getWakeUpReasonAttribute();
+ }
+
+ /// Returns the wrapper class that provides access to the attribute BootMode.
+ virtual BootModeAttribute& getBootModeAttribute() {
+ return delegate_->getBootModeAttribute();
+ }
+
+
+ /// Returns the wrapper class that provides access to the broadcast NodeState.
+ virtual NodeStateEvent& getNodeStateEvent() {
+ return delegate_->getNodeStateEvent();
+ }
+
+ /// Returns the wrapper class that provides access to the broadcast NodeApplicationMode.
+ virtual NodeApplicationModeEvent& getNodeApplicationModeEvent() {
+ return delegate_->getNodeApplicationModeEvent();
+ }
+
+ /// Returns the wrapper class that provides access to the broadcast SessionStateChanged.
+ virtual SessionStateChangedEvent& getSessionStateChangedEvent() {
+ return delegate_->getSessionStateChangedEvent();
+ }
+
+
+
+ /**
+ * Calls GetNodeState with synchronous semantics.
+ *
+ * All non-const parameters will be filled with the returned values.
+ * The CallStatus will be filled when the method returns and indicate either
+ * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus
+ * will be set.
+ * Synchronous calls are not supported (will block indefinitely) when mainloop integration is used.
+ */
+ virtual void GetNodeState(CommonAPI::CallStatus& callStatus, int32_t& NodeStateId, int32_t& ErrorCode);
+ /**
+ * Calls GetNodeState with asynchronous semantics.
+ *
+ * The provided callback will be called when the reply to this call arrives or
+ * an error occurs during the call. The CallStatus will indicate either "SUCCESS"
+ * or which type of error has occurred. In case of any error, ONLY the CallStatus
+ * will have a defined value.
+ * The std::future returned by this method will be fulfilled at arrival of the reply.
+ * It will provide the same value for CallStatus as will be handed to the callback.
+ */
+ virtual std::future<CommonAPI::CallStatus> GetNodeStateAsync(GetNodeStateAsyncCallback callback);
+
+ /**
+ * Calls SetSessionState with synchronous semantics.
+ *
+ * All const parameters are input parameters to this method.
+ * All non-const parameters will be filled with the returned values.
+ * The CallStatus will be filled when the method returns and indicate either
+ * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus
+ * will be set.
+ * Synchronous calls are not supported (will block indefinitely) when mainloop integration is used.
+ */
+ virtual void SetSessionState(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, const int32_t& SessionState, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode);
+ /**
+ * Calls SetSessionState with asynchronous semantics.
+ *
+ * The provided callback will be called when the reply to this call arrives or
+ * an error occurs during the call. The CallStatus will indicate either "SUCCESS"
+ * or which type of error has occurred. In case of any error, ONLY the CallStatus
+ * will have a defined value.
+ * The std::future returned by this method will be fulfilled at arrival of the reply.
+ * It will provide the same value for CallStatus as will be handed to the callback.
+ */
+ virtual std::future<CommonAPI::CallStatus> SetSessionStateAsync(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, const int32_t& SessionState, SetSessionStateAsyncCallback callback);
+
+ /**
+ * Calls GetSessionState with synchronous semantics.
+ *
+ * All const parameters are input parameters to this method.
+ * All non-const parameters will be filled with the returned values.
+ * The CallStatus will be filled when the method returns and indicate either
+ * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus
+ * will be set.
+ * Synchronous calls are not supported (will block indefinitely) when mainloop integration is used.
+ */
+ virtual void GetSessionState(const std::string& SessionName, const int32_t& SeatID, CommonAPI::CallStatus& callStatus, int32_t& SessionState, int32_t& ErrorCode);
+ /**
+ * Calls GetSessionState with asynchronous semantics.
+ *
+ * The provided callback will be called when the reply to this call arrives or
+ * an error occurs during the call. The CallStatus will indicate either "SUCCESS"
+ * or which type of error has occurred. In case of any error, ONLY the CallStatus
+ * will have a defined value.
+ * The std::future returned by this method will be fulfilled at arrival of the reply.
+ * It will provide the same value for CallStatus as will be handed to the callback.
+ */
+ virtual std::future<CommonAPI::CallStatus> GetSessionStateAsync(const std::string& SessionName, const int32_t& SeatID, GetSessionStateAsyncCallback callback);
+
+ /**
+ * Calls GetApplicationMode with synchronous semantics.
+ *
+ * All non-const parameters will be filled with the returned values.
+ * The CallStatus will be filled when the method returns and indicate either
+ * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus
+ * will be set.
+ * Synchronous calls are not supported (will block indefinitely) when mainloop integration is used.
+ */
+ virtual void GetApplicationMode(CommonAPI::CallStatus& callStatus, int32_t& ApplicationModeId, int32_t& ErrorCode);
+ /**
+ * Calls GetApplicationMode with asynchronous semantics.
+ *
+ * The provided callback will be called when the reply to this call arrives or
+ * an error occurs during the call. The CallStatus will indicate either "SUCCESS"
+ * or which type of error has occurred. In case of any error, ONLY the CallStatus
+ * will have a defined value.
+ * The std::future returned by this method will be fulfilled at arrival of the reply.
+ * It will provide the same value for CallStatus as will be handed to the callback.
+ */
+ virtual std::future<CommonAPI::CallStatus> GetApplicationModeAsync(GetApplicationModeAsyncCallback callback);
+
+ /**
+ * Calls RegisterShutdownClient with synchronous semantics.
+ *
+ * All const parameters are input parameters to this method.
+ * All non-const parameters will be filled with the returned values.
+ * The CallStatus will be filled when the method returns and indicate either
+ * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus
+ * will be set.
+ * Synchronous calls are not supported (will block indefinitely) when mainloop integration is used.
+ */
+ virtual void RegisterShutdownClient(const std::string& BusName, const std::string& ObjName, const uint32_t& ShutdownMode, const uint32_t& TimeoutMs, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode);
+ /**
+ * Calls RegisterShutdownClient with asynchronous semantics.
+ *
+ * The provided callback will be called when the reply to this call arrives or
+ * an error occurs during the call. The CallStatus will indicate either "SUCCESS"
+ * or which type of error has occurred. In case of any error, ONLY the CallStatus
+ * will have a defined value.
+ * The std::future returned by this method will be fulfilled at arrival of the reply.
+ * It will provide the same value for CallStatus as will be handed to the callback.
+ */
+ virtual std::future<CommonAPI::CallStatus> RegisterShutdownClientAsync(const std::string& BusName, const std::string& ObjName, const uint32_t& ShutdownMode, const uint32_t& TimeoutMs, RegisterShutdownClientAsyncCallback callback);
+
+ /**
+ * Calls UnRegisterShutdownClient with synchronous semantics.
+ *
+ * All const parameters are input parameters to this method.
+ * All non-const parameters will be filled with the returned values.
+ * The CallStatus will be filled when the method returns and indicate either
+ * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus
+ * will be set.
+ * Synchronous calls are not supported (will block indefinitely) when mainloop integration is used.
+ */
+ virtual void UnRegisterShutdownClient(const std::string& BusName, const std::string& ObjName, const uint32_t& ShutdownMode, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode);
+ /**
+ * Calls UnRegisterShutdownClient with asynchronous semantics.
+ *
+ * The provided callback will be called when the reply to this call arrives or
+ * an error occurs during the call. The CallStatus will indicate either "SUCCESS"
+ * or which type of error has occurred. In case of any error, ONLY the CallStatus
+ * will have a defined value.
+ * The std::future returned by this method will be fulfilled at arrival of the reply.
+ * It will provide the same value for CallStatus as will be handed to the callback.
+ */
+ virtual std::future<CommonAPI::CallStatus> UnRegisterShutdownClientAsync(const std::string& BusName, const std::string& ObjName, const uint32_t& ShutdownMode, UnRegisterShutdownClientAsyncCallback callback);
+
+ /**
+ * Calls RegisterSession with synchronous semantics.
+ *
+ * All const parameters are input parameters to this method.
+ * All non-const parameters will be filled with the returned values.
+ * The CallStatus will be filled when the method returns and indicate either
+ * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus
+ * will be set.
+ * Synchronous calls are not supported (will block indefinitely) when mainloop integration is used.
+ */
+ virtual void RegisterSession(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, const int32_t& SessionState, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode);
+ /**
+ * Calls RegisterSession with asynchronous semantics.
+ *
+ * The provided callback will be called when the reply to this call arrives or
+ * an error occurs during the call. The CallStatus will indicate either "SUCCESS"
+ * or which type of error has occurred. In case of any error, ONLY the CallStatus
+ * will have a defined value.
+ * The std::future returned by this method will be fulfilled at arrival of the reply.
+ * It will provide the same value for CallStatus as will be handed to the callback.
+ */
+ virtual std::future<CommonAPI::CallStatus> RegisterSessionAsync(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, const int32_t& SessionState, RegisterSessionAsyncCallback callback);
+
+ /**
+ * Calls UnRegisterSession with synchronous semantics.
+ *
+ * All const parameters are input parameters to this method.
+ * All non-const parameters will be filled with the returned values.
+ * The CallStatus will be filled when the method returns and indicate either
+ * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus
+ * will be set.
+ * Synchronous calls are not supported (will block indefinitely) when mainloop integration is used.
+ */
+ virtual void UnRegisterSession(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode);
+ /**
+ * Calls UnRegisterSession with asynchronous semantics.
+ *
+ * The provided callback will be called when the reply to this call arrives or
+ * an error occurs during the call. The CallStatus will indicate either "SUCCESS"
+ * or which type of error has occurred. In case of any error, ONLY the CallStatus
+ * will have a defined value.
+ * The std::future returned by this method will be fulfilled at arrival of the reply.
+ * It will provide the same value for CallStatus as will be handed to the callback.
+ */
+ virtual std::future<CommonAPI::CallStatus> UnRegisterSessionAsync(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, UnRegisterSessionAsyncCallback callback);
+
+ /**
+ * Calls GetAppHealthCount with synchronous semantics.
+ *
+ * All non-const parameters will be filled with the returned values.
+ * The CallStatus will be filled when the method returns and indicate either
+ * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus
+ * will be set.
+ * Synchronous calls are not supported (will block indefinitely) when mainloop integration is used.
+ */
+ virtual void GetAppHealthCount(CommonAPI::CallStatus& callStatus, uint32_t& Count);
+ /**
+ * Calls GetAppHealthCount with asynchronous semantics.
+ *
+ * The provided callback will be called when the reply to this call arrives or
+ * an error occurs during the call. The CallStatus will indicate either "SUCCESS"
+ * or which type of error has occurred. In case of any error, ONLY the CallStatus
+ * will have a defined value.
+ * The std::future returned by this method will be fulfilled at arrival of the reply.
+ * It will provide the same value for CallStatus as will be handed to the callback.
+ */
+ virtual std::future<CommonAPI::CallStatus> GetAppHealthCountAsync(GetAppHealthCountAsyncCallback callback);
+
+ /**
+ * Calls GetInterfaceVersion with synchronous semantics.
+ *
+ * All non-const parameters will be filled with the returned values.
+ * The CallStatus will be filled when the method returns and indicate either
+ * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus
+ * will be set.
+ * Synchronous calls are not supported (will block indefinitely) when mainloop integration is used.
+ */
+ virtual void GetInterfaceVersion(CommonAPI::CallStatus& callStatus, uint32_t& Version);
+ /**
+ * Calls GetInterfaceVersion with asynchronous semantics.
+ *
+ * The provided callback will be called when the reply to this call arrives or
+ * an error occurs during the call. The CallStatus will indicate either "SUCCESS"
+ * or which type of error has occurred. In case of any error, ONLY the CallStatus
+ * will have a defined value.
+ * The std::future returned by this method will be fulfilled at arrival of the reply.
+ * It will provide the same value for CallStatus as will be handed to the callback.
+ */
+ virtual std::future<CommonAPI::CallStatus> GetInterfaceVersionAsync(GetInterfaceVersionAsyncCallback callback);
+
+ /**
+ * Calls LifecycleRequestComplete with synchronous semantics.
+ *
+ * All const parameters are input parameters to this method.
+ * All non-const parameters will be filled with the returned values.
+ * The CallStatus will be filled when the method returns and indicate either
+ * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus
+ * will be set.
+ * Synchronous calls are not supported (will block indefinitely) when mainloop integration is used.
+ */
+ virtual void LifecycleRequestComplete(const uint32_t& RequestId, const int32_t& Status, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode);
+ /**
+ * Calls LifecycleRequestComplete with asynchronous semantics.
+ *
+ * The provided callback will be called when the reply to this call arrives or
+ * an error occurs during the call. The CallStatus will indicate either "SUCCESS"
+ * or which type of error has occurred. In case of any error, ONLY the CallStatus
+ * will have a defined value.
+ * The std::future returned by this method will be fulfilled at arrival of the reply.
+ * It will provide the same value for CallStatus as will be handed to the callback.
+ */
+ virtual std::future<CommonAPI::CallStatus> LifecycleRequestCompleteAsync(const uint32_t& RequestId, const int32_t& Status, LifecycleRequestCompleteAsyncCallback callback);
+
+ /// Returns the CommonAPI address of the remote partner this proxy communicates with.
+ virtual std::string getAddress() const;
+
+ /// Returns the domain of the remote partner this proxy communicates with.
+ virtual const std::string& getDomain() const;
+
+ /// Returns the service ID of the remote partner this proxy communicates with.
+ virtual const std::string& getServiceId() const;
+
+ /// Returns the instance ID of the remote partner this proxy communicates with.
+ virtual const std::string& getInstanceId() const;
+
+ /// Returns true if the remote partner for this proxy is available.
+ virtual bool isAvailable() const;
+
+ /**
+ * Returns the wrapper class that is used to (de-)register for notifications about
+ * the availability of the remote partner of this proxy.
+ */
+ virtual CommonAPI::ProxyStatusEvent& getProxyStatusEvent();
+
+ /**
+ * Returns the wrapper class that is used to access version information of the remote
+ * partner of this proxy.
+ */
+ virtual CommonAPI::InterfaceVersionAttribute& getInterfaceVersionAttribute();
+
+ private:
+ std::shared_ptr<ConsumerProxyBase> delegate_;
+};
+
+namespace ConsumerExtensions {
+ template <template <typename > class _ExtensionType>
+ class RestartReasonAttributeExtension {
+ public:
+ typedef _ExtensionType<ConsumerProxyBase::RestartReasonAttribute> extension_type;
+
+ static_assert(std::is_base_of<typename CommonAPI::AttributeExtension<ConsumerProxyBase::RestartReasonAttribute>, extension_type>::value,
+ "Not CommonAPI Attribute Extension!");
+
+ RestartReasonAttributeExtension(ConsumerProxyBase& proxy): attributeExtension_(proxy.getRestartReasonAttribute()) {
+ }
+
+ inline extension_type& getRestartReasonAttributeExtension() {
+ return attributeExtension_;
+ }
+
+ private:
+ extension_type attributeExtension_;
+ };
+
+ template <template <typename > class _ExtensionType>
+ class ShutdownReasonAttributeExtension {
+ public:
+ typedef _ExtensionType<ConsumerProxyBase::ShutdownReasonAttribute> extension_type;
+
+ static_assert(std::is_base_of<typename CommonAPI::AttributeExtension<ConsumerProxyBase::ShutdownReasonAttribute>, extension_type>::value,
+ "Not CommonAPI Attribute Extension!");
+
+ ShutdownReasonAttributeExtension(ConsumerProxyBase& proxy): attributeExtension_(proxy.getShutdownReasonAttribute()) {
+ }
+
+ inline extension_type& getShutdownReasonAttributeExtension() {
+ return attributeExtension_;
+ }
+
+ private:
+ extension_type attributeExtension_;
+ };
+
+ template <template <typename > class _ExtensionType>
+ class WakeUpReasonAttributeExtension {
+ public:
+ typedef _ExtensionType<ConsumerProxyBase::WakeUpReasonAttribute> extension_type;
+
+ static_assert(std::is_base_of<typename CommonAPI::AttributeExtension<ConsumerProxyBase::WakeUpReasonAttribute>, extension_type>::value,
+ "Not CommonAPI Attribute Extension!");
+
+ WakeUpReasonAttributeExtension(ConsumerProxyBase& proxy): attributeExtension_(proxy.getWakeUpReasonAttribute()) {
+ }
+
+ inline extension_type& getWakeUpReasonAttributeExtension() {
+ return attributeExtension_;
+ }
+
+ private:
+ extension_type attributeExtension_;
+ };
+
+ template <template <typename > class _ExtensionType>
+ class BootModeAttributeExtension {
+ public:
+ typedef _ExtensionType<ConsumerProxyBase::BootModeAttribute> extension_type;
+
+ static_assert(std::is_base_of<typename CommonAPI::AttributeExtension<ConsumerProxyBase::BootModeAttribute>, extension_type>::value,
+ "Not CommonAPI Attribute Extension!");
+
+ BootModeAttributeExtension(ConsumerProxyBase& proxy): attributeExtension_(proxy.getBootModeAttribute()) {
+ }
+
+ inline extension_type& getBootModeAttributeExtension() {
+ return attributeExtension_;
+ }
+
+ private:
+ extension_type attributeExtension_;
+ };
+
+} // namespace ConsumerExtensions
+
+//
+// ConsumerProxy Implementation
+//
+template <typename ... _AttributeExtensions>
+ConsumerProxy<_AttributeExtensions...>::ConsumerProxy(std::shared_ptr<CommonAPI::Proxy> delegate):
+ delegate_(std::dynamic_pointer_cast<ConsumerProxyBase>(delegate)),
+ _AttributeExtensions(*(std::dynamic_pointer_cast<ConsumerProxyBase>(delegate)))... {
+}
+
+template <typename ... _AttributeExtensions>
+ConsumerProxy<_AttributeExtensions...>::~ConsumerProxy() {
+}
+
+template <typename ... _AttributeExtensions>
+void ConsumerProxy<_AttributeExtensions...>::GetNodeState(CommonAPI::CallStatus& callStatus, int32_t& NodeStateId, int32_t& ErrorCode) {
+ delegate_->GetNodeState(callStatus, NodeStateId, ErrorCode);
+}
+
+template <typename ... _AttributeExtensions>
+std::future<CommonAPI::CallStatus> ConsumerProxy<_AttributeExtensions...>::GetNodeStateAsync(GetNodeStateAsyncCallback callback) {
+ return delegate_->GetNodeStateAsync(callback);
+}
+
+template <typename ... _AttributeExtensions>
+void ConsumerProxy<_AttributeExtensions...>::SetSessionState(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, const int32_t& SessionState, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode) {
+ delegate_->SetSessionState(SessionName, SessionOwner, SeatID, SessionState, callStatus, ErrorCode);
+}
+
+template <typename ... _AttributeExtensions>
+std::future<CommonAPI::CallStatus> ConsumerProxy<_AttributeExtensions...>::SetSessionStateAsync(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, const int32_t& SessionState, SetSessionStateAsyncCallback callback) {
+ return delegate_->SetSessionStateAsync(SessionName, SessionOwner, SeatID, SessionState, callback);
+}
+
+template <typename ... _AttributeExtensions>
+void ConsumerProxy<_AttributeExtensions...>::GetSessionState(const std::string& SessionName, const int32_t& SeatID, CommonAPI::CallStatus& callStatus, int32_t& SessionState, int32_t& ErrorCode) {
+ delegate_->GetSessionState(SessionName, SeatID, callStatus, SessionState, ErrorCode);
+}
+
+template <typename ... _AttributeExtensions>
+std::future<CommonAPI::CallStatus> ConsumerProxy<_AttributeExtensions...>::GetSessionStateAsync(const std::string& SessionName, const int32_t& SeatID, GetSessionStateAsyncCallback callback) {
+ return delegate_->GetSessionStateAsync(SessionName, SeatID, callback);
+}
+
+template <typename ... _AttributeExtensions>
+void ConsumerProxy<_AttributeExtensions...>::GetApplicationMode(CommonAPI::CallStatus& callStatus, int32_t& ApplicationModeId, int32_t& ErrorCode) {
+ delegate_->GetApplicationMode(callStatus, ApplicationModeId, ErrorCode);
+}
+
+template <typename ... _AttributeExtensions>
+std::future<CommonAPI::CallStatus> ConsumerProxy<_AttributeExtensions...>::GetApplicationModeAsync(GetApplicationModeAsyncCallback callback) {
+ return delegate_->GetApplicationModeAsync(callback);
+}
+
+template <typename ... _AttributeExtensions>
+void ConsumerProxy<_AttributeExtensions...>::RegisterShutdownClient(const std::string& BusName, const std::string& ObjName, const uint32_t& ShutdownMode, const uint32_t& TimeoutMs, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode) {
+ delegate_->RegisterShutdownClient(BusName, ObjName, ShutdownMode, TimeoutMs, callStatus, ErrorCode);
+}
+
+template <typename ... _AttributeExtensions>
+std::future<CommonAPI::CallStatus> ConsumerProxy<_AttributeExtensions...>::RegisterShutdownClientAsync(const std::string& BusName, const std::string& ObjName, const uint32_t& ShutdownMode, const uint32_t& TimeoutMs, RegisterShutdownClientAsyncCallback callback) {
+ return delegate_->RegisterShutdownClientAsync(BusName, ObjName, ShutdownMode, TimeoutMs, callback);
+}
+
+template <typename ... _AttributeExtensions>
+void ConsumerProxy<_AttributeExtensions...>::UnRegisterShutdownClient(const std::string& BusName, const std::string& ObjName, const uint32_t& ShutdownMode, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode) {
+ delegate_->UnRegisterShutdownClient(BusName, ObjName, ShutdownMode, callStatus, ErrorCode);
+}
+
+template <typename ... _AttributeExtensions>
+std::future<CommonAPI::CallStatus> ConsumerProxy<_AttributeExtensions...>::UnRegisterShutdownClientAsync(const std::string& BusName, const std::string& ObjName, const uint32_t& ShutdownMode, UnRegisterShutdownClientAsyncCallback callback) {
+ return delegate_->UnRegisterShutdownClientAsync(BusName, ObjName, ShutdownMode, callback);
+}
+
+template <typename ... _AttributeExtensions>
+void ConsumerProxy<_AttributeExtensions...>::RegisterSession(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, const int32_t& SessionState, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode) {
+ delegate_->RegisterSession(SessionName, SessionOwner, SeatID, SessionState, callStatus, ErrorCode);
+}
+
+template <typename ... _AttributeExtensions>
+std::future<CommonAPI::CallStatus> ConsumerProxy<_AttributeExtensions...>::RegisterSessionAsync(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, const int32_t& SessionState, RegisterSessionAsyncCallback callback) {
+ return delegate_->RegisterSessionAsync(SessionName, SessionOwner, SeatID, SessionState, callback);
+}
+
+template <typename ... _AttributeExtensions>
+void ConsumerProxy<_AttributeExtensions...>::UnRegisterSession(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode) {
+ delegate_->UnRegisterSession(SessionName, SessionOwner, SeatID, callStatus, ErrorCode);
+}
+
+template <typename ... _AttributeExtensions>
+std::future<CommonAPI::CallStatus> ConsumerProxy<_AttributeExtensions...>::UnRegisterSessionAsync(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, UnRegisterSessionAsyncCallback callback) {
+ return delegate_->UnRegisterSessionAsync(SessionName, SessionOwner, SeatID, callback);
+}
+
+template <typename ... _AttributeExtensions>
+void ConsumerProxy<_AttributeExtensions...>::GetAppHealthCount(CommonAPI::CallStatus& callStatus, uint32_t& Count) {
+ delegate_->GetAppHealthCount(callStatus, Count);
+}
+
+template <typename ... _AttributeExtensions>
+std::future<CommonAPI::CallStatus> ConsumerProxy<_AttributeExtensions...>::GetAppHealthCountAsync(GetAppHealthCountAsyncCallback callback) {
+ return delegate_->GetAppHealthCountAsync(callback);
+}
+
+template <typename ... _AttributeExtensions>
+void ConsumerProxy<_AttributeExtensions...>::GetInterfaceVersion(CommonAPI::CallStatus& callStatus, uint32_t& Version) {
+ delegate_->GetInterfaceVersion(callStatus, Version);
+}
+
+template <typename ... _AttributeExtensions>
+std::future<CommonAPI::CallStatus> ConsumerProxy<_AttributeExtensions...>::GetInterfaceVersionAsync(GetInterfaceVersionAsyncCallback callback) {
+ return delegate_->GetInterfaceVersionAsync(callback);
+}
+
+template <typename ... _AttributeExtensions>
+void ConsumerProxy<_AttributeExtensions...>::LifecycleRequestComplete(const uint32_t& RequestId, const int32_t& Status, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode) {
+ delegate_->LifecycleRequestComplete(RequestId, Status, callStatus, ErrorCode);
+}
+
+template <typename ... _AttributeExtensions>
+std::future<CommonAPI::CallStatus> ConsumerProxy<_AttributeExtensions...>::LifecycleRequestCompleteAsync(const uint32_t& RequestId, const int32_t& Status, LifecycleRequestCompleteAsyncCallback callback) {
+ return delegate_->LifecycleRequestCompleteAsync(RequestId, Status, callback);
+}
+
+
+template <typename ... _AttributeExtensions>
+std::string ConsumerProxy<_AttributeExtensions...>::getAddress() const {
+ return delegate_->getAddress();
+}
+
+template <typename ... _AttributeExtensions>
+const std::string& ConsumerProxy<_AttributeExtensions...>::getDomain() const {
+ return delegate_->getDomain();
+}
+
+template <typename ... _AttributeExtensions>
+const std::string& ConsumerProxy<_AttributeExtensions...>::getServiceId() const {
+ return delegate_->getServiceId();
+}
+
+template <typename ... _AttributeExtensions>
+const std::string& ConsumerProxy<_AttributeExtensions...>::getInstanceId() const {
+ return delegate_->getInstanceId();
+}
+
+template <typename ... _AttributeExtensions>
+bool ConsumerProxy<_AttributeExtensions...>::isAvailable() const {
+ return delegate_->isAvailable();
+}
+
+template <typename ... _AttributeExtensions>
+CommonAPI::ProxyStatusEvent& ConsumerProxy<_AttributeExtensions...>::getProxyStatusEvent() {
+ return delegate_->getProxyStatusEvent();
+}
+
+template <typename ... _AttributeExtensions>
+CommonAPI::InterfaceVersionAttribute& ConsumerProxy<_AttributeExtensions...>::getInterfaceVersionAttribute() {
+ return delegate_->getInterfaceVersionAttribute();
+}
+
+} // namespace Consumer
+} // namespace NodeStateManager
+} // namespace genivi
+} // namespace org
+
+namespace CommonAPI {
+template<template<typename > class _AttributeExtension>
+struct DefaultAttributeProxyFactoryHelper<org::genivi::NodeStateManager::Consumer::ConsumerProxy,
+ _AttributeExtension> {
+ typedef typename org::genivi::NodeStateManager::Consumer::ConsumerProxy<
+ org::genivi::NodeStateManager::Consumer::ConsumerExtensions::RestartReasonAttributeExtension<_AttributeExtension>,
+ org::genivi::NodeStateManager::Consumer::ConsumerExtensions::ShutdownReasonAttributeExtension<_AttributeExtension>,
+ org::genivi::NodeStateManager::Consumer::ConsumerExtensions::WakeUpReasonAttributeExtension<_AttributeExtension>,
+ org::genivi::NodeStateManager::Consumer::ConsumerExtensions::BootModeAttributeExtension<_AttributeExtension>
+ > class_t;
+};
+}
+
+
+#endif // ORG_GENIVI_NODESTATEMANAGER_CONSUMER_Consumer_PROXY_H_
diff --git a/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerProxyBase.h b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerProxyBase.h
new file mode 100644
index 0000000..076f5cc
--- /dev/null
+++ b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerProxyBase.h
@@ -0,0 +1,114 @@
+ /*
+ * This file was generated by the CommonAPI Generators.
+ *
+ * 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/.
+ */
+ #ifndef ORG_GENIVI_NODESTATEMANAGER_CONSUMER_Consumer_PROXY_BASE_H_
+ #define ORG_GENIVI_NODESTATEMANAGER_CONSUMER_Consumer_PROXY_BASE_H_
+
+ #include "Consumer.h"
+
+
+
+ #define COMMONAPI_INTERNAL_COMPILATION
+
+
+ #include <CommonAPI/Attribute.h>
+ #include <CommonAPI/Event.h>
+ #include <CommonAPI/Proxy.h>
+ #include <functional>
+ #include <future>
+
+ #undef COMMONAPI_INTERNAL_COMPILATION
+
+ namespace org {
+ namespace genivi {
+ namespace NodeStateManager {
+ namespace Consumer {
+
+ class ConsumerProxyBase: virtual public CommonAPI::Proxy {
+ public:
+ typedef CommonAPI::ObservableAttribute<int32_t> RestartReasonAttribute;
+ typedef CommonAPI::ObservableAttribute<int32_t> ShutdownReasonAttribute;
+ typedef CommonAPI::ObservableAttribute<int32_t> WakeUpReasonAttribute;
+ typedef CommonAPI::ObservableAttribute<int32_t> BootModeAttribute;
+ typedef CommonAPI::Event<int32_t> NodeStateEvent;
+ typedef CommonAPI::Event<int32_t> NodeApplicationModeEvent;
+ typedef CommonAPI::Event<std::string, int32_t, int32_t> SessionStateChangedEvent;
+ typedef std::function<void(const CommonAPI::CallStatus&, const int32_t&, const int32_t&)> GetNodeStateAsyncCallback;
+ typedef std::function<void(const CommonAPI::CallStatus&, const int32_t&)> SetSessionStateAsyncCallback;
+ typedef std::function<void(const CommonAPI::CallStatus&, const int32_t&, const int32_t&)> GetSessionStateAsyncCallback;
+ typedef std::function<void(const CommonAPI::CallStatus&, const int32_t&, const int32_t&)> GetApplicationModeAsyncCallback;
+ typedef std::function<void(const CommonAPI::CallStatus&, const int32_t&)> RegisterShutdownClientAsyncCallback;
+ typedef std::function<void(const CommonAPI::CallStatus&, const int32_t&)> UnRegisterShutdownClientAsyncCallback;
+ typedef std::function<void(const CommonAPI::CallStatus&, const int32_t&)> RegisterSessionAsyncCallback;
+ typedef std::function<void(const CommonAPI::CallStatus&, const int32_t&)> UnRegisterSessionAsyncCallback;
+ typedef std::function<void(const CommonAPI::CallStatus&, const uint32_t&)> GetAppHealthCountAsyncCallback;
+ typedef std::function<void(const CommonAPI::CallStatus&, const uint32_t&)> GetInterfaceVersionAsyncCallback;
+ typedef std::function<void(const CommonAPI::CallStatus&, const int32_t&)> LifecycleRequestCompleteAsyncCallback;
+
+ virtual RestartReasonAttribute& getRestartReasonAttribute() = 0;
+ virtual ShutdownReasonAttribute& getShutdownReasonAttribute() = 0;
+ virtual WakeUpReasonAttribute& getWakeUpReasonAttribute() = 0;
+ virtual BootModeAttribute& getBootModeAttribute() = 0;
+
+ virtual NodeStateEvent& getNodeStateEvent() = 0;
+ virtual NodeApplicationModeEvent& getNodeApplicationModeEvent() = 0;
+ virtual SessionStateChangedEvent& getSessionStateChangedEvent() = 0;
+
+
+ virtual void GetNodeState(CommonAPI::CallStatus& callStatus, int32_t& NodeStateId, int32_t& ErrorCode) = 0;
+ virtual std::future<CommonAPI::CallStatus> GetNodeStateAsync(GetNodeStateAsyncCallback callback) = 0;
+
+ virtual void SetSessionState(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, const int32_t& SessionState, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode) = 0;
+ virtual std::future<CommonAPI::CallStatus> SetSessionStateAsync(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, const int32_t& SessionState, SetSessionStateAsyncCallback callback) = 0;
+
+ virtual void GetSessionState(const std::string& SessionName, const int32_t& SeatID, CommonAPI::CallStatus& callStatus, int32_t& SessionState, int32_t& ErrorCode) = 0;
+ virtual std::future<CommonAPI::CallStatus> GetSessionStateAsync(const std::string& SessionName, const int32_t& SeatID, GetSessionStateAsyncCallback callback) = 0;
+
+ virtual void GetApplicationMode(CommonAPI::CallStatus& callStatus, int32_t& ApplicationModeId, int32_t& ErrorCode) = 0;
+ virtual std::future<CommonAPI::CallStatus> GetApplicationModeAsync(GetApplicationModeAsyncCallback callback) = 0;
+
+ virtual void RegisterShutdownClient(const std::string& BusName, const std::string& ObjName, const uint32_t& ShutdownMode, const uint32_t& TimeoutMs, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode) = 0;
+ virtual std::future<CommonAPI::CallStatus> RegisterShutdownClientAsync(const std::string& BusName, const std::string& ObjName, const uint32_t& ShutdownMode, const uint32_t& TimeoutMs, RegisterShutdownClientAsyncCallback callback) = 0;
+
+ virtual void UnRegisterShutdownClient(const std::string& BusName, const std::string& ObjName, const uint32_t& ShutdownMode, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode) = 0;
+ virtual std::future<CommonAPI::CallStatus> UnRegisterShutdownClientAsync(const std::string& BusName, const std::string& ObjName, const uint32_t& ShutdownMode, UnRegisterShutdownClientAsyncCallback callback) = 0;
+
+ virtual void RegisterSession(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, const int32_t& SessionState, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode) = 0;
+ virtual std::future<CommonAPI::CallStatus> RegisterSessionAsync(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, const int32_t& SessionState, RegisterSessionAsyncCallback callback) = 0;
+
+ virtual void UnRegisterSession(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode) = 0;
+ virtual std::future<CommonAPI::CallStatus> UnRegisterSessionAsync(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, UnRegisterSessionAsyncCallback callback) = 0;
+
+ virtual void GetAppHealthCount(CommonAPI::CallStatus& callStatus, uint32_t& Count) = 0;
+ virtual std::future<CommonAPI::CallStatus> GetAppHealthCountAsync(GetAppHealthCountAsyncCallback callback) = 0;
+
+ virtual void GetInterfaceVersion(CommonAPI::CallStatus& callStatus, uint32_t& Version) = 0;
+ virtual std::future<CommonAPI::CallStatus> GetInterfaceVersionAsync(GetInterfaceVersionAsyncCallback callback) = 0;
+
+ virtual void LifecycleRequestComplete(const uint32_t& RequestId, const int32_t& Status, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode) = 0;
+ virtual std::future<CommonAPI::CallStatus> LifecycleRequestCompleteAsync(const uint32_t& RequestId, const int32_t& Status, LifecycleRequestCompleteAsyncCallback callback) = 0;
+ };
+
+ } // namespace Consumer
+ } // namespace NodeStateManager
+ } // namespace genivi
+ } // namespace org
+
+ #endif // ORG_GENIVI_NODESTATEMANAGER_CONSUMER_Consumer_PROXY_BASE_H_
diff --git a/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerStub.h b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerStub.h
new file mode 100644
index 0000000..02fc7ae
--- /dev/null
+++ b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerStub.h
@@ -0,0 +1,170 @@
+/*
+* This file was generated by the CommonAPI Generators.
+*
+ * 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/.
+*/
+#ifndef ORG_GENIVI_NODESTATEMANAGER_CONSUMER_Consumer_STUB_H_
+#define ORG_GENIVI_NODESTATEMANAGER_CONSUMER_Consumer_STUB_H_
+
+
+
+
+#include "Consumer.h"
+
+#define COMMONAPI_INTERNAL_COMPILATION
+
+
+#include <CommonAPI/Stub.h>
+
+#undef COMMONAPI_INTERNAL_COMPILATION
+
+namespace org {
+namespace genivi {
+namespace NodeStateManager {
+namespace Consumer {
+
+/**
+ * Receives messages from remote and handles all dispatching of deserialized calls
+ * to a stub for the service Consumer. Also provides means to send broadcasts
+ * and attribute-changed-notifications of observable attributes as defined by this service.
+ * An application developer should not need to bother with this class.
+ */
+class ConsumerStubAdapter: virtual public CommonAPI::StubAdapter, public Consumer {
+ public:
+ ///Notifies all remote listeners about a change of value of the attribute RestartReason.
+ virtual void fireRestartReasonAttributeChanged(const int32_t& RestartReason) = 0;
+ ///Notifies all remote listeners about a change of value of the attribute ShutdownReason.
+ virtual void fireShutdownReasonAttributeChanged(const int32_t& ShutdownReason) = 0;
+ ///Notifies all remote listeners about a change of value of the attribute WakeUpReason.
+ virtual void fireWakeUpReasonAttributeChanged(const int32_t& WakeUpReason) = 0;
+ ///Notifies all remote listeners about a change of value of the attribute BootMode.
+ virtual void fireBootModeAttributeChanged(const int32_t& BootMode) = 0;
+
+ /**
+ * Sends a broadcast event for NodeState. Should not be called directly.
+ * Instead, the "fire<broadcastName>Event" methods of the stub should be used.
+ */
+ virtual void fireNodeStateEvent(const int32_t& NodeState) = 0;
+ /**
+ * Sends a broadcast event for NodeApplicationMode. Should not be called directly.
+ * Instead, the "fire<broadcastName>Event" methods of the stub should be used.
+ */
+ virtual void fireNodeApplicationModeEvent(const int32_t& ApplicationModeId) = 0;
+ /**
+ * Sends a broadcast event for SessionStateChanged. Should not be called directly.
+ * Instead, the "fire<broadcastName>Event" methods of the stub should be used.
+ */
+ virtual void fireSessionStateChangedEvent(const std::string& SessionStateName, const int32_t& SeatID, const int32_t& SessionState) = 0;
+};
+
+
+/**
+ * Defines the necessary callbacks to handle remote set events related to the attributes
+ * defined in the IDL description for Consumer.
+ * For each attribute two callbacks are defined:
+ * - a verification callback that allows to verify the requested value and to prevent setting
+ * e.g. an invalid value ("onRemoteSet<AttributeName>").
+ * - an action callback to do local work after the attribute value has been changed
+ * ("onRemote<AttributeName>Changed").
+ *
+ * This class and the one below are the ones an application developer needs to have
+ * a look at if he wants to implement a service.
+ */
+class ConsumerStubRemoteEvent {
+ public:
+ virtual ~ConsumerStubRemoteEvent() { }
+
+ /// Verification callback for remote set requests on the attribute RestartReason.
+ virtual bool onRemoteSetRestartReasonAttribute(int32_t RestartReason) = 0;
+ /// Action callback for remote set requests on the attribute RestartReason.
+ virtual void onRemoteRestartReasonAttributeChanged() = 0;
+
+ /// Verification callback for remote set requests on the attribute ShutdownReason.
+ virtual bool onRemoteSetShutdownReasonAttribute(int32_t ShutdownReason) = 0;
+ /// Action callback for remote set requests on the attribute ShutdownReason.
+ virtual void onRemoteShutdownReasonAttributeChanged() = 0;
+
+ /// Verification callback for remote set requests on the attribute WakeUpReason.
+ virtual bool onRemoteSetWakeUpReasonAttribute(int32_t WakeUpReason) = 0;
+ /// Action callback for remote set requests on the attribute WakeUpReason.
+ virtual void onRemoteWakeUpReasonAttributeChanged() = 0;
+
+ /// Verification callback for remote set requests on the attribute BootMode.
+ virtual bool onRemoteSetBootModeAttribute(int32_t BootMode) = 0;
+ /// Action callback for remote set requests on the attribute BootMode.
+ virtual void onRemoteBootModeAttributeChanged() = 0;
+
+};
+
+
+/**
+ * Defines the interface that must be implemented by any class that should provide
+ * the service Consumer to remote clients.
+ * This class and the one above are the ones an application developer needs to have
+ * a look at if he wants to implement a service.
+ */
+class ConsumerStub : public CommonAPI::Stub<ConsumerStubAdapter , ConsumerStubRemoteEvent> {
+ public:
+ virtual ~ConsumerStub() { }
+
+ /// Provides getter access to the attribute RestartReason.
+ virtual const int32_t& getRestartReasonAttribute() = 0;
+ /// Provides getter access to the attribute ShutdownReason.
+ virtual const int32_t& getShutdownReasonAttribute() = 0;
+ /// Provides getter access to the attribute WakeUpReason.
+ virtual const int32_t& getWakeUpReasonAttribute() = 0;
+ /// Provides getter access to the attribute BootMode.
+ virtual const int32_t& getBootModeAttribute() = 0;
+
+ /// This is the method that will be called on remote calls on the method GetNodeState.
+ virtual void GetNodeState(int32_t& NodeStateId, int32_t& ErrorCode) = 0;
+ /// This is the method that will be called on remote calls on the method SetSessionState.
+ virtual void SetSessionState(std::string SessionName, std::string SessionOwner, int32_t SeatID, int32_t SessionState, int32_t& ErrorCode) = 0;
+ /// This is the method that will be called on remote calls on the method GetSessionState.
+ virtual void GetSessionState(std::string SessionName, int32_t SeatID, int32_t& SessionState, int32_t& ErrorCode) = 0;
+ /// This is the method that will be called on remote calls on the method GetApplicationMode.
+ virtual void GetApplicationMode(int32_t& ApplicationModeId, int32_t& ErrorCode) = 0;
+ /// This is the method that will be called on remote calls on the method RegisterShutdownClient.
+ virtual void RegisterShutdownClient(std::string BusName, std::string ObjName, uint32_t ShutdownMode, uint32_t TimeoutMs, int32_t& ErrorCode) = 0;
+ /// This is the method that will be called on remote calls on the method UnRegisterShutdownClient.
+ virtual void UnRegisterShutdownClient(std::string BusName, std::string ObjName, uint32_t ShutdownMode, int32_t& ErrorCode) = 0;
+ /// This is the method that will be called on remote calls on the method RegisterSession.
+ virtual void RegisterSession(std::string SessionName, std::string SessionOwner, int32_t SeatID, int32_t SessionState, int32_t& ErrorCode) = 0;
+ /// This is the method that will be called on remote calls on the method UnRegisterSession.
+ virtual void UnRegisterSession(std::string SessionName, std::string SessionOwner, int32_t SeatID, int32_t& ErrorCode) = 0;
+ /// This is the method that will be called on remote calls on the method GetAppHealthCount.
+ virtual void GetAppHealthCount(uint32_t& Count) = 0;
+ /// This is the method that will be called on remote calls on the method GetInterfaceVersion.
+ virtual void GetInterfaceVersion(uint32_t& Version) = 0;
+ /// This is the method that will be called on remote calls on the method LifecycleRequestComplete.
+ virtual void LifecycleRequestComplete(uint32_t RequestId, int32_t Status, int32_t& ErrorCode) = 0;
+
+ /// Sends a broadcast event for NodeState.
+ virtual void fireNodeStateEvent(const int32_t& NodeState) = 0;
+ /// Sends a broadcast event for NodeApplicationMode.
+ virtual void fireNodeApplicationModeEvent(const int32_t& ApplicationModeId) = 0;
+ /// Sends a broadcast event for SessionStateChanged.
+ virtual void fireSessionStateChangedEvent(const std::string& SessionStateName, const int32_t& SeatID, const int32_t& SessionState) = 0;
+};
+
+} // namespace Consumer
+} // namespace NodeStateManager
+} // namespace genivi
+} // namespace org
+
+#endif // ORG_GENIVI_NODESTATEMANAGER_CONSUMER_Consumer_STUB_H_
diff --git a/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerStubDefault.cpp b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerStubDefault.cpp
new file mode 100644
index 0000000..f923d1d
--- /dev/null
+++ b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerStubDefault.cpp
@@ -0,0 +1,240 @@
+/*
+* This file was generated by the CommonAPI Generators.
+*
+ * 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/.
+*/
+#include <org/genivi/NodeStateManager/Consumer/ConsumerStubDefault.h>
+
+namespace org {
+namespace genivi {
+namespace NodeStateManager {
+namespace Consumer {
+
+ConsumerStubDefault::ConsumerStubDefault():
+ remoteEventHandler_(this) {
+}
+
+ConsumerStubRemoteEvent* ConsumerStubDefault::initStubAdapter(const std::shared_ptr<ConsumerStubAdapter>& stubAdapter) {
+ stubAdapter_ = stubAdapter;
+ return &remoteEventHandler_;
+}
+
+const int32_t& ConsumerStubDefault::getRestartReasonAttribute() {
+ return restartReasonAttributeValue_;
+}
+
+void ConsumerStubDefault::setRestartReasonAttribute(int32_t value) {
+ const bool valueChanged = trySetRestartReasonAttribute(std::move(value));
+ if (valueChanged)
+ stubAdapter_->fireRestartReasonAttributeChanged(restartReasonAttributeValue_);
+}
+
+void ConsumerStubDefault::onRemoteRestartReasonAttributeChanged() {
+ // No operation in default
+}
+
+bool ConsumerStubDefault::trySetRestartReasonAttribute(int32_t value) {
+ if (!validateRestartReasonAttributeRequestedValue(value))
+ return false;
+
+ const bool valueChanged = (restartReasonAttributeValue_ != value);
+ restartReasonAttributeValue_ = std::move(value);
+ return valueChanged;
+}
+
+bool ConsumerStubDefault::validateRestartReasonAttributeRequestedValue(const int32_t& value) {
+ return true;
+}
+
+bool ConsumerStubDefault::RemoteEventHandler::onRemoteSetRestartReasonAttribute(int32_t value) {
+ return defaultStub_->trySetRestartReasonAttribute(std::move(value));
+}
+
+void ConsumerStubDefault::RemoteEventHandler::onRemoteRestartReasonAttributeChanged() {
+ defaultStub_->onRemoteRestartReasonAttributeChanged();
+}
+
+const int32_t& ConsumerStubDefault::getShutdownReasonAttribute() {
+ return shutdownReasonAttributeValue_;
+}
+
+void ConsumerStubDefault::setShutdownReasonAttribute(int32_t value) {
+ const bool valueChanged = trySetShutdownReasonAttribute(std::move(value));
+ if (valueChanged)
+ stubAdapter_->fireShutdownReasonAttributeChanged(shutdownReasonAttributeValue_);
+}
+
+void ConsumerStubDefault::onRemoteShutdownReasonAttributeChanged() {
+ // No operation in default
+}
+
+bool ConsumerStubDefault::trySetShutdownReasonAttribute(int32_t value) {
+ if (!validateShutdownReasonAttributeRequestedValue(value))
+ return false;
+
+ const bool valueChanged = (shutdownReasonAttributeValue_ != value);
+ shutdownReasonAttributeValue_ = std::move(value);
+ return valueChanged;
+}
+
+bool ConsumerStubDefault::validateShutdownReasonAttributeRequestedValue(const int32_t& value) {
+ return true;
+}
+
+bool ConsumerStubDefault::RemoteEventHandler::onRemoteSetShutdownReasonAttribute(int32_t value) {
+ return defaultStub_->trySetShutdownReasonAttribute(std::move(value));
+}
+
+void ConsumerStubDefault::RemoteEventHandler::onRemoteShutdownReasonAttributeChanged() {
+ defaultStub_->onRemoteShutdownReasonAttributeChanged();
+}
+
+const int32_t& ConsumerStubDefault::getWakeUpReasonAttribute() {
+ return wakeUpReasonAttributeValue_;
+}
+
+void ConsumerStubDefault::setWakeUpReasonAttribute(int32_t value) {
+ const bool valueChanged = trySetWakeUpReasonAttribute(std::move(value));
+ if (valueChanged)
+ stubAdapter_->fireWakeUpReasonAttributeChanged(wakeUpReasonAttributeValue_);
+}
+
+void ConsumerStubDefault::onRemoteWakeUpReasonAttributeChanged() {
+ // No operation in default
+}
+
+bool ConsumerStubDefault::trySetWakeUpReasonAttribute(int32_t value) {
+ if (!validateWakeUpReasonAttributeRequestedValue(value))
+ return false;
+
+ const bool valueChanged = (wakeUpReasonAttributeValue_ != value);
+ wakeUpReasonAttributeValue_ = std::move(value);
+ return valueChanged;
+}
+
+bool ConsumerStubDefault::validateWakeUpReasonAttributeRequestedValue(const int32_t& value) {
+ return true;
+}
+
+bool ConsumerStubDefault::RemoteEventHandler::onRemoteSetWakeUpReasonAttribute(int32_t value) {
+ return defaultStub_->trySetWakeUpReasonAttribute(std::move(value));
+}
+
+void ConsumerStubDefault::RemoteEventHandler::onRemoteWakeUpReasonAttributeChanged() {
+ defaultStub_->onRemoteWakeUpReasonAttributeChanged();
+}
+
+const int32_t& ConsumerStubDefault::getBootModeAttribute() {
+ return bootModeAttributeValue_;
+}
+
+void ConsumerStubDefault::setBootModeAttribute(int32_t value) {
+ const bool valueChanged = trySetBootModeAttribute(std::move(value));
+ if (valueChanged)
+ stubAdapter_->fireBootModeAttributeChanged(bootModeAttributeValue_);
+}
+
+void ConsumerStubDefault::onRemoteBootModeAttributeChanged() {
+ // No operation in default
+}
+
+bool ConsumerStubDefault::trySetBootModeAttribute(int32_t value) {
+ if (!validateBootModeAttributeRequestedValue(value))
+ return false;
+
+ const bool valueChanged = (bootModeAttributeValue_ != value);
+ bootModeAttributeValue_ = std::move(value);
+ return valueChanged;
+}
+
+bool ConsumerStubDefault::validateBootModeAttributeRequestedValue(const int32_t& value) {
+ return true;
+}
+
+bool ConsumerStubDefault::RemoteEventHandler::onRemoteSetBootModeAttribute(int32_t value) {
+ return defaultStub_->trySetBootModeAttribute(std::move(value));
+}
+
+void ConsumerStubDefault::RemoteEventHandler::onRemoteBootModeAttributeChanged() {
+ defaultStub_->onRemoteBootModeAttributeChanged();
+}
+
+
+void ConsumerStubDefault::GetNodeState(int32_t& NodeStateId, int32_t& ErrorCode) {
+ // No operation in default
+}
+
+void ConsumerStubDefault::SetSessionState(std::string SessionName, std::string SessionOwner, int32_t SeatID, int32_t SessionState, int32_t& ErrorCode) {
+ // No operation in default
+}
+
+void ConsumerStubDefault::GetSessionState(std::string SessionName, int32_t SeatID, int32_t& SessionState, int32_t& ErrorCode) {
+ // No operation in default
+}
+
+void ConsumerStubDefault::GetApplicationMode(int32_t& ApplicationModeId, int32_t& ErrorCode) {
+ // No operation in default
+}
+
+void ConsumerStubDefault::RegisterShutdownClient(std::string BusName, std::string ObjName, uint32_t ShutdownMode, uint32_t TimeoutMs, int32_t& ErrorCode) {
+ // No operation in default
+}
+
+void ConsumerStubDefault::UnRegisterShutdownClient(std::string BusName, std::string ObjName, uint32_t ShutdownMode, int32_t& ErrorCode) {
+ // No operation in default
+}
+
+void ConsumerStubDefault::RegisterSession(std::string SessionName, std::string SessionOwner, int32_t SeatID, int32_t SessionState, int32_t& ErrorCode) {
+ // No operation in default
+}
+
+void ConsumerStubDefault::UnRegisterSession(std::string SessionName, std::string SessionOwner, int32_t SeatID, int32_t& ErrorCode) {
+ // No operation in default
+}
+
+void ConsumerStubDefault::GetAppHealthCount(uint32_t& Count) {
+ // No operation in default
+}
+
+void ConsumerStubDefault::GetInterfaceVersion(uint32_t& Version) {
+ // No operation in default
+}
+
+void ConsumerStubDefault::LifecycleRequestComplete(uint32_t RequestId, int32_t Status, int32_t& ErrorCode) {
+ // No operation in default
+}
+
+
+void ConsumerStubDefault::fireNodeStateEvent(const int32_t& NodeState) {
+ stubAdapter_->fireNodeStateEvent(NodeState);
+}
+void ConsumerStubDefault::fireNodeApplicationModeEvent(const int32_t& ApplicationModeId) {
+ stubAdapter_->fireNodeApplicationModeEvent(ApplicationModeId);
+}
+void ConsumerStubDefault::fireSessionStateChangedEvent(const std::string& SessionStateName, const int32_t& SeatID, const int32_t& SessionState) {
+ stubAdapter_->fireSessionStateChangedEvent(SessionStateName, SeatID, SessionState);
+}
+
+ConsumerStubDefault::RemoteEventHandler::RemoteEventHandler(ConsumerStubDefault* defaultStub):
+ defaultStub_(defaultStub) {
+}
+
+} // namespace Consumer
+} // namespace NodeStateManager
+} // namespace genivi
+} // namespace org
diff --git a/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerStubDefault.h b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerStubDefault.h
new file mode 100644
index 0000000..76b7f8c
--- /dev/null
+++ b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerStubDefault.h
@@ -0,0 +1,141 @@
+/*
+* This file was generated by the CommonAPI Generators.
+*
+ * 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/.
+*/
+#ifndef ORG_GENIVI_NODESTATEMANAGER_CONSUMER_Consumer_STUB_DEFAULT_H_
+#define ORG_GENIVI_NODESTATEMANAGER_CONSUMER_Consumer_STUB_DEFAULT_H_
+
+#include <org/genivi/NodeStateManager/Consumer/ConsumerStub.h>
+
+namespace org {
+namespace genivi {
+namespace NodeStateManager {
+namespace Consumer {
+
+/**
+ * Provides a default implementation for ConsumerStubRemoteEvent and
+ * ConsumerStub. Method callbacks have an empty implementation,
+ * remote set calls on attributes will always change the value of the attribute
+ * to the one received.
+ *
+ * Override this stub if you only want to provide a subset of the functionality
+ * that would be defined for this service, and/or if you do not need any non-default
+ * behaviour.
+ */
+class ConsumerStubDefault : public ConsumerStub {
+ public:
+ ConsumerStubDefault();
+
+ ConsumerStubRemoteEvent* initStubAdapter(const std::shared_ptr<ConsumerStubAdapter>& stubAdapter);
+
+ virtual const int32_t& getRestartReasonAttribute();
+ virtual void setRestartReasonAttribute(int32_t value);
+
+ virtual const int32_t& getShutdownReasonAttribute();
+ virtual void setShutdownReasonAttribute(int32_t value);
+
+ virtual const int32_t& getWakeUpReasonAttribute();
+ virtual void setWakeUpReasonAttribute(int32_t value);
+
+ virtual const int32_t& getBootModeAttribute();
+ virtual void setBootModeAttribute(int32_t value);
+
+
+ virtual void GetNodeState(int32_t& NodeStateId, int32_t& ErrorCode);
+
+ virtual void SetSessionState(std::string SessionName, std::string SessionOwner, int32_t SeatID, int32_t SessionState, int32_t& ErrorCode);
+
+ virtual void GetSessionState(std::string SessionName, int32_t SeatID, int32_t& SessionState, int32_t& ErrorCode);
+
+ virtual void GetApplicationMode(int32_t& ApplicationModeId, int32_t& ErrorCode);
+
+ virtual void RegisterShutdownClient(std::string BusName, std::string ObjName, uint32_t ShutdownMode, uint32_t TimeoutMs, int32_t& ErrorCode);
+
+ virtual void UnRegisterShutdownClient(std::string BusName, std::string ObjName, uint32_t ShutdownMode, int32_t& ErrorCode);
+
+ virtual void RegisterSession(std::string SessionName, std::string SessionOwner, int32_t SeatID, int32_t SessionState, int32_t& ErrorCode);
+
+ virtual void UnRegisterSession(std::string SessionName, std::string SessionOwner, int32_t SeatID, int32_t& ErrorCode);
+
+ virtual void GetAppHealthCount(uint32_t& Count);
+
+ virtual void GetInterfaceVersion(uint32_t& Version);
+
+ virtual void LifecycleRequestComplete(uint32_t RequestId, int32_t Status, int32_t& ErrorCode);
+
+
+ virtual void fireNodeStateEvent(const int32_t& NodeState);
+ virtual void fireNodeApplicationModeEvent(const int32_t& ApplicationModeId);
+ virtual void fireSessionStateChangedEvent(const std::string& SessionStateName, const int32_t& SeatID, const int32_t& SessionState);
+
+ protected:
+ virtual void onRemoteRestartReasonAttributeChanged();
+ virtual bool trySetRestartReasonAttribute(int32_t value);
+ virtual bool validateRestartReasonAttributeRequestedValue(const int32_t& value);
+
+ virtual void onRemoteShutdownReasonAttributeChanged();
+ virtual bool trySetShutdownReasonAttribute(int32_t value);
+ virtual bool validateShutdownReasonAttributeRequestedValue(const int32_t& value);
+
+ virtual void onRemoteWakeUpReasonAttributeChanged();
+ virtual bool trySetWakeUpReasonAttribute(int32_t value);
+ virtual bool validateWakeUpReasonAttributeRequestedValue(const int32_t& value);
+
+ virtual void onRemoteBootModeAttributeChanged();
+ virtual bool trySetBootModeAttribute(int32_t value);
+ virtual bool validateBootModeAttributeRequestedValue(const int32_t& value);
+
+
+ private:
+ class RemoteEventHandler: public ConsumerStubRemoteEvent {
+ public:
+ RemoteEventHandler(ConsumerStubDefault* defaultStub);
+
+ virtual bool onRemoteSetRestartReasonAttribute(int32_t value);
+ virtual void onRemoteRestartReasonAttributeChanged();
+
+ virtual bool onRemoteSetShutdownReasonAttribute(int32_t value);
+ virtual void onRemoteShutdownReasonAttributeChanged();
+
+ virtual bool onRemoteSetWakeUpReasonAttribute(int32_t value);
+ virtual void onRemoteWakeUpReasonAttributeChanged();
+
+ virtual bool onRemoteSetBootModeAttribute(int32_t value);
+ virtual void onRemoteBootModeAttributeChanged();
+
+
+ private:
+ ConsumerStubDefault* defaultStub_;
+ };
+
+ RemoteEventHandler remoteEventHandler_;
+ std::shared_ptr<ConsumerStubAdapter> stubAdapter_;
+
+ int32_t restartReasonAttributeValue_;
+ int32_t shutdownReasonAttributeValue_;
+ int32_t wakeUpReasonAttributeValue_;
+ int32_t bootModeAttributeValue_;
+};
+
+} // namespace Consumer
+} // namespace NodeStateManager
+} // namespace genivi
+} // namespace org
+
+#endif // ORG_GENIVI_NODESTATEMANAGER_CONSUMER_Consumer_STUB_DEFAULT_H_
diff --git a/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumer.h b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumer.h
new file mode 100644
index 0000000..d4e071d
--- /dev/null
+++ b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumer.h
@@ -0,0 +1,70 @@
+/*
+* This file was generated by the CommonAPI Generators.
+*
+ * 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/.
+*/
+#ifndef ORG_GENIVI_NODESTATEMANAGER_LIFECYCLECONSUMER_Life_Cycle_Consumer_H_
+#define ORG_GENIVI_NODESTATEMANAGER_LIFECYCLECONSUMER_Life_Cycle_Consumer_H_
+
+
+
+#define COMMONAPI_INTERNAL_COMPILATION
+
+#include <CommonAPI/types.h>
+
+#undef COMMONAPI_INTERNAL_COMPILATION
+
+namespace org {
+namespace genivi {
+namespace NodeStateManager {
+namespace LifeCycleConsumer {
+
+class LifeCycleConsumer {
+ public:
+ virtual ~LifeCycleConsumer() { }
+
+ static inline const char* getInterfaceId();
+ static inline CommonAPI::Version getInterfaceVersion();
+};
+
+const char* LifeCycleConsumer::getInterfaceId() {
+ return "org.genivi.NodeStateManager.LifeCycleConsumer.LifeCycleConsumer";
+}
+
+CommonAPI::Version LifeCycleConsumer::getInterfaceVersion() {
+ return CommonAPI::Version(0, 1);
+}
+
+
+} // namespace LifeCycleConsumer
+} // namespace NodeStateManager
+} // namespace genivi
+} // namespace org
+
+namespace CommonAPI {
+
+}
+
+
+namespace std {
+ //hashes for types
+
+ //hashes for error types
+}
+
+#endif // ORG_GENIVI_NODESTATEMANAGER_LIFECYCLECONSUMER_Life_Cycle_Consumer_H_
diff --git a/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumerDBusProxy.cpp b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumerDBusProxy.cpp
new file mode 100644
index 0000000..5df88da
--- /dev/null
+++ b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumerDBusProxy.cpp
@@ -0,0 +1,82 @@
+/*
+* This file was generated by the CommonAPI Generators.
+*
+ * 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/.
+*/
+#include "LifeCycleConsumerDBusProxy.h"
+
+namespace org {
+namespace genivi {
+namespace NodeStateManager {
+namespace LifeCycleConsumer {
+
+std::shared_ptr<CommonAPI::DBus::DBusProxy> createLifeCycleConsumerDBusProxy(
+ const std::string& commonApiAddress,
+ const std::string& interfaceName,
+ const std::string& busName,
+ const std::string& objectPath,
+ const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection>& dbusProxyConnection) {
+ return std::make_shared<LifeCycleConsumerDBusProxy>(commonApiAddress, interfaceName, busName, objectPath, dbusProxyConnection);
+}
+
+__attribute__((constructor)) void registerLifeCycleConsumerDBusProxy(void) {
+ CommonAPI::DBus::DBusFactory::registerProxyFactoryMethod(LifeCycleConsumer::getInterfaceId(),
+ &createLifeCycleConsumerDBusProxy);
+}
+
+LifeCycleConsumerDBusProxy::LifeCycleConsumerDBusProxy(
+ const std::string& commonApiAddress,
+ const std::string& interfaceName,
+ const std::string& busName,
+ const std::string& objectPath,
+ const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection>& dbusProxyconnection):
+ CommonAPI::DBus::DBusProxy(commonApiAddress, interfaceName, busName, objectPath, dbusProxyconnection)
+ {
+}
+
+
+
+void LifeCycleConsumerDBusProxy::LifecycleRequest(const uint32_t& Request, const uint32_t& RequestId, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode) {
+ CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<uint32_t, uint32_t>,
+ CommonAPI::DBus::DBusSerializableArguments<int32_t> >::callMethodWithReply(
+ *this,
+ "LifecycleRequest",
+ "uu",
+ Request, RequestId,
+ callStatus
+ , ErrorCode);
+}
+std::future<CommonAPI::CallStatus> LifeCycleConsumerDBusProxy::LifecycleRequestAsync(const uint32_t& Request, const uint32_t& RequestId, LifecycleRequestAsyncCallback callback) {
+ return CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<uint32_t, uint32_t>,
+ CommonAPI::DBus::DBusSerializableArguments<int32_t> >::callMethodAsync(
+ *this,
+ "LifecycleRequest",
+ "uu",
+ Request, RequestId,
+ std::move(callback));
+}
+
+void LifeCycleConsumerDBusProxy::getOwnVersion(uint16_t& ownVersionMajor, uint16_t& ownVersionMinor) const {
+ ownVersionMajor = 0;
+ ownVersionMinor = 1;
+}
+
+} // namespace LifeCycleConsumer
+} // namespace NodeStateManager
+} // namespace genivi
+} // namespace org
diff --git a/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumerDBusProxy.h b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumerDBusProxy.h
new file mode 100644
index 0000000..7c4522d
--- /dev/null
+++ b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumerDBusProxy.h
@@ -0,0 +1,68 @@
+/*
+* This file was generated by the CommonAPI Generators.
+*
+ * 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/.
+*/
+#ifndef ORG_GENIVI_NODESTATEMANAGER_LIFECYCLECONSUMER_Life_Cycle_Consumer_DBUS_PROXY_H_
+#define ORG_GENIVI_NODESTATEMANAGER_LIFECYCLECONSUMER_Life_Cycle_Consumer_DBUS_PROXY_H_
+
+#include <org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumerProxyBase.h>
+
+#define COMMONAPI_INTERNAL_COMPILATION
+
+#include <CommonAPI/DBus/DBusFactory.h>
+#include <CommonAPI/DBus/DBusProxy.h>
+
+#undef COMMONAPI_INTERNAL_COMPILATION
+
+#include <string>
+
+namespace org {
+namespace genivi {
+namespace NodeStateManager {
+namespace LifeCycleConsumer {
+
+class LifeCycleConsumerDBusProxy: virtual public LifeCycleConsumerProxyBase, virtual public CommonAPI::DBus::DBusProxy {
+ public:
+ LifeCycleConsumerDBusProxy(
+ const std::string& commonApiAddress,
+ const std::string& interfaceName,
+ const std::string& busName,
+ const std::string& objectPath,
+ const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection>& dbusProxyconnection);
+
+ virtual ~LifeCycleConsumerDBusProxy() { }
+
+
+
+
+ virtual void LifecycleRequest(const uint32_t& Request, const uint32_t& RequestId, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode);
+ virtual std::future<CommonAPI::CallStatus> LifecycleRequestAsync(const uint32_t& Request, const uint32_t& RequestId, LifecycleRequestAsyncCallback callback);
+
+ virtual void getOwnVersion(uint16_t& ownVersionMajor, uint16_t& ownVersionMinor) const;
+
+ private:
+
+};
+
+} // namespace LifeCycleConsumer
+} // namespace NodeStateManager
+} // namespace genivi
+} // namespace org
+
+#endif // ORG_GENIVI_NODESTATEMANAGER_LIFECYCLECONSUMER_Life_Cycle_Consumer_DBUS_PROXY_H_
diff --git a/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumerDBusStubAdapter.cpp b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumerDBusStubAdapter.cpp
new file mode 100644
index 0000000..e408a47
--- /dev/null
+++ b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumerDBusStubAdapter.cpp
@@ -0,0 +1,82 @@
+/*
+* This file was generated by the CommonAPI Generators.
+*
+ * 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/.
+*/
+#include "LifeCycleConsumerDBusStubAdapter.h"
+#include <org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumer.h>
+
+namespace org {
+namespace genivi {
+namespace NodeStateManager {
+namespace LifeCycleConsumer {
+
+std::shared_ptr<CommonAPI::DBus::DBusStubAdapter> createLifeCycleConsumerDBusStubAdapter(
+ const std::string& commonApiAddress,
+ const std::string& interfaceName,
+ const std::string& busName,
+ const std::string& objectPath,
+ const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection>& dbusProxyConnection,
+ const std::shared_ptr<CommonAPI::StubBase>& stubBase) {
+ return std::make_shared<LifeCycleConsumerDBusStubAdapter>(commonApiAddress, interfaceName, busName, objectPath, dbusProxyConnection, stubBase);
+}
+
+__attribute__((constructor)) void registerLifeCycleConsumerDBusStubAdapter(void) {
+ CommonAPI::DBus::DBusFactory::registerAdapterFactoryMethod(LifeCycleConsumer::getInterfaceId(),
+ &createLifeCycleConsumerDBusStubAdapter);
+}
+
+LifeCycleConsumerDBusStubAdapter::LifeCycleConsumerDBusStubAdapter(
+ const std::string& commonApiAddress,
+ const std::string& dbusInterfaceName,
+ const std::string& dbusBusName,
+ const std::string& dbusObjectPath,
+ const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection>& dbusConnection,
+ const std::shared_ptr<CommonAPI::StubBase>& stub):
+ LifeCycleConsumerDBusStubAdapterHelper(commonApiAddress, dbusInterfaceName, dbusBusName, dbusObjectPath, dbusConnection, std::dynamic_pointer_cast<LifeCycleConsumerStub>(stub)) {
+}
+
+const char* LifeCycleConsumerDBusStubAdapter::getMethodsDBusIntrospectionXmlData() const {
+ return
+ "<method name=\"LifecycleRequest\">\n"
+ "<arg name=\"Request\" type=\"u\" direction=\"in\" />\n"
+ "<arg name=\"RequestId\" type=\"u\" direction=\"in\" />\n"
+ "<arg name=\"ErrorCode\" type=\"i\" direction=\"out\" />\n"
+ "</method>\n"
+ ;
+}
+
+
+
+static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher<
+ LifeCycleConsumerStub,
+ std::tuple<uint32_t, uint32_t>,
+ std::tuple<int32_t>
+ > lifecycleRequestStubDispatcher(&LifeCycleConsumerStub::LifecycleRequest, "i");
+
+
+
+} // namespace LifeCycleConsumer
+} // namespace NodeStateManager
+} // namespace genivi
+} // namespace org
+
+template<>
+const org::genivi::NodeStateManager::LifeCycleConsumer::LifeCycleConsumerDBusStubAdapterHelper::StubDispatcherTable org::genivi::NodeStateManager::LifeCycleConsumer::LifeCycleConsumerDBusStubAdapterHelper::stubDispatcherTable_ = {
+ { { "LifecycleRequest", "uu" }, &org::genivi::NodeStateManager::LifeCycleConsumer::lifecycleRequestStubDispatcher }
+};
diff --git a/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumerDBusStubAdapter.h b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumerDBusStubAdapter.h
new file mode 100644
index 0000000..74e41a4
--- /dev/null
+++ b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumerDBusStubAdapter.h
@@ -0,0 +1,61 @@
+/*
+* This file was generated by the CommonAPI Generators.
+*
+ * 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/.
+*/
+#ifndef ORG_GENIVI_NODESTATEMANAGER_LIFECYCLECONSUMER_Life_Cycle_Consumer_DBUS_STUB_ADAPTER_H_
+#define ORG_GENIVI_NODESTATEMANAGER_LIFECYCLECONSUMER_Life_Cycle_Consumer_DBUS_STUB_ADAPTER_H_
+
+#include <org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumerStub.h>
+
+#define COMMONAPI_INTERNAL_COMPILATION
+
+#include <CommonAPI/DBus/DBusStubAdapterHelper.h>
+#include <CommonAPI/DBus/DBusFactory.h>
+
+#undef COMMONAPI_INTERNAL_COMPILATION
+
+namespace org {
+namespace genivi {
+namespace NodeStateManager {
+namespace LifeCycleConsumer {
+
+typedef CommonAPI::DBus::DBusStubAdapterHelper<LifeCycleConsumerStub> LifeCycleConsumerDBusStubAdapterHelper;
+
+class LifeCycleConsumerDBusStubAdapter: public LifeCycleConsumerStubAdapter, public LifeCycleConsumerDBusStubAdapterHelper {
+ public:
+ LifeCycleConsumerDBusStubAdapter(
+ const std::string& commonApiAddress,
+ const std::string& dbusInterfaceName,
+ const std::string& dbusBusName,
+ const std::string& dbusObjectPath,
+ const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection>& dbusConnection,
+ const std::shared_ptr<CommonAPI::StubBase>& stub);
+
+
+
+ protected:
+ virtual const char* getMethodsDBusIntrospectionXmlData() const;
+};
+
+} // namespace LifeCycleConsumer
+} // namespace NodeStateManager
+} // namespace genivi
+} // namespace org
+
+#endif // ORG_GENIVI_NODESTATEMANAGER_LIFECYCLECONSUMER_Life_Cycle_Consumer_DBUS_STUB_ADAPTER_H_
diff --git a/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumerProxy.h b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumerProxy.h
new file mode 100644
index 0000000..f8e21ed
--- /dev/null
+++ b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumerProxy.h
@@ -0,0 +1,166 @@
+/*
+* This file was generated by the CommonAPI Generators.
+*
+ * 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/.
+*/
+#ifndef ORG_GENIVI_NODESTATEMANAGER_LIFECYCLECONSUMER_Life_Cycle_Consumer_PROXY_H_
+#define ORG_GENIVI_NODESTATEMANAGER_LIFECYCLECONSUMER_Life_Cycle_Consumer_PROXY_H_
+
+#include "LifeCycleConsumerProxyBase.h"
+
+#define COMMONAPI_INTERNAL_COMPILATION
+
+
+#undef COMMONAPI_INTERNAL_COMPILATION
+
+namespace org {
+namespace genivi {
+namespace NodeStateManager {
+namespace LifeCycleConsumer {
+
+template <typename ... _AttributeExtensions>
+class LifeCycleConsumerProxy: virtual public LifeCycleConsumer, virtual public LifeCycleConsumerProxyBase, public _AttributeExtensions... {
+ public:
+ LifeCycleConsumerProxy(std::shared_ptr<CommonAPI::Proxy> delegate);
+ ~LifeCycleConsumerProxy();
+
+
+
+
+ /**
+ * Calls LifecycleRequest with synchronous semantics.
+ *
+ * All const parameters are input parameters to this method.
+ * All non-const parameters will be filled with the returned values.
+ * The CallStatus will be filled when the method returns and indicate either
+ * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus
+ * will be set.
+ * Synchronous calls are not supported (will block indefinitely) when mainloop integration is used.
+ */
+ virtual void LifecycleRequest(const uint32_t& Request, const uint32_t& RequestId, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode);
+ /**
+ * Calls LifecycleRequest with asynchronous semantics.
+ *
+ * The provided callback will be called when the reply to this call arrives or
+ * an error occurs during the call. The CallStatus will indicate either "SUCCESS"
+ * or which type of error has occurred. In case of any error, ONLY the CallStatus
+ * will have a defined value.
+ * The std::future returned by this method will be fulfilled at arrival of the reply.
+ * It will provide the same value for CallStatus as will be handed to the callback.
+ */
+ virtual std::future<CommonAPI::CallStatus> LifecycleRequestAsync(const uint32_t& Request, const uint32_t& RequestId, LifecycleRequestAsyncCallback callback);
+
+ /// Returns the CommonAPI address of the remote partner this proxy communicates with.
+ virtual std::string getAddress() const;
+
+ /// Returns the domain of the remote partner this proxy communicates with.
+ virtual const std::string& getDomain() const;
+
+ /// Returns the service ID of the remote partner this proxy communicates with.
+ virtual const std::string& getServiceId() const;
+
+ /// Returns the instance ID of the remote partner this proxy communicates with.
+ virtual const std::string& getInstanceId() const;
+
+ /// Returns true if the remote partner for this proxy is available.
+ virtual bool isAvailable() const;
+
+ /**
+ * Returns the wrapper class that is used to (de-)register for notifications about
+ * the availability of the remote partner of this proxy.
+ */
+ virtual CommonAPI::ProxyStatusEvent& getProxyStatusEvent();
+
+ /**
+ * Returns the wrapper class that is used to access version information of the remote
+ * partner of this proxy.
+ */
+ virtual CommonAPI::InterfaceVersionAttribute& getInterfaceVersionAttribute();
+
+ private:
+ std::shared_ptr<LifeCycleConsumerProxyBase> delegate_;
+};
+
+
+//
+// LifeCycleConsumerProxy Implementation
+//
+template <typename ... _AttributeExtensions>
+LifeCycleConsumerProxy<_AttributeExtensions...>::LifeCycleConsumerProxy(std::shared_ptr<CommonAPI::Proxy> delegate):
+ delegate_(std::dynamic_pointer_cast<LifeCycleConsumerProxyBase>(delegate)),
+ _AttributeExtensions(*(std::dynamic_pointer_cast<LifeCycleConsumerProxyBase>(delegate)))... {
+}
+
+template <typename ... _AttributeExtensions>
+LifeCycleConsumerProxy<_AttributeExtensions...>::~LifeCycleConsumerProxy() {
+}
+
+template <typename ... _AttributeExtensions>
+void LifeCycleConsumerProxy<_AttributeExtensions...>::LifecycleRequest(const uint32_t& Request, const uint32_t& RequestId, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode) {
+ delegate_->LifecycleRequest(Request, RequestId, callStatus, ErrorCode);
+}
+
+template <typename ... _AttributeExtensions>
+std::future<CommonAPI::CallStatus> LifeCycleConsumerProxy<_AttributeExtensions...>::LifecycleRequestAsync(const uint32_t& Request, const uint32_t& RequestId, LifecycleRequestAsyncCallback callback) {
+ return delegate_->LifecycleRequestAsync(Request, RequestId, callback);
+}
+
+
+template <typename ... _AttributeExtensions>
+std::string LifeCycleConsumerProxy<_AttributeExtensions...>::getAddress() const {
+ return delegate_->getAddress();
+}
+
+template <typename ... _AttributeExtensions>
+const std::string& LifeCycleConsumerProxy<_AttributeExtensions...>::getDomain() const {
+ return delegate_->getDomain();
+}
+
+template <typename ... _AttributeExtensions>
+const std::string& LifeCycleConsumerProxy<_AttributeExtensions...>::getServiceId() const {
+ return delegate_->getServiceId();
+}
+
+template <typename ... _AttributeExtensions>
+const std::string& LifeCycleConsumerProxy<_AttributeExtensions...>::getInstanceId() const {
+ return delegate_->getInstanceId();
+}
+
+template <typename ... _AttributeExtensions>
+bool LifeCycleConsumerProxy<_AttributeExtensions...>::isAvailable() const {
+ return delegate_->isAvailable();
+}
+
+template <typename ... _AttributeExtensions>
+CommonAPI::ProxyStatusEvent& LifeCycleConsumerProxy<_AttributeExtensions...>::getProxyStatusEvent() {
+ return delegate_->getProxyStatusEvent();
+}
+
+template <typename ... _AttributeExtensions>
+CommonAPI::InterfaceVersionAttribute& LifeCycleConsumerProxy<_AttributeExtensions...>::getInterfaceVersionAttribute() {
+ return delegate_->getInterfaceVersionAttribute();
+}
+
+} // namespace LifeCycleConsumer
+} // namespace NodeStateManager
+} // namespace genivi
+} // namespace org
+
+
+
+#endif // ORG_GENIVI_NODESTATEMANAGER_LIFECYCLECONSUMER_Life_Cycle_Consumer_PROXY_H_
diff --git a/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumerProxyBase.h b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumerProxyBase.h
new file mode 100644
index 0000000..3e780d0
--- /dev/null
+++ b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumerProxyBase.h
@@ -0,0 +1,58 @@
+ /*
+ * This file was generated by the CommonAPI Generators.
+ *
+ * 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/.
+ */
+ #ifndef ORG_GENIVI_NODESTATEMANAGER_LIFECYCLECONSUMER_Life_Cycle_Consumer_PROXY_BASE_H_
+ #define ORG_GENIVI_NODESTATEMANAGER_LIFECYCLECONSUMER_Life_Cycle_Consumer_PROXY_BASE_H_
+
+ #include "LifeCycleConsumer.h"
+
+
+
+ #define COMMONAPI_INTERNAL_COMPILATION
+
+
+ #include <CommonAPI/Proxy.h>
+ #include <functional>
+ #include <future>
+
+ #undef COMMONAPI_INTERNAL_COMPILATION
+
+ namespace org {
+ namespace genivi {
+ namespace NodeStateManager {
+ namespace LifeCycleConsumer {
+
+ class LifeCycleConsumerProxyBase: virtual public CommonAPI::Proxy {
+ public:
+ typedef std::function<void(const CommonAPI::CallStatus&, const int32_t&)> LifecycleRequestAsyncCallback;
+
+
+
+
+ virtual void LifecycleRequest(const uint32_t& Request, const uint32_t& RequestId, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode) = 0;
+ virtual std::future<CommonAPI::CallStatus> LifecycleRequestAsync(const uint32_t& Request, const uint32_t& RequestId, LifecycleRequestAsyncCallback callback) = 0;
+ };
+
+ } // namespace LifeCycleConsumer
+ } // namespace NodeStateManager
+ } // namespace genivi
+ } // namespace org
+
+ #endif // ORG_GENIVI_NODESTATEMANAGER_LIFECYCLECONSUMER_Life_Cycle_Consumer_PROXY_BASE_H_
diff --git a/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumerStub.h b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumerStub.h
new file mode 100644
index 0000000..f4d9d80
--- /dev/null
+++ b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumerStub.h
@@ -0,0 +1,93 @@
+/*
+* This file was generated by the CommonAPI Generators.
+*
+ * 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/.
+*/
+#ifndef ORG_GENIVI_NODESTATEMANAGER_LIFECYCLECONSUMER_Life_Cycle_Consumer_STUB_H_
+#define ORG_GENIVI_NODESTATEMANAGER_LIFECYCLECONSUMER_Life_Cycle_Consumer_STUB_H_
+
+
+
+
+#include "LifeCycleConsumer.h"
+
+#define COMMONAPI_INTERNAL_COMPILATION
+
+
+#include <CommonAPI/Stub.h>
+
+#undef COMMONAPI_INTERNAL_COMPILATION
+
+namespace org {
+namespace genivi {
+namespace NodeStateManager {
+namespace LifeCycleConsumer {
+
+/**
+ * Receives messages from remote and handles all dispatching of deserialized calls
+ * to a stub for the service LifeCycleConsumer. Also provides means to send broadcasts
+ * and attribute-changed-notifications of observable attributes as defined by this service.
+ * An application developer should not need to bother with this class.
+ */
+class LifeCycleConsumerStubAdapter: virtual public CommonAPI::StubAdapter, public LifeCycleConsumer {
+ public:
+
+};
+
+
+/**
+ * Defines the necessary callbacks to handle remote set events related to the attributes
+ * defined in the IDL description for LifeCycleConsumer.
+ * For each attribute two callbacks are defined:
+ * - a verification callback that allows to verify the requested value and to prevent setting
+ * e.g. an invalid value ("onRemoteSet<AttributeName>").
+ * - an action callback to do local work after the attribute value has been changed
+ * ("onRemote<AttributeName>Changed").
+ *
+ * This class and the one below are the ones an application developer needs to have
+ * a look at if he wants to implement a service.
+ */
+class LifeCycleConsumerStubRemoteEvent {
+ public:
+ virtual ~LifeCycleConsumerStubRemoteEvent() { }
+
+};
+
+
+/**
+ * Defines the interface that must be implemented by any class that should provide
+ * the service LifeCycleConsumer to remote clients.
+ * This class and the one above are the ones an application developer needs to have
+ * a look at if he wants to implement a service.
+ */
+class LifeCycleConsumerStub : public CommonAPI::Stub<LifeCycleConsumerStubAdapter , LifeCycleConsumerStubRemoteEvent> {
+ public:
+ virtual ~LifeCycleConsumerStub() { }
+
+
+ /// This is the method that will be called on remote calls on the method LifecycleRequest.
+ virtual void LifecycleRequest(uint32_t Request, uint32_t RequestId, int32_t& ErrorCode) = 0;
+
+};
+
+} // namespace LifeCycleConsumer
+} // namespace NodeStateManager
+} // namespace genivi
+} // namespace org
+
+#endif // ORG_GENIVI_NODESTATEMANAGER_LIFECYCLECONSUMER_Life_Cycle_Consumer_STUB_H_
diff --git a/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumerStubDefault.cpp b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumerStubDefault.cpp
new file mode 100644
index 0000000..92df0f0
--- /dev/null
+++ b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumerStubDefault.cpp
@@ -0,0 +1,51 @@
+/*
+* This file was generated by the CommonAPI Generators.
+*
+ * 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/.
+*/
+#include <org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumerStubDefault.h>
+
+namespace org {
+namespace genivi {
+namespace NodeStateManager {
+namespace LifeCycleConsumer {
+
+LifeCycleConsumerStubDefault::LifeCycleConsumerStubDefault():
+ remoteEventHandler_(this) {
+}
+
+LifeCycleConsumerStubRemoteEvent* LifeCycleConsumerStubDefault::initStubAdapter(const std::shared_ptr<LifeCycleConsumerStubAdapter>& stubAdapter) {
+ stubAdapter_ = stubAdapter;
+ return &remoteEventHandler_;
+}
+
+
+void LifeCycleConsumerStubDefault::LifecycleRequest(uint32_t Request, uint32_t RequestId, int32_t& ErrorCode) {
+ // No operation in default
+}
+
+
+
+LifeCycleConsumerStubDefault::RemoteEventHandler::RemoteEventHandler(LifeCycleConsumerStubDefault* defaultStub):
+ defaultStub_(defaultStub) {
+}
+
+} // namespace LifeCycleConsumer
+} // namespace NodeStateManager
+} // namespace genivi
+} // namespace org
diff --git a/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumerStubDefault.h b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumerStubDefault.h
new file mode 100644
index 0000000..6c5f402
--- /dev/null
+++ b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumerStubDefault.h
@@ -0,0 +1,74 @@
+/*
+* This file was generated by the CommonAPI Generators.
+*
+ * 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/.
+*/
+#ifndef ORG_GENIVI_NODESTATEMANAGER_LIFECYCLECONSUMER_Life_Cycle_Consumer_STUB_DEFAULT_H_
+#define ORG_GENIVI_NODESTATEMANAGER_LIFECYCLECONSUMER_Life_Cycle_Consumer_STUB_DEFAULT_H_
+
+#include <org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumerStub.h>
+
+namespace org {
+namespace genivi {
+namespace NodeStateManager {
+namespace LifeCycleConsumer {
+
+/**
+ * Provides a default implementation for LifeCycleConsumerStubRemoteEvent and
+ * LifeCycleConsumerStub. Method callbacks have an empty implementation,
+ * remote set calls on attributes will always change the value of the attribute
+ * to the one received.
+ *
+ * Override this stub if you only want to provide a subset of the functionality
+ * that would be defined for this service, and/or if you do not need any non-default
+ * behaviour.
+ */
+class LifeCycleConsumerStubDefault : public LifeCycleConsumerStub {
+ public:
+ LifeCycleConsumerStubDefault();
+
+ LifeCycleConsumerStubRemoteEvent* initStubAdapter(const std::shared_ptr<LifeCycleConsumerStubAdapter>& stubAdapter);
+
+
+ virtual void LifecycleRequest(uint32_t Request, uint32_t RequestId, int32_t& ErrorCode);
+
+
+
+ protected:
+
+ private:
+ class RemoteEventHandler: public LifeCycleConsumerStubRemoteEvent {
+ public:
+ RemoteEventHandler(LifeCycleConsumerStubDefault* defaultStub);
+
+
+ private:
+ LifeCycleConsumerStubDefault* defaultStub_;
+ };
+
+ RemoteEventHandler remoteEventHandler_;
+ std::shared_ptr<LifeCycleConsumerStubAdapter> stubAdapter_;
+
+};
+
+} // namespace LifeCycleConsumer
+} // namespace NodeStateManager
+} // namespace genivi
+} // namespace org
+
+#endif // ORG_GENIVI_NODESTATEMANAGER_LIFECYCLECONSUMER_Life_Cycle_Consumer_STUB_DEFAULT_H_
diff --git a/AudioManagerDaemon/src/CAmCommonAPIWrapper.cpp b/AudioManagerDaemon/src/CAmCommonAPIWrapper.cpp
new file mode 100644
index 0000000..28103de
--- /dev/null
+++ b/AudioManagerDaemon/src/CAmCommonAPIWrapper.cpp
@@ -0,0 +1,275 @@
+/**
+ * Copyright (C) 2012, BMW AG
+ *
+ * \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.
+ *
+ * \file CAmCommonAPIWrapper.cpp
+ * For further information see http://www.genivi.org/.
+ */
+
+
+#include <config.h>
+#include <fstream>
+#include <sstream>
+#include <string>
+#include <algorithm>
+#include <cassert>
+#include <cstdlib>
+#include <stdexcept>
+#include <poll.h>
+#include <tuple>
+#include "audiomanagertypes.h"
+#include "shared/CAmSocketHandler.h"
+#include "shared/CAmDltWrapper.h"
+#include "shared/CAmCommonAPIWrapper.h"
+
+
+namespace am
+{
+static CAmCommonAPIWrapper* pSingleCommonAPIInstance = NULL;
+
+
+using namespace CommonAPI;
+
+CAmCommonAPIWrapper::CAmCommonAPIWrapper(CAmSocketHandler* socketHandler):
+ pCommonPrepareCallback(this,&CAmCommonAPIWrapper::commonPrepareCallback), //
+ pCommonDispatchCallback(this, &CAmCommonAPIWrapper::commonDispatchCallback), //
+ pCommonFireCallback(this, &CAmCommonAPIWrapper::commonFireCallback), //
+ pCommonCheckCallback(this, &CAmCommonAPIWrapper::commonCheckCallback), //
+ pCommonTimerCallback(this, &CAmCommonAPIWrapper::commonTimerCallback), //
+ mpSocketHandler(socketHandler), //
+ mWatchToCheck(NULL)
+{
+ assert(NULL!=socketHandler);
+//1. Load the runtime
+ std::shared_ptr<CommonAPI::Runtime> runtime = CommonAPI::Runtime::load();
+//2. Get the context and store a pointer to it
+ mContext = runtime->getNewMainLoopContext();
+//3. Make subscriptions
+ mDispatchSourceListenerSubscription = mContext->subscribeForDispatchSources(
+ std::bind(&CAmCommonAPIWrapper::registerDispatchSource, this, std::placeholders::_1, std::placeholders::_2),
+ std::bind(&CAmCommonAPIWrapper::deregisterDispatchSource, this, std::placeholders::_1));
+ mWatchListenerSubscription = mContext->subscribeForWatches(
+ std::bind(&CAmCommonAPIWrapper::registerWatch, this, std::placeholders::_1, std::placeholders::_2),
+ std::bind(&CAmCommonAPIWrapper::deregisterWatch, this, std::placeholders::_1));
+ mTimeoutSourceListenerSubscription = mContext->subscribeForTimeouts(
+ std::bind(&CAmCommonAPIWrapper::registerTimeout, this, std::placeholders::_1, std::placeholders::_2),
+ std::bind(&CAmCommonAPIWrapper::deregisterTimeout, this, std::placeholders::_1));
+//4. Create the factory
+ std::shared_ptr<CommonAPI::Factory> factory = runtime->createFactory(mContext);
+ assert(factory);
+ logInfo(__PRETTY_FUNCTION__,"CommonAPI -> Factory created");
+ mFactory = factory;
+//5. Get the publisher V.2.1
+// std::shared_ptr<CommonAPI::ServicePublisher> servicePublisher = runtime->getServicePublisher();
+// assert(servicePublisher);
+// logInfo(__PRETTY_FUNCTION__,"CommonAPI -> Publisher available");
+//6. Instantiate your concrete stub implementations
+// std::shared_ptr<StubImpl> theStub = std::make_shared<StubImpl>(1);
+//7. Register the services
+// std::string capiAddress("local:org.genivi.audiomanager.sourcestate:de.bmw.infotainment.broadcast.ta");
+// registerStub(theStub, capiAddress);
+}
+
+CAmCommonAPIWrapper::~CAmCommonAPIWrapper()
+{
+ mContext->unsubscribeForDispatchSources(mDispatchSourceListenerSubscription);
+ mContext->unsubscribeForWatches(mWatchListenerSubscription);
+ mContext->unsubscribeForTimeouts(mTimeoutSourceListenerSubscription);
+//The following objects must be released in the given order.
+ mFactory.reset();
+ mContext.reset();
+
+ mpSocketHandler = NULL;
+ mWatchToCheck = NULL;
+}
+
+CAmCommonAPIWrapper* CAmCommonAPIWrapper::instantiateOnce(CAmSocketHandler* socketHandler)
+{
+ if(NULL==pSingleCommonAPIInstance)
+ {
+ if(NULL==socketHandler)
+ throw std::runtime_error(std::string("Expected a valid socket handler. The socket handler pointer must not be NULL."));
+ else
+ pSingleCommonAPIInstance = new CAmCommonAPIWrapper(socketHandler);
+ }
+ else
+ throw std::logic_error(std::string("The singleton instance has been already instantiated. This method should be called only once."));
+ return pSingleCommonAPIInstance;
+}
+
+CAmCommonAPIWrapper* CAmCommonAPIWrapper::getInstance()
+{
+ assert(NULL!=pSingleCommonAPIInstance);
+ return pSingleCommonAPIInstance;
+}
+
+std::shared_ptr<CommonAPI::Factory> CAmCommonAPIWrapper::factory() const
+{
+ return mFactory;
+}
+
+
+std::shared_ptr<CommonAPI::Runtime> CAmCommonAPIWrapper::runtime() const
+{
+ return mFactory->getRuntime();
+}
+
+bool CAmCommonAPIWrapper::commonDispatchCallback(const sh_pollHandle_t handle, void *userData)
+{
+ (void) handle;
+ (void) userData;
+
+ std::list<DispatchSource*>::iterator iterator(mSourcesToDispatch.begin());
+ for(;iterator!=mSourcesToDispatch.end();)
+ {
+ DispatchSource* source = *iterator;
+ if (!source->dispatch()) {
+ iterator=mSourcesToDispatch.erase(iterator);
+ }
+ else
+ iterator++;
+ }
+ if (!mSourcesToDispatch.empty())
+ return (true);
+
+ return false;
+}
+
+bool CAmCommonAPIWrapper::commonCheckCallback(const sh_pollHandle_t, void *)
+{
+ std::vector<DispatchSource*> vecDispatch=mWatchToCheck->getDependentDispatchSources();
+ mSourcesToDispatch.insert(mSourcesToDispatch.end(), vecDispatch.begin(), vecDispatch.end());
+
+ return (mWatchToCheck || !mSourcesToDispatch.empty());
+}
+
+void CAmCommonAPIWrapper::commonFireCallback(const pollfd pollfd, const sh_pollHandle_t, void *)
+{
+ mWatchToCheck=NULL;
+ try
+ {
+ mWatchToCheck=mMapWatches.at(pollfd.fd);
+ }
+ catch (const std::out_of_range& error) {
+ logInfo(__PRETTY_FUNCTION__,error.what());
+ return;
+ }
+
+ mWatchToCheck->dispatch(pollfd.events);
+}
+
+void CAmCommonAPIWrapper::commonPrepareCallback(const sh_pollHandle_t, void*)
+{
+ for (auto dispatchSourceIterator = mRegisteredDispatchSources.begin();
+ dispatchSourceIterator != mRegisteredDispatchSources.end();
+ dispatchSourceIterator++)
+ {
+ int64_t dispatchTimeout(TIMEOUT_INFINITE);
+ if(dispatchSourceIterator->second->prepare(dispatchTimeout))
+ {
+ while (dispatchSourceIterator->second->dispatch());
+ }
+ }
+}
+
+void CAmCommonAPIWrapper::registerDispatchSource(DispatchSource* dispatchSource, const DispatchPriority dispatchPriority)
+{
+ mRegisteredDispatchSources.insert({dispatchPriority, dispatchSource});
+}
+
+void CAmCommonAPIWrapper::deregisterDispatchSource(DispatchSource* dispatchSource)
+{
+ for(auto dispatchSourceIterator = mRegisteredDispatchSources.begin();
+ dispatchSourceIterator != mRegisteredDispatchSources.end();
+ dispatchSourceIterator++) {
+
+ if(dispatchSourceIterator->second == dispatchSource) {
+ mRegisteredDispatchSources.erase(dispatchSourceIterator);
+ break;
+ }
+ }
+}
+
+void CAmCommonAPIWrapper::deregisterWatch(Watch* watch)
+{
+ logInfo(__PRETTY_FUNCTION__);
+ for(std::map<int,Watch*>::iterator iter(mMapWatches.begin());iter!=mMapWatches.end();iter++)
+ {
+ if (iter->second == watch)
+ {
+ mMapWatches.erase(iter);
+ break;
+ }
+ }
+}
+
+void CAmCommonAPIWrapper::registerTimeout(Timeout* timeout, const DispatchPriority)
+{
+ logInfo(__PRETTY_FUNCTION__);
+ timespec pollTimeout;
+ int64_t localTimeout = timeout->getTimeoutInterval();
+
+ pollTimeout.tv_sec = localTimeout / 1000;
+ pollTimeout.tv_nsec = (localTimeout % 1000) * 1000000;
+
+ //prepare handle and callback. new is eval, but there is no other choice because we need the pointer!
+ sh_timerHandle_t handle;
+ timerHandles myHandle({handle,timeout});
+ mpListTimerhandles.push_back(myHandle);
+
+ //add the timer to the pollLoop
+ mpSocketHandler->addTimer(pollTimeout, &pCommonTimerCallback, handle, timeout);
+
+ return;
+}
+
+void CAmCommonAPIWrapper::deregisterTimeout(Timeout* timeout)
+{
+ logInfo(__PRETTY_FUNCTION__);
+ for( std::vector<timerHandles>::iterator iter(mpListTimerhandles.begin());iter!=mpListTimerhandles.end();iter++)
+ {
+ if(iter->timeout==timeout)
+ {
+ mpSocketHandler->removeTimer(iter->handle);
+ }
+ }
+}
+
+void CAmCommonAPIWrapper::registerWatch(Watch* watch, const DispatchPriority)
+{
+ logInfo(__PRETTY_FUNCTION__);
+ pollfd pollfd_ (watch->getAssociatedFileDescriptor());
+ sh_pollHandle_t handle (0);
+
+ am_Error_e error = mpSocketHandler->addFDPoll(pollfd_.fd, pollfd_.events, &pCommonPrepareCallback, &pCommonFireCallback, &pCommonCheckCallback, &pCommonDispatchCallback, watch, handle);
+
+ //if everything is alright, add the watch and the handle to our map so we know this relationship
+ if (error == !am_Error_e::E_OK || handle == 0)
+ logError(__PRETTY_FUNCTION__,"entering watch failed");
+
+ mMapWatches.insert(std::make_pair(pollfd_.fd,watch));
+}
+
+void CAmCommonAPIWrapper::commonTimerCallback(sh_timerHandle_t handle, void *)
+{
+ for( std::vector<timerHandles>::iterator iter(mpListTimerhandles.begin());iter!=mpListTimerhandles.end();iter++)
+ {
+ if(iter->handle==handle)
+ {
+ iter->timeout->dispatch();
+ }
+ }
+}
+
+}
diff --git a/AudioManagerDaemon/src/CAmDatabaseHandlerMap.cpp b/AudioManagerDaemon/src/CAmDatabaseHandlerMap.cpp
index ba19641..3e83cc5 100644
--- a/AudioManagerDaemon/src/CAmDatabaseHandlerMap.cpp
+++ b/AudioManagerDaemon/src/CAmDatabaseHandlerMap.cpp
@@ -2418,7 +2418,7 @@ am_Error_e CAmDatabaseHandlerMap::getRoutingTree(bool onlyfree, CAmRoutingTree&
{
if(!onlyfree || std::find_if(mMappedData.mConnectionMap.begin(),
mMappedData.mConnectionMap.end(),
- [refGateway](const std::pair<am_connectionID_t, am_Connection_Database_s>& refConnection)
+ [&](const std::pair<am_connectionID_t, am_Connection_Database_s>& refConnection)
{
return (refConnection.second.sinkID == refGateway.second.sinkID ||
refConnection.second.sourceID ==refGateway.second.sourceID);
diff --git a/AudioManagerDaemon/src/CAmDbusWrapper.cpp b/AudioManagerDaemon/src/CAmDbusWrapper.cpp
index 18cf70b..c9c26a4 100644
--- a/AudioManagerDaemon/src/CAmDbusWrapper.cpp
+++ b/AudioManagerDaemon/src/CAmDbusWrapper.cpp
@@ -48,10 +48,10 @@ DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE \
CAmDbusWrapper* CAmDbusWrapper::mpReference = NULL;
CAmDbusWrapper::CAmDbusWrapper(CAmSocketHandler* socketHandler, DBusBusType type) :
+ pDbusPrepareCallback(this,&CAmDbusWrapper::dbusPrepareCallback), //
pDbusDispatchCallback(this, &CAmDbusWrapper::dbusDispatchCallback), //
pDbusFireCallback(this, &CAmDbusWrapper::dbusFireCallback), //
pDbusCheckCallback(this, &CAmDbusWrapper::dbusCheckCallback), //
- pDbusPrepareCallback(this,&CAmDbusWrapper::dbusPrepareCallback), //
pDbusTimerCallback(this, &CAmDbusWrapper::dbusTimerCallback), //
mpDbusConnection(0), //
mDBusError(), //
diff --git a/AudioManagerDaemon/src/CAmNodeStateCommunicatorCAPI.cpp b/AudioManagerDaemon/src/CAmNodeStateCommunicatorCAPI.cpp
new file mode 100644
index 0000000..3761fca
--- /dev/null
+++ b/AudioManagerDaemon/src/CAmNodeStateCommunicatorCAPI.cpp
@@ -0,0 +1,361 @@
+/**
+ * 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
+ *
+ * \file CAmNodeStateCommunicatorCAPI.cpp
+ * For further information see http://www.genivi.org/.
+ *
+ */
+
+#include <assert.h>
+#include <string>
+#include <fstream>
+#include <sstream>
+#include <stdexcept>
+#include <functional>
+#include <memory>
+#include <CommonAPI/CommonAPI.h>
+#include "config.h"
+#include "shared/CAmCommonAPIWrapper.h"
+#include "shared/CAmDltWrapper.h"
+#include "CAmNodeStateCommunicatorCAPI.h"
+#include "CAmControlSender.h"
+#include "LifeCycleConsumer.h"
+
+
+
+
+namespace am
+{
+
+const char * CAmNodeStateCommunicatorCAPI::CLIENT_STRING = "local:org.genivi.NodeStateManager.Consumer:org.genivi.NodeStateManager";
+const char * CAmNodeStateCommunicatorCAPI::SERVER_STRING = "local:org.genivi.NodeStateManager.LifeCycleConsumer:org.genivi.audiomanger";
+
+const char * CAmNodeStateCommunicatorCAPI::OBJECT_NAME = "/org/genivi/audiomanager/LifeCycleConsumer";
+const char * CAmNodeStateCommunicatorCAPI::BUS_NAME = "org.genivi.audiomanager";
+
+
+#define IF_NOT_AVAILABLE_RETURN(error) \
+if(!mIsServiceAvailable) { logError(__PRETTY_FUNCTION__, "Node State Manager not available yet"); return error; }
+
+/**
+ * Retrieves the value from given attribute wrapper.
+ */
+template <typename TValueReturnType, class TValueClass> am_Error_e getAttributeValue(Attribute<TValueClass>* attribute, TValueReturnType & resultValue)
+{
+ CallStatus status;
+ typename Attribute<TValueClass>::ValueType value;
+ attribute->getValue(status, value);
+ std::cout << std::endl << "CallStatus : " << static_cast<int>(status) << std::endl;
+ if( CallStatus::SUCCESS == status)
+ {
+ resultValue = static_cast<TValueReturnType>(value);
+ return E_OK;
+ }
+ return E_UNKNOWN;
+}
+
+
+CAmNodeStateCommunicatorCAPI::CAmNodeStateCommunicatorCAPI(CAmCommonAPIWrapper* iCAPIWrapper) :
+ CAmNodeStateCommunicator(),
+ mpCAPIWrapper(iCAPIWrapper),
+ mIsServiceAvailable(false)
+{
+ assert(mpCAPIWrapper);
+ logInfo("CAmNodeStateCommunicatorCAPI::CAmNodeStateCommunicatorCAPI started");
+
+ //Gets the factory pointer and build a proxy object
+ std::shared_ptr<CommonAPI::Factory> factory = iCAPIWrapper->factory();
+ mNSMProxy = factory->buildProxy<ConsumerProxy>(CAmNodeStateCommunicatorCAPI::CLIENT_STRING);
+
+ //Makes subscriptions to the following 3 events
+ mNSMProxy->getNodeStateEvent().subscribe(
+ std::bind(&CAmNodeStateCommunicatorCAPI::onNodeStateEvent, this, std::placeholders::_1)
+ );
+ mNSMProxy->getNodeApplicationModeEvent().subscribe(
+ std::bind(&CAmNodeStateCommunicatorCAPI::onNodeApplicationModeEvent, this, std::placeholders::_1)
+ );
+ mNSMProxy->getSessionStateChangedEvent().subscribe(
+ std::bind(&CAmNodeStateCommunicatorCAPI::onSessionStateChangedEvent, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)
+ );
+ mNSMProxy->getProxyStatusEvent().subscribe(std::bind(&CAmNodeStateCommunicatorCAPI::onServiceStatusEvent,this,std::placeholders::_1));
+ //Instantiates the concrete stub implementation
+ mNSMStub = std::make_shared<CAmNodeStateCommunicatorCAPI::CAmNodeStateCommunicatorServiceImpl>(this);
+
+ //Registers the service
+ iCAPIWrapper->registerStub(mNSMStub, CAmNodeStateCommunicatorCAPI::SERVER_STRING);
+}
+
+CAmNodeStateCommunicatorCAPI::~CAmNodeStateCommunicatorCAPI()
+{
+ mNSMProxy.reset();
+ mpCAPIWrapper->unregisterStub(CAmNodeStateCommunicatorCAPI::SERVER_STRING);
+ mNSMStub->setDelegate(NULL);
+ mNSMStub.reset();
+ mpCAPIWrapper = NULL;
+}
+
+bool CAmNodeStateCommunicatorCAPI::isServiceAvailable()
+{
+ return mIsServiceAvailable;
+}
+
+/** retrieves the actual restart reason
+ *
+ * @param restartReason
+ * @return E_OK on success
+ */
+am_Error_e CAmNodeStateCommunicatorCAPI::nsmGetRestartReasonProperty(NsmRestartReason_e& restartReason)
+{
+ //Check the service via the proxy object is available
+ IF_NOT_AVAILABLE_RETURN(E_NOT_POSSIBLE)
+ //Get the attribute
+ return getAttributeValue(&mNSMProxy->getRestartReasonAttribute(), restartReason);
+}
+
+/** retrieves the actual shutdown reason
+ *
+ * @param ShutdownReason
+ * @return E_OK on success
+ */
+am_Error_e CAmNodeStateCommunicatorCAPI::nsmGetShutdownReasonProperty(NsmShutdownReason_e& ShutdownReason)
+{
+ //Check the service via the proxy object is available
+ IF_NOT_AVAILABLE_RETURN(E_NOT_POSSIBLE)
+ //Get the attribute
+ return getAttributeValue(&mNSMProxy->getShutdownReasonAttribute(), ShutdownReason);
+}
+
+/** retrieves the actual running reason
+ *
+ * @param nsmRunningReason
+ * @return E_OK on success
+ */
+am_Error_e CAmNodeStateCommunicatorCAPI::nsmGetRunningReasonProperty(NsmRunningReason_e& nsmRunningReason)
+{
+ //Check the service via the proxy object is available
+ IF_NOT_AVAILABLE_RETURN(E_NOT_POSSIBLE)
+ //Get the attribute
+ return getAttributeValue(&mNSMProxy->getWakeUpReasonAttribute(), nsmRunningReason);
+}
+
+/** gets the node state
+ *
+ * @param nsmNodeState
+ * @return NsmErrorStatus_Ok on success
+ */
+NsmErrorStatus_e CAmNodeStateCommunicatorCAPI::nsmGetNodeState(NsmNodeState_e& nsmNodeState)
+{
+ //Check the service via the proxy object is available
+ IF_NOT_AVAILABLE_RETURN(NsmErrorStatus_Error)
+
+ CallStatus callStatus;
+ int32_t tmpNodeState = 0, errorCode = 0;
+ mNSMProxy->GetNodeState(callStatus, tmpNodeState, errorCode);
+ if( CallStatus::SUCCESS == callStatus )
+ {
+ nsmNodeState = static_cast<NsmNodeState_e>(tmpNodeState);
+ return (static_cast<NsmErrorStatus_e>(errorCode));
+ }
+ return NsmErrorStatus_Error;
+}
+
+/** gets the session state for a session and seatID
+ *
+ * @param sessionName the name of the session
+ * @param seatID the seatID
+ * @param sessionState
+ * @return NsmErrorStatus_Ok on success
+ */
+NsmErrorStatus_e CAmNodeStateCommunicatorCAPI::nsmGetSessionState(const std::string& sessionName, const NsmSeat_e& seatID, NsmSessionState_e& sessionState)
+{
+ //Check the service via the proxy object is available
+ IF_NOT_AVAILABLE_RETURN(NsmErrorStatus_Error)
+
+ CallStatus callStatus;
+ int32_t tmpSessionState = 0 , errorCode = 0;
+ mNSMProxy->GetSessionState(sessionName, seatID, callStatus, tmpSessionState, errorCode);
+
+ if( CallStatus::SUCCESS == callStatus)
+ {
+ sessionState = static_cast<NsmSessionState_e>(tmpSessionState);
+ return (static_cast<NsmErrorStatus_e>(errorCode));
+ }
+ return NsmErrorStatus_Error;
+}
+
+/** gets the application mode
+ *
+ * @param applicationMode
+ * @return NsmErrorStatus_Ok on success
+ */
+NsmErrorStatus_e CAmNodeStateCommunicatorCAPI::nsmGetApplicationMode(NsmApplicationMode_e& applicationMode)
+{
+ //Check the service via the proxy object is available
+ IF_NOT_AVAILABLE_RETURN(NsmErrorStatus_Error)
+
+ CallStatus callStatus;
+ int32_t tmpAppMode = 0 , errorCode = 0;
+ mNSMProxy->GetApplicationMode(callStatus, tmpAppMode, errorCode);
+ if( CallStatus::SUCCESS == callStatus)
+ {
+ applicationMode = static_cast<NsmApplicationMode_e>(tmpAppMode);
+ return (static_cast<NsmErrorStatus_e>(errorCode));
+ }
+ return NsmErrorStatus_Dbus;
+}
+
+/** this function registers the AudioManager as shutdown client at the NSM
+ * for more information check the Nodestatemanager
+ * @param shutdownMode the shutdownmode you wish to set
+ * @param timeoutMs the timeout you need to have
+ * @return NsmErrorStatus_Ok on success
+ */
+NsmErrorStatus_e CAmNodeStateCommunicatorCAPI::nsmRegisterShutdownClient(const uint32_t shutdownMode, const uint32_t timeoutMs)
+{
+ //Check the service via the proxy object is available
+ IF_NOT_AVAILABLE_RETURN(NsmErrorStatus_Error)
+
+ CallStatus callStatus;
+ int32_t errorCode = 0;
+ std::string objName = std::string(CAmNodeStateCommunicatorCAPI::OBJECT_NAME);
+ std::string busName = std::string(CAmNodeStateCommunicatorCAPI::BUS_NAME);
+ mNSMProxy->RegisterShutdownClient(busName, objName, shutdownMode, timeoutMs, callStatus, errorCode);
+ if( CallStatus::SUCCESS == callStatus)
+ return (static_cast<NsmErrorStatus_e>(errorCode));
+ return NsmErrorStatus_Dbus;
+
+}
+
+/** this function unregisters the AudioManager as shutdown client at the NSM
+ *
+ * @param shutdownMode
+ * @return NsmErrorStatus_Ok on success
+ */
+NsmErrorStatus_e CAmNodeStateCommunicatorCAPI::nsmUnRegisterShutdownClient(const uint32_t shutdownMode)
+{
+ //Check the service via the proxy object is available
+ IF_NOT_AVAILABLE_RETURN(NsmErrorStatus_Error)
+
+ CallStatus callStatus;
+ int32_t errorCode = 0;
+ std::string objName = std::string(CAmNodeStateCommunicatorCAPI::OBJECT_NAME);
+ std::string busName = std::string(CAmNodeStateCommunicatorCAPI::BUS_NAME);
+ mNSMProxy->UnRegisterShutdownClient(busName, objName, shutdownMode, callStatus, errorCode);
+ if( CallStatus::SUCCESS == callStatus)
+ return (static_cast<NsmErrorStatus_e>(errorCode));
+ return NsmErrorStatus_Dbus;
+}
+
+/** returns the interface version
+ *
+ * @param version
+ * @return E_OK on success
+ */
+am_Error_e CAmNodeStateCommunicatorCAPI::nsmGetInterfaceVersion(uint32_t& version)
+{
+ //Check the service via the proxy object is available
+ IF_NOT_AVAILABLE_RETURN(E_NOT_POSSIBLE)
+
+ CallStatus callStatus;
+ mNSMProxy->GetInterfaceVersion(callStatus, version);
+ if( CallStatus::SUCCESS == callStatus)
+ return E_OK;
+ return E_UNKNOWN;
+}
+
+/** sends out the Lifecycle request complete message
+ *
+ * @param RequestId
+ * @param status
+ * @return NsmErrorStatus_Ok on success
+ */
+NsmErrorStatus_e CAmNodeStateCommunicatorCAPI::nsmSendLifecycleRequestComplete(const uint32_t RequestId, const NsmErrorStatus_e status)
+{
+ //Check the service via the proxy object is available
+ IF_NOT_AVAILABLE_RETURN(NsmErrorStatus_Error)
+
+ CallStatus callStatus;
+ int32_t errorCode = 0;
+ mNSMProxy->LifecycleRequestComplete(RequestId, status, callStatus, errorCode);
+ if( CallStatus::SUCCESS == callStatus)
+ {
+ return (static_cast<NsmErrorStatus_e>(errorCode));
+ }
+ return NsmErrorStatus_Dbus;
+}
+
+/** notification handler for changed node state
+ *
+ * @param nodeState
+ * @return none
+ */
+void CAmNodeStateCommunicatorCAPI::onNodeStateEvent(const int32_t nodeState)
+{
+ logInfo(__PRETTY_FUNCTION__, " got signal NodeState, with nodeState",nodeState);
+ assert(mpControlSender);
+ mpControlSender->hookSystemNodeStateChanged(static_cast<NsmNodeState_e>(nodeState));
+}
+
+/** notification handler for changed node application mode
+ *
+ * @param nodeApplicationMode
+ * @return none
+ */
+void CAmNodeStateCommunicatorCAPI::onNodeApplicationModeEvent(const int32_t nodeApplicationMode)
+{
+ logInfo(__PRETTY_FUNCTION__, " got signal nodeApplicationMode, with applicationMode",nodeApplicationMode);
+ assert(mpControlSender);
+ mpControlSender->hookSystemNodeApplicationModeChanged(static_cast<NsmApplicationMode_e>(nodeApplicationMode));
+}
+
+/** notification handler for changed session state
+ *
+ * @param sessionName
+ * @param seatID
+ * @param sessionState
+ * @return none
+ */
+void CAmNodeStateCommunicatorCAPI::onSessionStateChangedEvent(const std::string & sessionName, const int32_t seatID, const int32_t sessionState)
+{
+ logInfo(__PRETTY_FUNCTION__, " got signal sessionStateChanged, with session",sessionName,"seatID=",seatID,"sessionState",sessionState);
+ assert(mpControlSender);
+ mpControlSender->hookSystemSessionStateChanged(sessionName, static_cast<NsmSeat_e>(seatID), static_cast<NsmSessionState_e>(sessionState));
+}
+
+void CAmNodeStateCommunicatorCAPI::onServiceStatusEvent(const CommonAPI::AvailabilityStatus& serviceStatus)
+{
+ std::stringstream avail;
+ avail << "(" << static_cast<int>(serviceStatus) << ")";
+
+ logInfo("Service Status of the NSM changed to ", avail.str());
+ std::cout << std::endl << "Service Status of the NSM changed to " << avail.str();
+ mIsServiceAvailable = (serviceStatus==CommonAPI::AvailabilityStatus::AVAILABLE);
+}
+
+/** implements the service part, which is invoked from the node state manager
+ *
+ * @param sessionName
+ * @param seatID
+ * @param sessionState
+ * @return none
+ */
+void CAmNodeStateCommunicatorCAPI::cbReceivedLifecycleRequest(uint32_t Request, uint32_t RequestId, int32_t& ErrorCode)
+{
+ assert(mpControlSender);
+ ErrorCode = mpControlSender->hookSystemLifecycleRequest(Request, RequestId);
+}
+
+} /* namespace am */
diff --git a/AudioManagerDaemon/src/CAmNodeStateCommunicator.cpp b/AudioManagerDaemon/src/CAmNodeStateCommunicatorDBus.cpp
index 689b975..4173890 100644
--- a/AudioManagerDaemon/src/CAmNodeStateCommunicator.cpp
+++ b/AudioManagerDaemon/src/CAmNodeStateCommunicatorDBus.cpp
@@ -14,29 +14,28 @@
*
* \author Christian Linke, christian.linke@bmw.de BMW 2012
*
- * \file CAmNodeStateCommunicator.cpp
+ * \file CAmNodeStateCommunicatorDBus.cpp
* For further information see http://www.genivi.org/.
*
*/
-#include "CAmNodeStateCommunicator.h"
+#include "CAmNodeStateCommunicatorDBus.h"
#include <assert.h>
#include <string>
#include <fstream>
+#include <sstream>
#include <stdexcept>
#include "CAmControlSender.h"
#include "shared/CAmDltWrapper.h"
#include "config.h"
-#include <sstream>
namespace am
{
static DBusObjectPathVTable gObjectPathVTable;
-CAmNodeStateCommunicator::CAmNodeStateCommunicator(CAmDbusWrapper* iDbusWrapper) :
+CAmNodeStateCommunicatorDBus::CAmNodeStateCommunicatorDBus(CAmDbusWrapper* iDbusWrapper) : CAmNodeStateCommunicator(),
mpDbusWrapper(iDbusWrapper), //
- mpControlSender(NULL), //
mpDBusConnection(NULL)
{
assert(mpDbusWrapper);
@@ -48,12 +47,12 @@ CAmNodeStateCommunicator::CAmNodeStateCommunicator(CAmDbusWrapper* iDbusWrapper)
//register the path and the callback for receiving messages
std::string path("LifeCycleConsumer");
- gObjectPathVTable.message_function=CAmNodeStateCommunicator::receiveCallback;
+ gObjectPathVTable.message_function=CAmNodeStateCommunicatorDBus::receiveCallback;
mpDbusWrapper->registerCallback(&gObjectPathVTable, path, this);
//now we need to make sure we catch the signals from the NSM:
dbus_bus_add_match(mpDBusConnection, "type=\'signal\',path=\'/org/genivi/NodeStateManager\'", NULL);
- if (!dbus_connection_add_filter(mpDBusConnection, CAmNodeStateCommunicator::signalCallback, this, NULL))
+ if (!dbus_connection_add_filter(mpDBusConnection, CAmNodeStateCommunicatorDBus::signalCallback, this, NULL))
{
logError("CAmNodeStateCommunicator::CAmNodeStateCommunicator not enought memory!");
throw std::runtime_error("CAmNodeStateCommunicator::CAmNodeStateCommunicator not enought memory!");
@@ -61,7 +60,7 @@ CAmNodeStateCommunicator::CAmNodeStateCommunicator(CAmDbusWrapper* iDbusWrapper)
dbus_connection_flush(mpDBusConnection);
}
-CAmNodeStateCommunicator::~CAmNodeStateCommunicator()
+CAmNodeStateCommunicatorDBus::~CAmNodeStateCommunicatorDBus()
{}
/** retrieves the actual restartReason
@@ -69,7 +68,7 @@ CAmNodeStateCommunicator::~CAmNodeStateCommunicator()
* @param restartReason
* @return E_OK on success
*/
-am_Error_e CAmNodeStateCommunicator::nsmGetRestartReasonProperty(NsmRestartReason_e& restartReason)
+am_Error_e CAmNodeStateCommunicatorDBus::nsmGetRestartReasonProperty(NsmRestartReason_e& restartReason)
{
int32_t answer(0);
am_Error_e error=readIntegerProperty("RestartReason",answer);
@@ -82,7 +81,7 @@ am_Error_e CAmNodeStateCommunicator::nsmGetRestartReasonProperty(NsmRestartReaso
* @param ShutdownReason
* @return E_OK on success
*/
-am_Error_e CAmNodeStateCommunicator::nsmGetShutdownReasonProperty(NsmShutdownReason_e& ShutdownReason)
+am_Error_e CAmNodeStateCommunicatorDBus::nsmGetShutdownReasonProperty(NsmShutdownReason_e& ShutdownReason)
{
int32_t answer(0);
am_Error_e error=readIntegerProperty("ShutdownReason",answer);
@@ -95,7 +94,7 @@ am_Error_e CAmNodeStateCommunicator::nsmGetShutdownReasonProperty(NsmShutdownRea
* @param nsmRunningReason
* @return E_OK on success
*/
-am_Error_e CAmNodeStateCommunicator::nsmGetRunningReasonProperty(NsmRunningReason_e& nsmRunningReason)
+am_Error_e CAmNodeStateCommunicatorDBus::nsmGetRunningReasonProperty(NsmRunningReason_e& nsmRunningReason)
{
int32_t answer(0);
am_Error_e error=readIntegerProperty("WakeUpReason",answer);
@@ -108,7 +107,7 @@ am_Error_e CAmNodeStateCommunicator::nsmGetRunningReasonProperty(NsmRunningReaso
* @param nsmNodeState
* @return NsmErrorStatus_Ok on success
*/
-NsmErrorStatus_e CAmNodeStateCommunicator::nsmGetNodeState(NsmNodeState_e& nsmNodeState)
+NsmErrorStatus_e CAmNodeStateCommunicatorDBus::nsmGetNodeState(NsmNodeState_e& nsmNodeState)
{
DBusError error;
dbus_error_init(&error);
@@ -120,14 +119,14 @@ NsmErrorStatus_e CAmNodeStateCommunicator::nsmGetNodeState(NsmNodeState_e& nsmNo
if (!message)
{
- logError("CAmNodeStateCommunicator::nsmGetNodeState dbus error:", error.message);
+ logError("CAmNodeStateCommunicatorDBus::nsmGetNodeState dbus error:", error.message);
return (NsmErrorStatus_Dbus);
}
DBusMessage* reply(dbus_connection_send_with_reply_and_block(mpDBusConnection, message, -1, &error));
if (!reply)
{
- logError("CAmNodeStateCommunicator::nsmGetNodeState failed, dbus error", error.message);
+ logError("CAmNodeStateCommunicatorDBus::nsmGetNodeState failed, dbus error", error.message);
return (NsmErrorStatus_Dbus);
}
@@ -147,7 +146,7 @@ NsmErrorStatus_e CAmNodeStateCommunicator::nsmGetNodeState(NsmNodeState_e& nsmNo
* @param sessionState
* @return NsmErrorStatus_Ok on success
*/
-NsmErrorStatus_e CAmNodeStateCommunicator::nsmGetSessionState(const std::string& sessionName, const NsmSeat_e& seatID, NsmSessionState_e& sessionState)
+NsmErrorStatus_e CAmNodeStateCommunicatorDBus::nsmGetSessionState(const std::string& sessionName, const NsmSeat_e& seatID, NsmSessionState_e& sessionState)
{
DBusError error;
dbus_error_init(&error);
@@ -160,7 +159,7 @@ NsmErrorStatus_e CAmNodeStateCommunicator::nsmGetSessionState(const std::string&
if (!message)
{
- logError("CAmNodeStateCommunicator::nsmGetSessionState dbus error:", error.message);
+ logError("CAmNodeStateCommunicatorDBus::nsmGetSessionState dbus error:", error.message);
return (NsmErrorStatus_Dbus);
}
@@ -168,20 +167,20 @@ NsmErrorStatus_e CAmNodeStateCommunicator::nsmGetSessionState(const std::string&
if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, &sessionName))
{
- logError( "CAmNodeStateCommunicator::nsmGetSessionState no more memory");
+ logError( "CAmNodeStateCommunicatorDBus::nsmGetSessionState no more memory");
return (NsmErrorStatus_Dbus);
}
if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_INT32, &seatID))
{
- logError( "CAmNodeStateCommunicator::nsmGetSessionState no more memory");
+ logError( "CAmNodeStateCommunicatorDBus::nsmGetSessionState no more memory");
return (NsmErrorStatus_Dbus);
}
DBusMessage* reply(dbus_connection_send_with_reply_and_block(mpDBusConnection, message, -1, &error));
if (!reply)
{
- logError("CAmNodeStateCommunicator::nsmGetSessionState failed, dbus error", error.message);
+ logError("CAmNodeStateCommunicatorDBus::nsmGetSessionState failed, dbus error", error.message);
return (NsmErrorStatus_Dbus);
}
@@ -201,7 +200,7 @@ NsmErrorStatus_e CAmNodeStateCommunicator::nsmGetSessionState(const std::string&
* @param applicationMode
* @return NsmErrorStatus_Ok on success
*/
-NsmErrorStatus_e CAmNodeStateCommunicator::nsmGetApplicationMode(NsmApplicationMode_e& applicationMode)
+NsmErrorStatus_e CAmNodeStateCommunicatorDBus::nsmGetApplicationMode(NsmApplicationMode_e& applicationMode)
{
DBusError error;
dbus_error_init(&error);
@@ -212,14 +211,14 @@ NsmErrorStatus_e CAmNodeStateCommunicator::nsmGetApplicationMode(NsmApplicationM
if (!message)
{
- logError("CAmNodeStateCommunicator::nsmGetApplicationMode dbus error:", error.message);
+ logError("CAmNodeStateCommunicatorDBus::nsmGetApplicationMode dbus error:", error.message);
return (NsmErrorStatus_Dbus);
}
DBusMessage* reply(dbus_connection_send_with_reply_and_block(mpDBusConnection, message, -1, &error));
if (!reply)
{
- logError("CAmNodeStateCommunicator::nsmGetApplicationMode failed, dbus error", error.message);
+ logError("CAmNodeStateCommunicatorDBus::nsmGetApplicationMode failed, dbus error", error.message);
return (NsmErrorStatus_Dbus);
}
@@ -238,7 +237,7 @@ NsmErrorStatus_e CAmNodeStateCommunicator::nsmGetApplicationMode(NsmApplicationM
* @param timeoutMs the timeout you need to have
* @return NsmErrorStatus_Ok on success
*/
-NsmErrorStatus_e CAmNodeStateCommunicator::nsmRegisterShutdownClient(const uint32_t shutdownMode, const uint32_t timeoutMs)
+NsmErrorStatus_e CAmNodeStateCommunicatorDBus::nsmRegisterShutdownClient(const uint32_t shutdownMode, const uint32_t timeoutMs)
{
DBusError error;
DBusMessageIter iter;
@@ -251,32 +250,32 @@ NsmErrorStatus_e CAmNodeStateCommunicator::nsmRegisterShutdownClient(const uint3
if (!message)
{
- logError( "CAmNodeStateCommunicator::nsmRegisterShutdownClient dbus error:", error.message);
+ logError( "CAmNodeStateCommunicatorDBus::nsmRegisterShutdownClient dbus error:", error.message);
return (NsmErrorStatus_Dbus);
}
dbus_message_iter_init_append(message, &iter);
if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, &service))
{
- logError( "CAmNodeStateCommunicator::nsmRegisterShutdownClient no more memory");
+ logError( "CAmNodeStateCommunicatorDBus::nsmRegisterShutdownClient no more memory");
return (NsmErrorStatus_Dbus);
}
if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, &charPath))
{
- logError( "CAmNodeStateCommunicator::nsmRegisterShutdownClient no more memory");
+ logError( "CAmNodeStateCommunicatorDBus::nsmRegisterShutdownClient no more memory");
return (NsmErrorStatus_Dbus);
}
if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_UINT32, &shutdownMode))
{
- logError( "CAmNodeStateCommunicator::nsmRegisterShutdownClient no more memory");
+ logError( "CAmNodeStateCommunicatorDBus::nsmRegisterShutdownClient no more memory");
return (NsmErrorStatus_Dbus);
}
if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_UINT32, &timeoutMs))
{
- logError( "CAmNodeStateCommunicator::nsmRegisterShutdownClient no more memory");
+ logError( "CAmNodeStateCommunicatorDBus::nsmRegisterShutdownClient no more memory");
return (NsmErrorStatus_Dbus);
}
@@ -305,7 +304,7 @@ NsmErrorStatus_e CAmNodeStateCommunicator::nsmRegisterShutdownClient(const uint3
* @param shutdownMode
* @return NsmErrorStatus_Ok on success
*/
-NsmErrorStatus_e CAmNodeStateCommunicator::nsmUnRegisterShutdownClient(const uint32_t shutdownMode)
+NsmErrorStatus_e CAmNodeStateCommunicatorDBus::nsmUnRegisterShutdownClient(const uint32_t shutdownMode)
{
DBusError error;
DBusMessageIter iter;
@@ -318,26 +317,26 @@ NsmErrorStatus_e CAmNodeStateCommunicator::nsmUnRegisterShutdownClient(const uin
if (!message)
{
- logError( "CAmNodeStateCommunicator::nsmUnRegisterShutdownClient dbus error:", error.message);
+ logError( "CAmNodeStateCommunicatorDBus::nsmUnRegisterShutdownClient dbus error:", error.message);
return (NsmErrorStatus_Dbus);
}
dbus_message_iter_init_append(message, &iter);
if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, &service))
{
- logError( "CAmNodeStateCommunicator::nsmUnRegisterShutdownClient no more memory");
+ logError( "CAmNodeStateCommunicatorDBus::nsmUnRegisterShutdownClient no more memory");
return (NsmErrorStatus_Dbus);
}
if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, &charPath))
{
- logError( "CAmNodeStateCommunicator::nsmUnRegisterShutdownClient no more memory");
+ logError( "CAmNodeStateCommunicatorDBus::nsmUnRegisterShutdownClient no more memory");
return (NsmErrorStatus_Dbus);
}
if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_UINT32, &shutdownMode))
{
- logError( "CAmNodeStateCommunicator::nsmUnRegisterShutdownClient no more memory");
+ logError( "CAmNodeStateCommunicatorDBus::nsmUnRegisterShutdownClient no more memory");
return (NsmErrorStatus_Dbus);
}
@@ -346,13 +345,13 @@ NsmErrorStatus_e CAmNodeStateCommunicator::nsmUnRegisterShutdownClient(const uin
if (!reply)
{
- logError( "CAmNodeStateCommunicator::nsmUnRegisterShutdownClient failed, dbus error", error.message);
+ logError( "CAmNodeStateCommunicatorDBus::nsmUnRegisterShutdownClient failed, dbus error", error.message);
return (NsmErrorStatus_Dbus);
}
if(!dbus_message_get_args(reply, &error, DBUS_TYPE_INT32, &returnError, DBUS_TYPE_INVALID))
{
- logError( "CAmNodeStateCommunicator::nsmUnRegisterShutdownClient failed, dbus error", error.message);
+ logError( "CAmNodeStateCommunicatorDBus::nsmUnRegisterShutdownClient failed, dbus error", error.message);
return (NsmErrorStatus_Dbus);
}
dbus_message_unref(reply);
@@ -365,7 +364,7 @@ NsmErrorStatus_e CAmNodeStateCommunicator::nsmUnRegisterShutdownClient(const uin
* @param version
* @return E_OK on success
*/
-am_Error_e CAmNodeStateCommunicator::nsmGetInterfaceVersion(uint32_t& version)
+am_Error_e CAmNodeStateCommunicatorDBus::nsmGetInterfaceVersion(uint32_t& version)
{
DBusError error;
dbus_error_init(&error);
@@ -374,7 +373,7 @@ am_Error_e CAmNodeStateCommunicator::nsmGetInterfaceVersion(uint32_t& version)
if (!message)
{
- logError("CAmNodeStateCommunicator::nsmGetInterfaceVersion dbus error:", error.message);
+ logError("CAmNodeStateCommunicatorDBus::nsmGetInterfaceVersion dbus error:", error.message);
return (E_UNKNOWN);
}
@@ -384,13 +383,13 @@ am_Error_e CAmNodeStateCommunicator::nsmGetInterfaceVersion(uint32_t& version)
if (!reply)
{
- logError("CAmNodeStateCommunicator::nsmGetInterfaceVersion failed, dbus error", error.message);
+ logError("CAmNodeStateCommunicatorDBus::nsmGetInterfaceVersion failed, dbus error", error.message);
return (E_UNKNOWN);
}
if(!dbus_message_get_args(reply, &error, DBUS_TYPE_UINT32, &version, DBUS_TYPE_INVALID))
{
- logError("CAmNodeStateCommunicator::nsmGetInterfaceVersion failed, dbus error", error.message);
+ logError("CAmNodeStateCommunicatorDBus::nsmGetInterfaceVersion failed, dbus error", error.message);
return (E_UNKNOWN);
}
@@ -405,7 +404,7 @@ am_Error_e CAmNodeStateCommunicator::nsmGetInterfaceVersion(uint32_t& version)
* @param status
* @return NsmErrorStatus_Ok on success
*/
-NsmErrorStatus_e CAmNodeStateCommunicator::nsmSendLifecycleRequestComplete(const uint32_t RequestId, const NsmErrorStatus_e status)
+NsmErrorStatus_e CAmNodeStateCommunicatorDBus::nsmSendLifecycleRequestComplete(const uint32_t RequestId, const NsmErrorStatus_e status)
{
DBusError error;
DBusMessageIter iter;
@@ -415,20 +414,20 @@ NsmErrorStatus_e CAmNodeStateCommunicator::nsmSendLifecycleRequestComplete(const
if (!message)
{
- logError( "CAmNodeStateCommunicator::nsmSendLifecycleRequestComplete dbus error:", error.message);
+ logError( "CAmNodeStateCommunicatorDBus::nsmSendLifecycleRequestComplete dbus error:", error.message);
return (NsmErrorStatus_Dbus);
}
dbus_message_iter_init_append(message, &iter);
if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_UINT32, &RequestId))
{
- logError( "CAmNodeStateCommunicator::nsmSendLifecycleRequestComplete no more memory");
+ logError( "CAmNodeStateCommunicatorDBus::nsmSendLifecycleRequestComplete no more memory");
return (NsmErrorStatus_Dbus);
}
if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_INT32,&status))
{
- logError( "CAmNodeStateCommunicator::nsmSendLifecycleRequestComplete no more memory");
+ logError( "CAmNodeStateCommunicatorDBus::nsmSendLifecycleRequestComplete no more memory");
return (NsmErrorStatus_Dbus);
}
@@ -437,13 +436,13 @@ NsmErrorStatus_e CAmNodeStateCommunicator::nsmSendLifecycleRequestComplete(const
if (!reply)
{
- logError( "CAmNodeStateCommunicator::nsmSendLifecycleRequestComplete failed, dbus error", error.message);
+ logError( "CAmNodeStateCommunicatorDBus::nsmSendLifecycleRequestComplete failed, dbus error", error.message);
return (NsmErrorStatus_Dbus);
}
if(!dbus_message_get_args(reply, &error,DBUS_TYPE_INT32, &returnError, DBUS_TYPE_INVALID))
{
- logError( "CAmNodeStateCommunicator::nsmSendLifecycleRequestComplete failed, dbus error", error.message);
+ logError( "CAmNodeStateCommunicatorDBus::nsmSendLifecycleRequestComplete failed, dbus error", error.message);
return (NsmErrorStatus_Dbus);
}
dbus_message_unref(reply);
@@ -451,20 +450,14 @@ NsmErrorStatus_e CAmNodeStateCommunicator::nsmSendLifecycleRequestComplete(const
return (static_cast<NsmErrorStatus_e>(returnError));
}
-void CAmNodeStateCommunicator::registerControlSender(CAmControlSender* iControlSender)
-{
- assert(iControlSender);
- mpControlSender=iControlSender;
-}
-
-DBusHandlerResult CAmNodeStateCommunicator::receiveCallback(DBusConnection* conn, DBusMessage* msg, void* user_data)
+DBusHandlerResult CAmNodeStateCommunicatorDBus::receiveCallback(DBusConnection* conn, DBusMessage* msg, void* user_data)
{
- CAmNodeStateCommunicator* instance = static_cast<CAmNodeStateCommunicator*>(user_data);
+ CAmNodeStateCommunicatorDBus* instance = static_cast<CAmNodeStateCommunicatorDBus*>(user_data);
assert(instance);
return (instance->receiveCallbackDelegate(conn,msg));
}
-DBusHandlerResult CAmNodeStateCommunicator::receiveCallbackDelegate(DBusConnection* conn, DBusMessage* msg)
+DBusHandlerResult CAmNodeStateCommunicatorDBus::receiveCallbackDelegate(DBusConnection* conn, DBusMessage* msg)
{
if (dbus_message_is_method_call(msg, DBUS_INTERFACE_INTROSPECTABLE, "Introspect"))
{
@@ -482,7 +475,7 @@ DBusHandlerResult CAmNodeStateCommunicator::receiveCallbackDelegate(DBusConnecti
DBusMessageIter iter,replyIter;
if (!dbus_message_iter_init(msg, &iter))
{
- logError("CAmNodeStateCommunicator::receiveCallbackDelegate DBus Message has no arguments!");
+ logError("CAmNodeStateCommunicatorDBus::receiveCallbackDelegate DBus Message has no arguments!");
returnMessage = dbus_message_new_error(msg,DBUS_ERROR_INVALID_ARGS, "DBUS Message has no arguments!");
sendMessage(returnMessage,msg);
return (DBUS_HANDLER_RESULT_HANDLED);
@@ -490,7 +483,7 @@ DBusHandlerResult CAmNodeStateCommunicator::receiveCallbackDelegate(DBusConnecti
if (dbus_message_iter_get_arg_type(&iter)!=DBUS_TYPE_UINT32)
{
- logError("CAmNodeStateCommunicator::receiveCallbackDelegate DBus Message has invalid arguments!");
+ logError("CAmNodeStateCommunicatorDBus::receiveCallbackDelegate DBus Message has invalid arguments!");
returnMessage = dbus_message_new_error(msg,DBUS_ERROR_INVALID_ARGS,"DBus argument is not uint32_t!");
sendMessage(returnMessage,msg);
return (DBUS_HANDLER_RESULT_HANDLED);
@@ -501,7 +494,7 @@ DBusHandlerResult CAmNodeStateCommunicator::receiveCallbackDelegate(DBusConnecti
if (dbus_message_iter_get_arg_type(&iter)!=DBUS_TYPE_UINT32)
{
- logError("CAmNodeStateCommunicator::receiveCallbackDelegate DBus Message has invalid arguments!");
+ logError("CAmNodeStateCommunicatorDBus::receiveCallbackDelegate DBus Message has invalid arguments!");
returnMessage = dbus_message_new_error(msg,DBUS_ERROR_INVALID_ARGS,"DBus argument is not uint32_t!");
sendMessage(returnMessage,msg);
return (DBUS_HANDLER_RESULT_HANDLED);
@@ -516,7 +509,7 @@ DBusHandlerResult CAmNodeStateCommunicator::receiveCallbackDelegate(DBusConnecti
if (returnMessage == NULL)
{
- logError("CAmNodeStateCommunicator::receiveCallbackDelegate Cannot allocate DBus message!");
+ logError("CAmNodeStateCommunicatorDBus::receiveCallbackDelegate Cannot allocate DBus message!");
returnMessage = dbus_message_new_error(msg,DBUS_ERROR_NO_MEMORY,"Cannot create reply!");
sendMessage(returnMessage,msg);
return (DBUS_HANDLER_RESULT_HANDLED);
@@ -526,7 +519,7 @@ DBusHandlerResult CAmNodeStateCommunicator::receiveCallbackDelegate(DBusConnecti
if (!dbus_message_iter_append_basic(&replyIter, DBUS_TYPE_INT32, &returnError))
{
- logError("CAmNodeStateCommunicator::receiveCallbackDelegate Cannot allocate DBus message!");
+ logError("CAmNodeStateCommunicatorDBus::receiveCallbackDelegate Cannot allocate DBus message!");
returnMessage = dbus_message_new_error(msg,DBUS_ERROR_NO_MEMORY,"Cannot create reply!");
}
sendMessage(returnMessage,msg);
@@ -536,7 +529,7 @@ DBusHandlerResult CAmNodeStateCommunicator::receiveCallbackDelegate(DBusConnecti
return (DBUS_HANDLER_RESULT_NOT_YET_HANDLED);
}
-void CAmNodeStateCommunicator::sendIntrospection(DBusConnection* conn, DBusMessage* msg)
+void CAmNodeStateCommunicatorDBus::sendIntrospection(DBusConnection* conn, DBusMessage* msg)
{
assert(conn != NULL);
assert(msg != NULL);
@@ -562,13 +555,13 @@ void CAmNodeStateCommunicator::sendIntrospection(DBusConnection* conn, DBusMessa
dbus_message_iter_init_append(reply, &args);
if (!dbus_message_iter_append_basic(&args, DBUS_TYPE_STRING, &string))
{
- logError( "CAmNodeStateCommunicator::sendIntrospection DBUS handler Out Of Memory!");
+ logError( "CAmNodeStateCommunicatorDBus::sendIntrospection DBUS handler Out Of Memory!");
}
// send the reply && flush the connection
if (!dbus_connection_send(conn, reply, &serial))
{
- logError( "CAmNodeStateCommunicator::sendIntrospection DBUS handler Out Of Memory!");
+ logError( "CAmNodeStateCommunicatorDBus::sendIntrospection DBUS handler Out Of Memory!");
}
dbus_connection_flush(conn);
@@ -576,22 +569,22 @@ void CAmNodeStateCommunicator::sendIntrospection(DBusConnection* conn, DBusMessa
dbus_message_unref(reply);
}
-void CAmNodeStateCommunicator::sendMessage(DBusMessage* message, DBusMessage* origMessage)
+void CAmNodeStateCommunicatorDBus::sendMessage(DBusMessage* message, DBusMessage* origMessage)
{
dbus_uint32_t serial = dbus_message_get_serial(origMessage);
if(!dbus_connection_send(mpDBusConnection, message, &serial))
{
- logError( "CAmNodeStateCommunicator::sendMessage DBUS handler Out Of Memory!");
+ logError( "CAmNodeStateCommunicatorDBus::sendMessage DBUS handler Out Of Memory!");
}
dbus_connection_flush(mpDBusConnection);
dbus_message_unref(message);
}
-DBusHandlerResult CAmNodeStateCommunicator::signalCallback(DBusConnection* conn, DBusMessage* msg, void* user_data)
+DBusHandlerResult CAmNodeStateCommunicatorDBus::signalCallback(DBusConnection* conn, DBusMessage* msg, void* user_data)
{
(void) conn;
- CAmNodeStateCommunicator* instance(static_cast<CAmNodeStateCommunicator*>(user_data));
+ CAmNodeStateCommunicatorDBus* instance(static_cast<CAmNodeStateCommunicatorDBus*>(user_data));
const char* iface = dbus_message_get_interface(msg);
if (iface==NULL)
@@ -607,19 +600,19 @@ DBusHandlerResult CAmNodeStateCommunicator::signalCallback(DBusConnection* conn,
DBusMessageIter iter;
if (!dbus_message_iter_init(msg, &iter))
{
- logError("CAmNodeStateCommunicator::signalCallback NodeState DBus Message has no arguments!");
+ logError("CAmNodeStateCommunicatorDBus::signalCallback NodeState DBus Message has no arguments!");
return (DBUS_HANDLER_RESULT_HANDLED);
}
if (dbus_message_iter_get_arg_type(&iter)!=DBUS_TYPE_INT32)
{
- logError("CAmNodeStateCommunicator::signalCallback NodeState DBus Message has invalid arguments!");
+ logError("CAmNodeStateCommunicatorDBus::signalCallback NodeState DBus Message has invalid arguments!");
return (DBUS_HANDLER_RESULT_HANDLED);
}
dbus_message_iter_get_basic(&iter, &nodeState);
- logInfo("CAmNodeStateCommunicator::signalCallback got signal NodeState, with nodeState",nodeState);
+ logInfo("CAmNodeStateCommunicatorDBus::signalCallback got signal NodeState, with nodeState",nodeState);
assert(instance->mpControlSender);
instance->mpControlSender->hookSystemNodeStateChanged(static_cast<NsmNodeState_e>(nodeState));
@@ -632,19 +625,19 @@ DBusHandlerResult CAmNodeStateCommunicator::signalCallback(DBusConnection* conn,
DBusMessageIter iter;
if (!dbus_message_iter_init(msg, &iter))
{
- logError("CAmNodeStateCommunicator::signalCallback nodeApplicationMode DBus Message has no arguments!");
+ logError("CAmNodeStateCommunicatorDBus::signalCallback nodeApplicationMode DBus Message has no arguments!");
return (DBUS_HANDLER_RESULT_HANDLED);
}
if (dbus_message_iter_get_arg_type(&iter)!=DBUS_TYPE_INT32)
{
- logError("CAmNodeStateCommunicator::signalCallback nodeApplicationMode DBus Message has invalid arguments!");
+ logError("CAmNodeStateCommunicatorDBus::signalCallback nodeApplicationMode DBus Message has invalid arguments!");
return (DBUS_HANDLER_RESULT_HANDLED);
}
dbus_message_iter_get_basic(&iter, &nodeApplicationMode);
- logInfo("CAmNodeStateCommunicator::signalCallback got signal nodeApplicationMode, with applicationMode",nodeApplicationMode);
+ logInfo("CAmNodeStateCommunicatorDBus::signalCallback got signal nodeApplicationMode, with applicationMode",nodeApplicationMode);
assert(instance->mpControlSender);
instance->mpControlSender->hookSystemNodeApplicationModeChanged(static_cast<NsmApplicationMode_e>(nodeApplicationMode));
@@ -659,13 +652,13 @@ DBusHandlerResult CAmNodeStateCommunicator::signalCallback(DBusConnection* conn,
DBusMessageIter iter;
if (!dbus_message_iter_init(msg, &iter))
{
- logError("CAmNodeStateCommunicator::signalCallback nodeApplicationMode DBus Message has no arguments!");
+ logError("CAmNodeStateCommunicatorDBus::signalCallback nodeApplicationMode DBus Message has no arguments!");
return (DBUS_HANDLER_RESULT_HANDLED);
}
if (dbus_message_iter_get_arg_type(&iter)!=DBUS_TYPE_STRING)
{
- logError("CAmNodeStateCommunicator::signalCallback nodeApplicationMode DBus Message has invalid arguments!");
+ logError("CAmNodeStateCommunicatorDBus::signalCallback nodeApplicationMode DBus Message has invalid arguments!");
return (DBUS_HANDLER_RESULT_HANDLED);
}
@@ -676,7 +669,7 @@ DBusHandlerResult CAmNodeStateCommunicator::signalCallback(DBusConnection* conn,
if (dbus_message_iter_get_arg_type(&iter)!=DBUS_TYPE_INT32)
{
- logError("CAmNodeStateCommunicator::signalCallback nodeApplicationMode DBus Message has invalid arguments!");
+ logError("CAmNodeStateCommunicatorDBus::signalCallback nodeApplicationMode DBus Message has invalid arguments!");
return (DBUS_HANDLER_RESULT_HANDLED);
}
@@ -685,14 +678,14 @@ DBusHandlerResult CAmNodeStateCommunicator::signalCallback(DBusConnection* conn,
if (dbus_message_iter_get_arg_type(&iter)!=DBUS_TYPE_INT32)
{
- logError("CAmNodeStateCommunicator::signalCallback nodeApplicationMode DBus Message has invalid arguments!");
+ logError("CAmNodeStateCommunicatorDBus::signalCallback nodeApplicationMode DBus Message has invalid arguments!");
return (DBUS_HANDLER_RESULT_HANDLED);
}
dbus_message_iter_get_basic(&iter, &sessionState);
- logInfo("CAmNodeStateCommunicator::signalCallback got signal sessionStateChanged, with session",sessionName,"seatID=",seatID,"sessionState",sessionState);
+ logInfo("CAmNodeStateCommunicatorDBus::signalCallback got signal sessionStateChanged, with session",sessionName,"seatID=",seatID,"sessionState",sessionState);
assert(instance->mpControlSender);
instance->mpControlSender->hookSystemSessionStateChanged(sessionName,seatID,sessionState);
@@ -708,7 +701,7 @@ DBusHandlerResult CAmNodeStateCommunicator::signalCallback(DBusConnection* conn,
return (DBUS_HANDLER_RESULT_NOT_YET_HANDLED);
}
-am_Error_e CAmNodeStateCommunicator::readIntegerProperty(const std::string property, int32_t& value)
+am_Error_e CAmNodeStateCommunicatorDBus::readIntegerProperty(const std::string property, int32_t& value)
{
DBusError error;
dbus_error_init(&error);
@@ -718,7 +711,7 @@ am_Error_e CAmNodeStateCommunicator::readIntegerProperty(const std::string prope
if (!message)
{
- logError("CAmNodeStateCommunicator::readIntegerProperty dbus error:", error.message);
+ logError("CAmNodeStateCommunicatorDBus::readIntegerProperty dbus error:", error.message);
dbus_message_unref(message);
return (E_UNKNOWN);
}
@@ -729,14 +722,14 @@ am_Error_e CAmNodeStateCommunicator::readIntegerProperty(const std::string prope
const char *propertyChar=property.c_str();
if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, &interface))
{
- logError("CAmNodeStateCommunicator::readIntegerProperty append error");
+ logError("CAmNodeStateCommunicatorDBus::readIntegerProperty append error");
dbus_message_unref(message);
return (E_UNKNOWN);
}
if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, &propertyChar))
{
- logError("CAmNodeStateCommunicator::readIntegerProperty append error");
+ logError("CAmNodeStateCommunicatorDBus::readIntegerProperty append error");
dbus_message_unref(message);
return (E_UNKNOWN);
}
@@ -744,21 +737,21 @@ am_Error_e CAmNodeStateCommunicator::readIntegerProperty(const std::string prope
DBusMessage* reply(dbus_connection_send_with_reply_and_block(mpDBusConnection, message, -1, &error));
if (!reply)
{
- logError("CAmNodeStateCommunicator::readIntegerProperty failed, dbus error", error.message);
+ logError("CAmNodeStateCommunicatorDBus::readIntegerProperty failed, dbus error", error.message);
dbus_message_unref(message);
return (E_UNKNOWN);
}
if(!dbus_message_iter_init(reply,&iterVariant))
{
- logError("CAmNodeStateCommunicator::readIntegerProperty failed, dbus error", error.message);
+ logError("CAmNodeStateCommunicatorDBus::readIntegerProperty failed, dbus error", error.message);
dbus_message_unref(message);
dbus_message_unref(reply);
return (E_UNKNOWN);
}
if (dbus_message_iter_get_arg_type (&iterVariant)!= DBUS_TYPE_VARIANT)
{
- logError("CAmNodeStateCommunicator::readIntegerProperty failed, dbus return type wrong");
+ logError("CAmNodeStateCommunicatorDBus::readIntegerProperty failed, dbus return type wrong");
dbus_message_unref(reply);
dbus_message_unref(message);
return (E_UNKNOWN);
@@ -767,7 +760,7 @@ am_Error_e CAmNodeStateCommunicator::readIntegerProperty(const std::string prope
dbus_message_iter_recurse (&iterVariant, &subiter);
if (dbus_message_iter_get_arg_type (&subiter)!= DBUS_TYPE_INT32)
{
- logError("CAmNodeStateCommunicator::readIntegerProperty failed, dbus return type wrong");
+ logError("CAmNodeStateCommunicatorDBus::readIntegerProperty failed, dbus return type wrong");
dbus_message_unref(reply);
dbus_message_unref(message);
return (E_UNKNOWN);
diff --git a/AudioManagerDaemon/src/CAmRoutingReceiver.cpp b/AudioManagerDaemon/src/CAmRoutingReceiver.cpp
index 116ee1a..a6c769f 100644
--- a/AudioManagerDaemon/src/CAmRoutingReceiver.cpp
+++ b/AudioManagerDaemon/src/CAmRoutingReceiver.cpp
@@ -328,12 +328,14 @@ am_Error_e CAmRoutingReceiver::peekSourceClassID(const std::string& name, am_sou
return (mpDatabaseHandler->peekSourceClassID(name, sourceClassID));
}
+#ifdef WITH_DBUS_WRAPPER
am_Error_e CAmRoutingReceiver::getDBusConnectionWrapper(CAmDbusWrapper *& dbusConnectionWrapper) const
{
-#ifdef WITH_DBUS_WRAPPER
dbusConnectionWrapper = mpDBusWrapper;
return (E_OK);
#else
+am_Error_e CAmRoutingReceiver::getDBusConnectionWrapper(CAmDbusWrapper *& ) const
+{
return (E_UNKNOWN);
#endif
}
diff --git a/AudioManagerDaemon/src/main.cpp b/AudioManagerDaemon/src/main.cpp
index 9bcc57c..c6d212e 100755
--- a/AudioManagerDaemon/src/main.cpp
+++ b/AudioManagerDaemon/src/main.cpp
@@ -32,11 +32,21 @@
#ifdef WITH_TELNET
#include "CAmTelnetServer.h"
#endif
-#ifdef WITH_DBUS_WRAPPER
- #include "shared/CAmDbusWrapper.h"
+
+#ifdef WITH_CAPI_WRAPPER
+ #include "shared/CAmCommonAPIWrapper.h"
+#else
+ #ifdef WITH_DBUS_WRAPPER
+ #include "shared/CAmDbusWrapper.h"
+ #endif
#endif
+
#ifdef WITH_NSM
- #include "CAmNodeStateCommunicator.h"
+ #ifdef WITH_DBUS_WRAPPER
+ #include "CAmNodeStateCommunicatorDBus.h"
+ #else
+ #include "CAmNodeStateCommunicatorCAPI.h"
+ #endif
#endif
#ifdef WITH_DATABASE_STORAGE
@@ -72,6 +82,7 @@
#include "shared/CAmDltWrapper.h"
#include "shared/CAmSocketHandler.h"
+
using namespace am;
DLT_DECLARE_CONTEXT(AudioManager)
@@ -309,10 +320,19 @@ void mainProgram()
//Instantiate all classes. Keep in same order !
CAmSocketHandler iSocketHandler;
+#ifdef WITH_CAPI_WRAPPER
+ //We instantiate a singleton with the current socket handler, which loads the common-api runtime.
+ CAmCommonAPIWrapper *pCAPIWrapper = CAmCommonAPIWrapper::instantiateOnce(&iSocketHandler);
+ CAmCommonAPIWrapper iDBusWrapper = *pCAPIWrapper;
+#ifdef WITH_NSM
+ CAmNodeStateCommunicatorCAPI iNodeStateCommunicator(&iDBusWrapper);
+#endif /*WITH_NSM*/
+#endif /*WITH_CAPI_WRAPPER */
+
#ifdef WITH_DBUS_WRAPPER
CAmDbusWrapper iDBusWrapper(&iSocketHandler,dbusWrapperType);
#ifdef WITH_NSM
- CAmNodeStateCommunicator iNodeStateCommunicator(&iDBusWrapper);
+ CAmNodeStateCommunicatorDBus iNodeStateCommunicator(&iDBusWrapper);
#endif /*WITH_NSM*/
#endif /*WITH_DBUS_WRAPPER */
@@ -335,18 +355,17 @@ void mainProgram()
#ifdef WITH_DBUS_WRAPPER
CAmCommandReceiver iCommandReceiver(pDatabaseHandler, &iControlSender, &iSocketHandler, &iDBusWrapper);
CAmRoutingReceiver iRoutingReceiver(pDatabaseHandler, &iRoutingSender, &iControlSender, &iSocketHandler, &iDBusWrapper);
-#ifdef WITH_NSM
- CAmControlReceiver iControlReceiver(pDatabaseHandler,&iRoutingSender,&iCommandSender,&iSocketHandler, &iRouter, &iNodeStateCommunicator);
- iNodeStateCommunicator.registerControlSender(&iControlSender);
-#else /*WITH_NSM*/
- CAmControlReceiver iControlReceiver(pDatabaseHandler,&iRoutingSender,&iCommandSender,&iSocketHandler, &iRouter);
-#endif /*WITH_NSM*/
#else /*WITH_DBUS_WRAPPER*/
- CAmCommandReceiver iCommandReceiver(pDatabaseHandler,&iControlSender,&iSocketHandler);
- CAmRoutingReceiver iRoutingReceiver(pDatabaseHandler,&iRoutingSender,&iControlSender,&iSocketHandler);
- CAmControlReceiver iControlReceiver(pDatabaseHandler,&iRoutingSender,&iCommandSender,&iSocketHandler, &iRouter);
+ CAmCommandReceiver iCommandReceiver(pDatabaseHandler,&iControlSender,&iSocketHandler);
+ CAmRoutingReceiver iRoutingReceiver(pDatabaseHandler,&iRoutingSender,&iControlSender,&iSocketHandler);
#endif /*WITH_DBUS_WRAPPER*/
+#ifdef WITH_NSM
+ CAmControlReceiver iControlReceiver(pDatabaseHandler,&iRoutingSender,&iCommandSender,&iSocketHandler, &iRouter, &iNodeStateCommunicator);
+ iNodeStateCommunicator.registerControlSender(&iControlSender);
+#else /*WITH_NSM*/
+ CAmControlReceiver iControlReceiver(pDatabaseHandler,&iRoutingSender,&iCommandSender,&iSocketHandler, &iRouter);
+#endif /*WITH_NSM*/
#ifdef WITH_TELNET
CAmTelnetServer iTelnetServer(&iSocketHandler, &iCommandSender, &iCommandReceiver, &iRoutingSender, &iRoutingReceiver, &iControlSender, &iControlReceiver, pDatabaseHandler, &iRouter, telnetport, maxConnections);
diff --git a/AudioManagerDaemon/test/AmControlInterfaceTest/CMakeLists.txt b/AudioManagerDaemon/test/AmControlInterfaceTest/CMakeLists.txt
index 86f0da2..80bfa90 100644
--- a/AudioManagerDaemon/test/AmControlInterfaceTest/CMakeLists.txt
+++ b/AudioManagerDaemon/test/AmControlInterfaceTest/CMakeLists.txt
@@ -62,7 +62,7 @@ file(GLOB CONTROL_INTERFACE_SRCS_CXX
IF(WITH_NSM)
SET (CONTROL_INTERFACE_SRCS_CXX
${CONTROL_INTERFACE_SRCS_CXX}
- "../../src/CAmNodeStateCommunicator.cpp")
+ "../../src/CAmNodeStateCommunicatorDBus.cpp")
ENDIF(WITH_NSM)
ADD_EXECUTABLE(AmControlInterfaceTest ${CONTROL_INTERFACE_SRCS_CXX})
diff --git a/AudioManagerDaemon/test/AmDatabaseHandlerTest/CMakeLists.txt b/AudioManagerDaemon/test/AmDatabaseHandlerTest/CMakeLists.txt
index 7899588..032cdbb 100644
--- a/AudioManagerDaemon/test/AmDatabaseHandlerTest/CMakeLists.txt
+++ b/AudioManagerDaemon/test/AmDatabaseHandlerTest/CMakeLists.txt
@@ -63,7 +63,7 @@ file(GLOB DATABASE_SRCS_CXX
IF(WITH_NSM)
SET (DATABASE_SRCS_CXX
${DATABASE_SRCS_CXX}
- "../../src/CAmNodeStateCommunicator.cpp")
+ "../../src/CAmNodeStateCommunicatorDBus.cpp")
ENDIF(WITH_NSM)
ADD_EXECUTABLE( AmDatabaseHandlerTest ${DATABASE_SRCS_CXX})
diff --git a/AudioManagerDaemon/test/AmMapHandlerTest/CMakeLists.txt b/AudioManagerDaemon/test/AmMapHandlerTest/CMakeLists.txt
index 0e081ae..493de6a 100644
--- a/AudioManagerDaemon/test/AmMapHandlerTest/CMakeLists.txt
+++ b/AudioManagerDaemon/test/AmMapHandlerTest/CMakeLists.txt
@@ -63,7 +63,7 @@ file(GLOB DATABASE_SRCS_CXX
IF(WITH_NSM)
SET (DATABASE_SRCS_CXX
${DATABASE_SRCS_CXX}
- "../../src/CAmNodeStateCommunicator.cpp")
+ "../../src/CAmNodeStateCommunicatorDBus.cpp")
ENDIF(WITH_NSM)
ADD_EXECUTABLE( AmMapHandlerTest ${DATABASE_SRCS_CXX})
diff --git a/AudioManagerDaemon/test/AmNodeStateCommunicatorCAPITest/CAmNodeStateCommunicatorTest.cpp b/AudioManagerDaemon/test/AmNodeStateCommunicatorCAPITest/CAmNodeStateCommunicatorTest.cpp
new file mode 100644
index 0000000..0833dde
--- /dev/null
+++ b/AudioManagerDaemon/test/AmNodeStateCommunicatorCAPITest/CAmNodeStateCommunicatorTest.cpp
@@ -0,0 +1,262 @@
+/**
+ * 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
+ *
+ * \file CAmNodeStateCommunicatorTest.cpp
+ * For further information see http://www.genivi.org/.
+ *
+ */
+
+#include "CAmNodeStateCommunicatorTest.h"
+#include "shared/CAmDltWrapper.h"
+#include "shared/CAmSocketHandler.h"
+
+#include <unistd.h>
+
+using namespace testing;
+using namespace am;
+
+static CAmEnvironment* env;
+
+
+CAmNodeStateCommunicatorTest::CAmNodeStateCommunicatorTest()
+{
+ std::cout<<"Exec path : " << EXECUTABLE_OUTPUT_PATH <<std::endl;
+}
+
+CAmNodeStateCommunicatorTest::~CAmNodeStateCommunicatorTest()
+{
+ // TODO Auto-generated destructor stub
+}
+
+/**This is the thread for the nsm python fake
+ *
+ * @param
+ */
+void* nsmThread (void*)
+{
+ system("python nsm.py");
+ return (NULL);
+}
+
+/**this is the thread the mainloop runs in
+ *
+ * @param importHandler
+ */
+void* mainLoop(void* importHandler)
+{
+ CAmSocketHandler* handler=static_cast<CAmSocketHandler*>(importHandler);
+ handler->start_listenting();
+ return (NULL);
+}
+
+
+TEST_F(CAmNodeStateCommunicatorTest, nsmChangeNodeState)
+{
+ assert(true == env->pControlInterfaceBackdoor.replaceController(&env->pControlSender,&pMockControlInterface));
+ NsmNodeState_e newstate(NsmNodeState_BaseRunning) ;
+ EXPECT_CALL(pMockControlInterface,hookSystemNodeStateChanged(newstate));
+ std::ostringstream send;
+ send<<"python send2nsm.py nodeState "<<static_cast<std::int32_t>(newstate);
+ system(send.str().c_str());
+}
+
+TEST_F(CAmNodeStateCommunicatorTest, nsmChangeApplicationMode)
+{
+ env->pControlInterfaceBackdoor.replaceController(&env->pControlSender,&pMockControlInterface);
+ NsmApplicationMode_e appmode(NsmApplicationMode_Swl) ;
+ EXPECT_CALL(pMockControlInterface,hookSystemNodeApplicationModeChanged(appmode));
+ std::ostringstream send;
+ send<<"python send2nsm.py appMode "<<static_cast<std::int32_t>(appmode);
+ system(send.str().c_str());
+}
+
+TEST_F(CAmNodeStateCommunicatorTest, nsmChangeSessionState)
+{
+ env->pControlInterfaceBackdoor.replaceController(&env->pControlSender,&pMockControlInterface);
+ std::string sessionName("mySession");
+ NsmSeat_e seatID(NsmSeat_CoDriver);
+ NsmSessionState_e sessionState(NsmSessionState_Inactive) ;
+ EXPECT_CALL(pMockControlInterface,hookSystemSessionStateChanged(sessionName,seatID,sessionState));
+ std::ostringstream send;
+ send<<"python send2nsm.py sessionState "<<sessionName<<" "<<static_cast<std::int32_t>(seatID)<<" "<<static_cast<int32_t>(sessionState);
+ system(send.str().c_str());
+}
+
+TEST_F(CAmNodeStateCommunicatorTest, getRestartReason)
+{
+ env->pControlInterfaceBackdoor.replaceController(&env->pControlSender,&pMockControlInterface);
+ NsmRestartReason_e restartReason;
+ ASSERT_EQ(E_OK,env->nsmController.nsmGetRestartReasonProperty(restartReason));
+ ASSERT_EQ(restartReason,1);
+}
+
+TEST_F(CAmNodeStateCommunicatorTest, getShutdownReason)
+{
+ env->pControlInterfaceBackdoor.replaceController(&env->pControlSender,&pMockControlInterface);
+ NsmShutdownReason_e ShutdownReason;
+ ASSERT_EQ(E_OK,env->nsmController.nsmGetShutdownReasonProperty(ShutdownReason));
+ ASSERT_EQ(ShutdownReason,2);
+}
+
+TEST_F(CAmNodeStateCommunicatorTest, getWakeUpReason)
+{
+ env->pControlInterfaceBackdoor.replaceController(&env->pControlSender,&pMockControlInterface);
+ NsmRunningReason_e WakeUpReason;
+ ASSERT_EQ(E_OK,env->nsmController.nsmGetRunningReasonProperty(WakeUpReason));
+ ASSERT_EQ(WakeUpReason,3);
+}
+
+TEST_F(CAmNodeStateCommunicatorTest, getNodeState)
+{
+ env->pControlInterfaceBackdoor.replaceController(&env->pControlSender,&pMockControlInterface);
+ NsmNodeState_e nodeState;
+ ASSERT_EQ(NsmErrorStatus_e::NsmErrorStatus_Ok,env->nsmController.nsmGetNodeState(nodeState));
+ ASSERT_EQ(nodeState,1);
+}
+
+TEST_F(CAmNodeStateCommunicatorTest, getApplicationMode)
+{
+ env->pControlInterfaceBackdoor.replaceController(&env->pControlSender,&pMockControlInterface);
+ NsmApplicationMode_e applicationMode;
+ ASSERT_EQ(NsmErrorStatus_e::NsmErrorStatus_Error,env->nsmController.nsmGetApplicationMode(applicationMode));
+ ASSERT_EQ(applicationMode,5);
+}
+
+TEST_F(CAmNodeStateCommunicatorTest, getSessionState)
+{
+ env->pControlInterfaceBackdoor.replaceController(&env->pControlSender,&pMockControlInterface);
+ std::string sessionName("mySession");
+ NsmSeat_e seatID(NsmSeat_Driver);
+ NsmSessionState_e sessionState;
+ ASSERT_EQ(NsmErrorStatus_e::NsmErrorStatus_Ok,env->nsmController.nsmGetSessionState(sessionName,seatID,sessionState));
+ ASSERT_EQ(sessionState,5);
+}
+
+TEST_F(CAmNodeStateCommunicatorTest, RegisterShutdownClient)
+{
+ env->pControlInterfaceBackdoor.replaceController(&env->pControlSender,&pMockControlInterface);
+ uint32_t shutdownmode(1), timeoutMs(100);
+ ASSERT_EQ(NsmErrorStatus_e::NsmErrorStatus_Ok,env->nsmController.nsmRegisterShutdownClient(shutdownmode,timeoutMs));
+}
+
+TEST_F(CAmNodeStateCommunicatorTest, receiveLifecycleRequest)
+{
+ env->pControlInterfaceBackdoor.replaceController(&env->pControlSender,&pMockControlInterface);
+ uint32_t shutdownmode(1);
+ uint32_t timeoutMs(100);
+ int32_t Request(1);
+ int32_t RequestID(4);
+ EXPECT_CALL(pMockControlInterface,hookSystemLifecycleRequest(_,RequestID)).WillOnce(Return(NsmErrorStatus_e::NsmErrorStatus_Ok));
+ ASSERT_EQ(NsmErrorStatus_e::NsmErrorStatus_Ok,env->nsmController.nsmRegisterShutdownClient(shutdownmode,timeoutMs));
+ std::ostringstream send;
+ send << "python send2nsm.py LifecycleRequest "<<Request<<" "<<RequestID;
+ system(send.str().c_str());
+}
+
+TEST_F(CAmNodeStateCommunicatorTest, UnRegisterShutdownClient)
+{
+ env->pControlInterfaceBackdoor.replaceController(&env->pControlSender,&pMockControlInterface);
+ uint32_t shutdownmode(1),timeoutMs(100);
+ ASSERT_EQ(NsmErrorStatus_e::NsmErrorStatus_Ok,env->nsmController.nsmRegisterShutdownClient(shutdownmode,timeoutMs));
+ ASSERT_EQ(NsmErrorStatus_e::NsmErrorStatus_Ok,env->nsmController.nsmUnRegisterShutdownClient(shutdownmode));
+
+}
+
+TEST_F(CAmNodeStateCommunicatorTest, sendLifecycleRequestComplete)
+{
+ env->pControlInterfaceBackdoor.replaceController(&env->pControlSender,&pMockControlInterface);
+ uint32_t RequestID(22);
+ NsmErrorStatus_e errorStatus(NsmErrorStatus_Internal);
+ ASSERT_EQ(NsmErrorStatus_e::NsmErrorStatus_Ok,env->nsmController.nsmSendLifecycleRequestComplete(RequestID,errorStatus));
+}
+
+TEST_F(CAmNodeStateCommunicatorTest, getInterfaceVersion)
+{
+ env->pControlInterfaceBackdoor.replaceController(&env->pControlSender,&pMockControlInterface);
+ uint32_t version(0);
+ ASSERT_EQ(E_OK,env->nsmController.nsmGetInterfaceVersion(version));
+ ASSERT_EQ(version,static_cast<uint32_t>(23));
+}
+
+void CAmNodeStateCommunicatorTest::SetUp()
+{
+}
+
+void CAmNodeStateCommunicatorTest::TearDown()
+{
+}
+
+int main(int argc, char **argv)
+{
+ CAmDltWrapper::instance()->registerApp("nsm", "nsmtest");
+ logInfo("nsmtest Test started ");
+ ::testing::InitGoogleTest(&argc, argv);
+ ::testing::Environment* const env = ::testing::AddGlobalTestEnvironment(new CAmEnvironment);
+ (void) env;
+ return RUN_ALL_TESTS();
+}
+
+CAmEnvironment::CAmEnvironment() :
+ pControlInterfaceBackdoor(),
+ pControlSender(),
+ iSocketHandler(),
+ wrapper(CAmCommonAPIWrapper::instantiateOnce(&iSocketHandler)),
+ nsmController(wrapper),
+ pNsmThread(0),
+ pMainLoopThread(0)
+{
+ env=this;
+}
+
+CAmEnvironment::~CAmEnvironment()
+{
+}
+
+void CAmEnvironment::waitUntilAvailable(unsigned short seconds = 10)
+{
+ int countTries = 0;
+ printf("\nWaiting for service");
+ while( countTries++<seconds )
+ {
+ printf(".");
+ if(nsmController.isServiceAvailable())
+ break;
+ else
+ sleep(1);
+ }
+ printf("\n");
+}
+
+void CAmEnvironment::SetUp()
+{
+ //create the nsm thread
+ pthread_create(&pNsmThread, NULL, nsmThread, NULL);
+ nsmController.registerControlSender(&pControlSender);
+ //create the mainloop thread
+ pthread_create(&pMainLoopThread, NULL, mainLoop, (void*)&iSocketHandler);
+ printf("[----------] Waiting for interface to be ready....\r\n");
+ waitUntilAvailable(10);
+}
+
+void CAmEnvironment::TearDown()
+{
+ //end the nsm per dbus
+ system("python send2nsm.py finish");
+ pthread_join(pNsmThread, NULL);
+ //end the mainloop
+ iSocketHandler.exit_mainloop();
+ pthread_join(pMainLoopThread, NULL);
+}
diff --git a/AudioManagerDaemon/test/AmNodeStateCommunicatorCAPITest/CAmNodeStateCommunicatorTest.h b/AudioManagerDaemon/test/AmNodeStateCommunicatorCAPITest/CAmNodeStateCommunicatorTest.h
new file mode 100644
index 0000000..c6a9a5a
--- /dev/null
+++ b/AudioManagerDaemon/test/AmNodeStateCommunicatorCAPITest/CAmNodeStateCommunicatorTest.h
@@ -0,0 +1,65 @@
+/**
+ * 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
+ *
+ * \file CAmNodeStateCommunicatorTest.h
+ * For further information see http://www.genivi.org/.
+ *
+ */
+
+
+#ifndef CAMNODESTATECOMMUNICATORTEST_H_
+#define CAMNODESTATECOMMUNICATORTEST_H_
+
+#include "CAmNodeStateCommunicatorCAPI.h"
+#include "CAmControlSender.h"
+#include "gtest/gtest.h"
+#include "gmock/gmock.h"
+#include "../IAmControlBackdoor.h"
+#include "../MockIAmControlSend.h"
+#include "shared/CAmCommonAPIWrapper.h"
+
+using namespace testing;
+using namespace am;
+
+class CAmEnvironment : public ::testing::Environment
+{
+public:
+ IAmControlBackdoor pControlInterfaceBackdoor;
+ CAmControlSender pControlSender;
+ CAmSocketHandler iSocketHandler;
+ CAmCommonAPIWrapper *wrapper;
+ CAmNodeStateCommunicatorCAPI nsmController;
+ pthread_t pNsmThread, pMainLoopThread;
+ CAmEnvironment();
+ ~CAmEnvironment();
+ void SetUp();
+ // Override this to define how to tear down the environment.
+ void TearDown();
+ void waitUntilAvailable(unsigned short seconds);
+};
+
+class CAmNodeStateCommunicatorTest:public ::testing::Test
+{
+public:
+ MockIAmControlSend pMockControlInterface;
+ CAmNodeStateCommunicatorTest();
+ virtual ~CAmNodeStateCommunicatorTest();
+ void SetUp();
+ void TearDown();
+};
+
+
+#endif /* CAMNODESTATECOMMUNICATORTEST_H_ */
diff --git a/AudioManagerDaemon/test/AmNodeStateCommunicatorCAPITest/CMakeLists.txt b/AudioManagerDaemon/test/AmNodeStateCommunicatorCAPITest/CMakeLists.txt
new file mode 100644
index 0000000..4817c24
--- /dev/null
+++ b/AudioManagerDaemon/test/AmNodeStateCommunicatorCAPITest/CMakeLists.txt
@@ -0,0 +1,119 @@
+# 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(AmNodeStateCommunicatorCAPITest)
+
+set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -DUNIT_TEST=1")
+
+set(STD_INCLUDE_DIRS "/usr/include")
+SET(COMMON_API_SRC_GEN "../../src-gen/")
+set(EXECUTABLE_OUTPUT_PATH ${TEST_EXECUTABLE_OUTPUT_PATH})
+
+FIND_PACKAGE(Threads)
+FIND_PACKAGE(PkgConfig)
+pkg_check_modules(SQLITE REQUIRED sqlite3)
+
+FIND_PACKAGE(CommonAPI REQUIRED)
+FIND_PACKAGE(CommonAPI_DBus 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}
+ ${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}
+)
+
+
+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})
+
+TARGET_LINK_LIBRARIES(AmNodeStateCommunicatorCAPITest
+ ${SQLITE_LIBRARIES}
+ ${DLT_LIBRARIES}
+ ${CMAKE_DL_LIBS}
+ ${CMAKE_THREAD_LIBS_INIT}
+ ${PYTHON_LIBRARY}
+ ${COMMON_API_LIBRARIES}
+ ${COMMON_API_DBUS_LIBRARIES}
+ gtest
+ gmock
+)
+
+ADD_DEPENDENCIES(AmNodeStateCommunicatorCAPITest gtest gmock)
+
+INSTALL(TARGETS AmNodeStateCommunicatorCAPITest
+ DESTINATION "~/AudioManagerTest/"
+ PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
+ COMPONENT tests
+)
+
+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/"
+ PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
+ COMPONENT tests
+)
+
+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}")
+
diff --git a/AudioManagerDaemon/test/AmNodeStateCommunicatorCAPITest/nsm.py b/AudioManagerDaemon/test/AmNodeStateCommunicatorCAPITest/nsm.py
new file mode 100644
index 0000000..74dae54
--- /dev/null
+++ b/AudioManagerDaemon/test/AmNodeStateCommunicatorCAPITest/nsm.py
@@ -0,0 +1,179 @@
+# -*- coding: utf-8 -*-
+#
+# 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 Linke, christian.linke@bmw.de BMW 2012
+#
+# For further information see http://www.genivi.org/.
+#
+
+import sys
+import traceback
+import gobject
+import math
+import dbus
+import dbus.service
+import dbus.mainloop.glib
+
+loop = gobject.MainLoop()
+dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
+
+class NodeStateManager(dbus.service.Object):
+ def __init__(self, loop):
+ busName = dbus.service.BusName('org.genivi.NodeStateManager', bus = dbus.SessionBus())
+ dbus.service.Object.__init__(self, busName, '/org/genivi/NodeStateManager')
+ self.properties = {'RestartReason': 1, 'ShutdownReason': 2, 'WakeUpReason' :3, 'BootMode' :4}
+ self.ABus=""
+ self.APath=""
+ self.loop=loop
+
+ @dbus.service.method(dbus_interface='org.freedesktop.DBus.Introspectable', out_signature = 's')
+ def Introspect(self):
+ f = open('org.genivi.NodeStateManager.Consumer.xml', "r")
+ text = f.read()
+ return text
+
+ @dbus.service.method(dbus_interface='org.genivi.NodeStateManager.Consumer', out_signature = 'ii')
+ def GetNodeState(self):
+ NodeStateId=1
+ ErrorCode=1
+ print('[-----nsm-----] send out nodeState' + str(NodeStateId) + ' ErrorCode '+ str(1))
+ return NodeStateId, ErrorCode
+
+ @dbus.service.method('org.genivi.NodeStateManager.Consumer', out_signature = 'ii')
+ def GetApplicationMode(self):
+ ApplicationModeId=5
+ ErrorCode=2
+ print('[-----nsm-----] send out ApplicationMode' + str(ApplicationModeId) + ' ErrorCode '+ str(2))
+ return ApplicationModeId, ErrorCode
+
+ @dbus.service.method('org.genivi.NodeStateManager.Consumer', in_signature='si', out_signature = 'ii')
+ def GetSessionState(self,SessionName,seatID):
+ SessionState=0
+ ErrorCode=2
+
+ if SessionName=="mySession" and seatID==1:
+ SessionState=5
+ ErrorCode=1
+
+ print('[-----nsm-----] GetSessionState for session ' + SessionName + ' seatID '+ str(seatID) + ' returnState ' + str (SessionState))
+ return SessionState, ErrorCode
+
+ @dbus.service.method('org.genivi.NodeStateManager.Consumer', in_signature='ssuu', out_signature = 'i')
+ def RegisterShutdownClient(self,BName,ObjName,ShutdownMode,TimeoutMs):
+ print('[-----nsm-----] Busname: ' + BName)
+ print('[-----nsm-----] ObjName: ' + ObjName)
+ print('[-----nsm-----] ShutdownMode: ' + str(ShutdownMode))
+ print('[-----nsm-----] TimeoutMs: ' + str(TimeoutMs))
+ ErrorCode=1
+ if TimeoutMs!=100:
+ ErrorCode=3
+ if BName!="org.genivi.audiomanager":
+ ErrorCode=4
+ if ShutdownMode!=1:
+ ErrorCode=5
+ if ObjName!="/org/genivi/audiomanager/LifeCycleConsumer":
+ ErrorCode=6
+ self.ABus=BName
+ self.APath=ObjName
+ return ErrorCode
+
+ @dbus.service.method('org.genivi.NodeStateManager.Consumer', in_signature='ssu', out_signature = 'i')
+ def UnRegisterShutdownClient(self,BusName,ObjName,ShutdownMode):
+ print('[-----nsm-----] Busname: ' + str(BusName))
+ print('[-----nsm-----] ObjName: ' + str(ObjName))
+ print('[-----nsm-----] ShutdownMode: ' + str(ShutdownMode))
+ ErrorCode=1
+ if BusName!=self.ABus:
+ ErrorCode=2
+ if ObjName!=self.APath:
+ ErrorCode=2
+ if ShutdownMode!=1:
+ ErrorCode=2
+ return ErrorCode
+
+ @dbus.service.method(dbus_interface='org.genivi.NodeStateManager.Consumer', out_signature = 'u')
+ def GetInterfaceVersion(self):
+ version=23
+ return version
+
+ @dbus.service.method('org.genivi.NodeStateManager.Consumer', in_signature='ui', out_signature='i')
+ def LifecycleRequestComplete(self,RequestID,Status):
+ print('[-----nsm-----] RequestId: ' + str(RequestID))
+ print('[-----nsm-----] Status: ' + str(Status))
+ ErrorCode=1
+ if RequestID!=22:
+ ErrorCode=2
+ if Status!=4:
+ ErrorCode=2
+ return ErrorCode
+
+ @dbus.service.method(dbus.PROPERTIES_IFACE, in_signature='ss', out_signature='v')
+ def Get(self, interface, prop):
+ if prop in self.properties:
+ print('[-----nsm-----] send out ' + str(self.properties[prop]) + ' for property '+ prop)
+ return self.properties[prop]
+ return 0
+
+ @dbus.service.method(dbus.PROPERTIES_IFACE, in_signature='ssv')
+ def Set(self, interface, prop, value):
+ return 3
+
+ @dbus.service.method(dbus.PROPERTIES_IFACE, in_signature='s', out_signature='a{sv}')
+ def GetAll(self, interface):
+ return self.properties
+
+ @dbus.service.signal(dbus_interface='org.genivi.NodeStateManager.Consumer', signature='i')
+ def NodeApplicationMode(self, ApplicationModeId):
+ print "[-----nsm-----] Send out application mode ID %d" % (ApplicationModeId)
+
+ @dbus.service.signal(dbus_interface='org.genivi.NodeStateManager.Consumer', signature='i')
+ def NodeState(self, NodeState):
+ print "[-----nsm-----] Send out NodeState %d" % (NodeState)
+
+ @dbus.service.signal(dbus_interface='org.genivi.NodeStateManager.Consumer', signature='sii')
+ def SessionStateChanged(self, SessionStateName,SeatID,SessionState):
+ print "[-----nsm-----] Send out SessionStateChanged " + SessionStateName
+
+ @dbus.service.method('org.genivi.NodeStateManager.Control', in_signature='i')
+ def sendNodeApplicationMode(self, input):
+ self.NodeApplicationMode(input)
+ return input
+
+ @dbus.service.method('org.genivi.NodeStateManager.Control', in_signature='i')
+ def sendNodeState(self, input):
+ self.NodeState(input)
+ return input
+
+ @dbus.service.method('org.genivi.NodeStateManager.Control', in_signature='sii')
+ def sendSessionState(self, SessionStateName,SeatID,SessionState):
+ self.SessionStateChanged (SessionStateName,SeatID,SessionState)
+ return SeatID
+
+ @dbus.service.method('org.genivi.NodeStateManager.Control', in_signature='uu', out_signature='i')
+ def sendLifeCycleRequest(self, request, requestID):
+ bus = dbus.SessionBus()
+ remote_object = bus.get_object(self.ABus,self.APath)
+ iface = dbus.Interface(remote_object, 'org.genivi.NodeStateManager.LifeCycleConsumer')
+ iface.LifecycleRequest(request,requestID)
+ return 42
+
+ @dbus.service.method('org.genivi.NodeStateManager.Control')
+ def finish(self):
+ print '[-----nsm-----] Going to exit now!'
+ self.loop.quit()
+ return 0
+
+nsm = NodeStateManager(loop)
+loop.run()
diff --git a/AudioManagerDaemon/test/AmNodeStateCommunicatorTest/org.genivi.NodeStateManager.Consumer.xml b/AudioManagerDaemon/test/AmNodeStateCommunicatorCAPITest/org.genivi.NodeStateManager.Consumer.xml
index bb40a96..bb40a96 100644
--- a/AudioManagerDaemon/test/AmNodeStateCommunicatorTest/org.genivi.NodeStateManager.Consumer.xml
+++ b/AudioManagerDaemon/test/AmNodeStateCommunicatorCAPITest/org.genivi.NodeStateManager.Consumer.xml
diff --git a/AudioManagerDaemon/test/AmNodeStateCommunicatorTest/send2nsm.py b/AudioManagerDaemon/test/AmNodeStateCommunicatorCAPITest/send2nsm.py
index c7e8bf5..c7e8bf5 100644
--- a/AudioManagerDaemon/test/AmNodeStateCommunicatorTest/send2nsm.py
+++ b/AudioManagerDaemon/test/AmNodeStateCommunicatorCAPITest/send2nsm.py
diff --git a/AudioManagerDaemon/test/AmNodeStateCommunicatorTest/CAmNodeStateCommunicatorTest.cpp b/AudioManagerDaemon/test/AmNodeStateCommunicatorDBusTest/CAmNodeStateCommunicatorTest.cpp
index 11debf9..09e5f2b 100644
--- a/AudioManagerDaemon/test/AmNodeStateCommunicatorTest/CAmNodeStateCommunicatorTest.cpp
+++ b/AudioManagerDaemon/test/AmNodeStateCommunicatorDBusTest/CAmNodeStateCommunicatorTest.cpp
@@ -24,13 +24,18 @@
#include "shared/CAmSocketHandler.h"
#include "shared/CAmDbusWrapper.h"
+#include <unistd.h>
+
using namespace testing;
using namespace am;
static CAmEnvironment* env;
+
+
CAmNodeStateCommunicatorTest::CAmNodeStateCommunicatorTest()
{
+
}
CAmNodeStateCommunicatorTest::~CAmNodeStateCommunicatorTest()
@@ -63,7 +68,7 @@ void* mainLoop(void* importHandler)
TEST_F(CAmNodeStateCommunicatorTest, nsmChangeNodeState)
{
- env->pControlInterfaceBackdoor.replaceController(&env->pControlSender,&pMockControlInterface);
+ assert(true == env->pControlInterfaceBackdoor.replaceController(&env->pControlSender,&pMockControlInterface));
NsmNodeState_e newstate(NsmNodeState_BaseRunning) ;
EXPECT_CALL(pMockControlInterface,hookSystemNodeStateChanged(newstate));
std::ostringstream send;
diff --git a/AudioManagerDaemon/test/AmNodeStateCommunicatorTest/CAmNodeStateCommunicatorTest.h b/AudioManagerDaemon/test/AmNodeStateCommunicatorDBusTest/CAmNodeStateCommunicatorTest.h
index bd83e97..d75920b 100644
--- a/AudioManagerDaemon/test/AmNodeStateCommunicatorTest/CAmNodeStateCommunicatorTest.h
+++ b/AudioManagerDaemon/test/AmNodeStateCommunicatorDBusTest/CAmNodeStateCommunicatorTest.h
@@ -21,7 +21,7 @@
#ifndef CAMNODESTATECOMMUNICATORTEST_H_
#define CAMNODESTATECOMMUNICATORTEST_H_
-#include "CAmNodeStateCommunicator.h"
+#include "CAmNodeStateCommunicatorDBus.h"
#include "CAmControlSender.h"
#include "gtest/gtest.h"
#include "gmock/gmock.h"
@@ -38,7 +38,7 @@ public:
CAmControlSender pControlSender;
CAmSocketHandler iSocketHandler;
CAmDbusWrapper wrapper;
- CAmNodeStateCommunicator nsmController;
+ CAmNodeStateCommunicatorDBus nsmController;
pthread_t pNsmThread, pMainLoopThread;
CAmEnvironment();
~CAmEnvironment();
diff --git a/AudioManagerDaemon/test/AmNodeStateCommunicatorTest/CMakeLists.txt b/AudioManagerDaemon/test/AmNodeStateCommunicatorDBusTest/CMakeLists.txt
index 99b2963..4ecd421 100644
--- a/AudioManagerDaemon/test/AmNodeStateCommunicatorTest/CMakeLists.txt
+++ b/AudioManagerDaemon/test/AmNodeStateCommunicatorDBusTest/CMakeLists.txt
@@ -17,7 +17,7 @@
cmake_minimum_required(VERSION 2.6)
-PROJECT(AmNodeStateCommunicatorTest)
+PROJECT(AmNodeStateCommunicatorDBusTest)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -DUNIT_TEST=1")
@@ -59,7 +59,7 @@ file(GLOB NODESTATECOMMUNICATOR
"../../src/CAmDbusWrapper.cpp"
"../../src/CAmDltWrapper.cpp"
"../../src/CAmSocketHandler.cpp"
- "../../src/CAmNodeStateCommunicator.cpp"
+ "../../src/CAmNodeStateCommunicatorDBus.cpp"
"../../src/CAmControlSender.cpp"
"../../src/CAmCommandSender.cpp"
"../../src/CAmCommandReceiver.cpp"
@@ -68,9 +68,9 @@ file(GLOB NODESTATECOMMUNICATOR
"*.cpp"
)
-ADD_EXECUTABLE(AmNodeStateCommunicatorTest ${NODESTATECOMMUNICATOR})
+ADD_EXECUTABLE(AmNodeStateCommunicatorDBusTest ${NODESTATECOMMUNICATOR})
-TARGET_LINK_LIBRARIES(AmNodeStateCommunicatorTest
+TARGET_LINK_LIBRARIES(AmNodeStateCommunicatorDBusTest
${SQLITE_LIBRARIES}
${DLT_LIBRARIES}
${DBUS_LIBRARY}
@@ -81,9 +81,9 @@ TARGET_LINK_LIBRARIES(AmNodeStateCommunicatorTest
gmock
)
-ADD_DEPENDENCIES(AmNodeStateCommunicatorTest gtest gmock)
+ADD_DEPENDENCIES(AmNodeStateCommunicatorDBusTest gtest gmock)
-INSTALL(TARGETS AmNodeStateCommunicatorTest
+INSTALL(TARGETS AmNodeStateCommunicatorDBusTest
DESTINATION "~/AudioManagerTest/"
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
COMPONENT tests
diff --git a/AudioManagerDaemon/test/AmNodeStateCommunicatorTest/nsm.py b/AudioManagerDaemon/test/AmNodeStateCommunicatorDBusTest/nsm.py
index 7a02d05..7a02d05 100644
--- a/AudioManagerDaemon/test/AmNodeStateCommunicatorTest/nsm.py
+++ b/AudioManagerDaemon/test/AmNodeStateCommunicatorDBusTest/nsm.py
diff --git a/AudioManagerDaemon/test/AmNodeStateCommunicatorDBusTest/org.genivi.NodeStateManager.Consumer.xml b/AudioManagerDaemon/test/AmNodeStateCommunicatorDBusTest/org.genivi.NodeStateManager.Consumer.xml
new file mode 100644
index 0000000..bb40a96
--- /dev/null
+++ b/AudioManagerDaemon/test/AmNodeStateCommunicatorDBusTest/org.genivi.NodeStateManager.Consumer.xml
@@ -0,0 +1,259 @@
+<!-- Auto-Generated interface from Rhapsody: 'Repository::ssw_LifecycleSupport::NodeStateManagement::Concept::Interface::INSM_Consumer' -->
+<!-- Created at 2012-06-01 09:36:05 by uid65904 -->
+<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
+<node>
+<interface name="org.freedesktop.DBus.Introspectable">
+ <method name="Introspect">
+ <arg name="data" direction="out" type="s"/>
+ </method>
+</interface>
+<interface name="org.freedesktop.DBus.Properties">
+ <method name="Get">
+ <arg name="interface" direction="in" type="s"/>
+ <arg name="propname" direction="in" type="s"/>
+ <arg name="value" direction="out" type="v"/>
+ </method>
+
+ <method name="Set">
+ <arg name="interface" direction="in" type="s"/>
+ <arg name="propname" direction="in" type="s"/>
+ <arg name="value" direction="in" type="v"/>
+ </method>
+
+ <method name="GetAll">
+ <arg name="interface" direction="in" type="s"/>
+ <arg name="props" direction="out" type="a{sv}"/>
+ </method>
+</interface>
+ <!--
+ org.genivi.NodeStateManager.Consumer:
+ @short_description: "Consumer" interface of the NodeStateManager.
+
+ This interface contains functions which are not safety critical and can be accessed by "every" client without further restrictions.
+ -->
+ <interface name="org.genivi.NodeStateManager.Consumer">
+ <!--
+ RestartReason: This property informs clients about the reason for the last restart. The values are based upon the enummeration NsmRestartReason_e. Note: The value is only set once at start-up.
+ -->
+ <property name="RestartReason" type="i" access="read"/>
+
+ <!--
+ ShutdownReason: This property informs clients about the reason for the last shutdown. The values are based upon the enummeration NsmShutdownReason_e. Note: The value is only set once at start-up.
+ -->
+ <property name="ShutdownReason" type="i" access="read"/>
+
+ <!--
+ WakeUpReason: This property informs clients about the recent reason for waking up the target. The values are based upon the enummeration NsmWakeUpReason_e. Note: The value is only set once at start-up.
+ -->
+ <property name="WakeUpReason" type="i" access="read"/>
+
+ <!--
+ BootMode: This property informs clients about the recent BootMode of the target. The values will be defined by a third party header, which has not been delivered yet. The description needs to be updated as soon as the header is available.
+ -->
+ <property name="BootMode" type="i" access="read"/>
+
+ <!--
+ NodeState:
+ @NodeState: Numeric value for the current NodeState, defined in NsmNodeState_e.
+
+ Clients can register for notifications when the NodeState is updated inside the NodeStateManager. This signal is sent to registered clients and will include the current NodeState as a parameter.
+ -->
+ <signal name="NodeState">
+ <arg name="NodeState" type="i"/>
+ </signal>
+
+ <!--
+ NodeApplicationMode:
+ @ApplicationModeId: Numeric value for the current ApplicationMode, defined in NsmAplicationMode_e.
+
+ Clients can register for notifications when the NodeApplicationMode is updated inside the NodeStateManager. This signal is sent to registered clients and will include the current NodeApplicationMode as a parameter.
+ -->
+ <signal name="NodeApplicationMode">
+ <arg name="ApplicationModeId" type="i"/>
+ </signal>
+
+ <!--
+ SessionStateChanged:
+ @SessionStateName: The SessionName will be based upon either the pre-defined platform SessionNames or using a newly added product defined session name.
+ @SeatID: This parameter will be based upon the enum NsmSeat_e.
+ @SessionState: This parameter will be based upon the NsmSessionState_e but it will not be bounded by the values in that enumeration. The listed values are the default values that are mandatory for platform sessions, but product sessions may have additional session states.
+
+ This signal is sent to registered clients when a particular session is state is changed. The client can register for notification about a specific session through the use of the SessionName, as a "match rule".
+ -->
+ <signal name="SessionStateChanged">
+ <arg name="SessionStateName" type="s"/>
+ <arg name="SeatID" type="i"/>
+ <arg name="SessionState" type="i"/>
+ </signal>
+
+ <!--
+ GetNodeState:
+ @NodeStateId: Will be based on the NsmNodeState_e.
+ @ErrorCode: Return value passed to the caller, based upon NsmErrorStatus_e.
+
+ The method is used by other applications to get the NodeState without the need of registration to the signal.
+ -->
+ <method name="GetNodeState">
+ <arg name="NodeStateId" direction="out" type="i"/>
+ <arg name="ErrorCode" direction="out" type="i"/>
+ </method>
+
+ <!--
+ SetSessionState:
+ @SessionName: The SessionName will be based upon either the pre-defined platform SessionNames (see NSM content page) or using a newly added product defined session name.
+ @SessionOwner: This parameter defines the name of the application that is setting the state of the session. This must be the applications systemd unit filename.
+ @SeatID: This parameter will be based upon the enum NsmSeat_e
+ @SessionState: This parameter will be based upon the NsmSessionState_e but it will not be bounded by the values in that enumeration. The listed values are the default values that are mandatory for platform sessions, but product sessions may have additional SessionStates.
+ @ErrorCode: Return value passed to the caller, based upon NsmErrorStatus_e.
+
+ The method is used by applications to set the state of a session.
+ -->
+ <method name="SetSessionState">
+ <arg name="SessionName" direction="in" type="s"/>
+ <arg name="SessionOwner" direction="in" type="s"/>
+ <arg name="SeatID" direction="in" type="i"/>
+ <arg name="SessionState" direction="in" type="i"/>
+ <arg name="ErrorCode" direction="out" type="i"/>
+ </method>
+
+ <!--
+ GetSessionState:
+ @SessionName: The SessionName will be based upon either the pre-defined platform session names (see NSM content page) or using a newly added product defined SessionName.
+ @SeatID: This parameter will be based upon the enum NsmSeat_e.
+ @SessionState: This parameter will be based upon the NsmSessionState_e but it will not be bounded by the values in that enumeration. The listed values are the default values that are mandatory for platform sessions, but product sessions may have additional SessionStates.
+ @ErrorCode: Return value passed to the caller, based upon NsmErrorStatus_e.
+
+ The method is used by applications to get the state of a session.
+ -->
+ <method name="GetSessionState">
+ <arg name="SessionName" direction="in" type="s"/>
+ <arg name="SeatID" direction="in" type="i"/>
+ <arg name="SessionState" direction="out" type="i"/>
+ <arg name="ErrorCode" direction="out" type="i"/>
+ </method>
+
+ <!--
+ GetApplicationMode:
+ @ApplicationModeId: This parameter will be based upon the NsmNodeApplicationMode_e.
+ @ErrorCode: Return value passed to the caller, based upon NsmErrorStatus_e.
+
+ The method is used by other applications to get the application mode.
+ -->
+ <method name="GetApplicationMode">
+ <arg name="ApplicationModeId" direction="out" type="i"/>
+ <arg name="ErrorCode" direction="out" type="i"/>
+ </method>
+
+ <!--
+ RegisterShutdownClient:
+ @BusName: Bus name of remote application.
+ @ObjName: Object name of remote object that provides the shutdown interface.
+ @ShutdownMode: Shutdown mode for which client wants to be informed (i.e normal, fast etc).
+ @TimeoutMs: Max. Timeout to wait for response from shutdown client in ms.
+ @ErrorCode: Return value passed to the caller, based upon NsmErrorStatus_e.
+
+ The method is used by other applications to register themselves as shutdown client. Any client that registers must provide a method in their D-Bus object called "LifecycleRequest". This method will take one parameter which is the RequestType (NSM_SHUTDOWNTYPE_NORMAL, NSM_SHUTDOWNTYPE_FAST). For an example of the required client interface please see the BootManager component who will be a client of the NSM.
+ -->
+ <method name="RegisterShutdownClient">
+ <arg name="BusName" direction="in" type="s"/>
+ <arg name="ObjName" direction="in" type="s"/>
+ <arg name="ShutdownMode" direction="in" type="u"/>
+ <arg name="TimeoutMs" direction="in" type="u"/>
+ <arg name="ErrorCode" direction="out" type="i"/>
+ </method>
+
+ <!--
+ UnRegisterShutdownClient:
+ @BusName: Bus name of remote application.
+ @ObjName: Object name of remote object that provides the shutdown interface.
+ @ShutdownMode: Shutdown mode for which client wants to unregister (NSM_SHUTDOWNTYPE_NORMAL, NSM_SHUTDOWNTYPE_FAST).
+ @ErrorCode: Return value passed to the caller, based upon NsmErrorStatus_e.
+
+ The method is used by other applications to unregister themselves as shutdown client.
+ -->
+ <method name="UnRegisterShutdownClient">
+ <arg name="BusName" direction="in" type="s"/>
+ <arg name="ObjName" direction="in" type="s"/>
+ <arg name="ShutdownMode" direction="in" type="u"/>
+ <arg name="ErrorCode" direction="out" type="i"/>
+ </method>
+
+ <!--
+ RegisterSession:
+ @SessionName: The SessionName will be based upon either the pre-defined platform session names (see NSM content page) or using a newly added product defined SessionName.
+ @SessionOwner: This is the name of the application that is registering the new session (this must be the applications systemd unit filename).
+ @SeatID: This parameter will be based upon the enum NsmSeatId_e
+ @SessionState: This parameter will be based upon the NsmSessionState_e but it will not be bounded by the values in that enumeration. The listed values are the default values that are mandatory for platform sessions, but product sessions may have additional session states.
+ @ErrorCode: Return value passed to the caller, based upon NsmErrorStatus_e.
+
+ The method is used by other applications to register a new session whose state should be observed and distributed by the NSM.
+ -->
+ <method name="RegisterSession">
+ <arg name="SessionName" direction="in" type="s"/>
+ <arg name="SessionOwner" direction="in" type="s"/>
+ <arg name="SeatID" direction="in" type="i"/>
+ <arg name="SessionState" direction="in" type="i"/>
+ <arg name="ErrorCode" direction="out" type="i"/>
+ </method>
+
+ <!--
+ UnRegisterSession:
+ @SessionName: The SessionName will be based upon either the pre-defined platform session names (see NSM content page) or using a newly added product defined SessionName.
+ @SessionOwner: This is the name of the application that originally registered the session. It will be validated that this value matches the stored value from the registration.
+ @SeatID: This parameter will be based upon the enum NsmSeat_e.
+ @ErrorCode: Return value passed to the caller, based upon NsmErrorStatus_e.
+
+ The method is used by other applications to remove a new session from the session list hosted by NSM.
+ -->
+ <method name="UnRegisterSession">
+ <arg name="SessionName" direction="in" type="s"/>
+ <arg name="SessionOwner" direction="in" type="s"/>
+ <arg name="SeatID" direction="in" type="i"/>
+ <arg name="ErrorCode" direction="out" type="i"/>
+ </method>
+
+ <!--
+ GetAppHealthCount:
+ @Count: Return value passed to the caller. Number of applications that crashed or terminated accidentally.
+
+ The method returns the number of applications that crashed or terminated accidentally, within the current life cycle. It can be used to observe the system state.
+ -->
+ <method name="GetAppHealthCount">
+ <arg name="Count" direction="out" type="u"/>
+ </method>
+
+ <!--
+ GetInterfaceVersion:
+ @Version: Unsigned integer that represents the version number of the Node State Manager.
+
+ The method returns the version number of the Node State Manager. The number is organized in four bytes:
+
+ Version: VVV.RRR.PPP.BBB
+
+ <literallayout>
+ VVV => Version [1..255]
+ RRR => Release [0..255]
+ PPP => Patch [0..255]
+ BBB => Build [0..255]
+ </literallayout>
+ -->
+ <method name="GetInterfaceVersion">
+ <arg name="Version" direction="out" type="u"/>
+ </method>
+
+ <!--
+ LifecycleRequestComplete:
+ @RequestId: The request Id of the called life cycle client. The value has been passed when "LifecycleRequest" was called.
+ @Status: The result of the call to "LifecycleRequest". NsmErrorStatus_Ok: Request successfully processed. NsmErrorStatus_Error: An error occured while processing the "LifecycleRequest".
+ @ErrorCode: Return value passed to the caller, based upon NsmErrorStatus_e.
+
+ The function has to be called by a "asynchrounous" lifecycle client, when he processed the "LifecycleRequest".
+ -->
+ <method name="LifecycleRequestComplete">
+ <arg name="RequestId" direction="in" type="u"/>
+ <arg name="Status" direction="in" type="i"/>
+ <arg name="ErrorCode" direction="out" type="i"/>
+ </method>
+ </interface>
+</node>
diff --git a/AudioManagerDaemon/test/AmNodeStateCommunicatorDBusTest/send2nsm.py b/AudioManagerDaemon/test/AmNodeStateCommunicatorDBusTest/send2nsm.py
new file mode 100644
index 0000000..c7e8bf5
--- /dev/null
+++ b/AudioManagerDaemon/test/AmNodeStateCommunicatorDBusTest/send2nsm.py
@@ -0,0 +1,68 @@
+# -*- coding: utf-8 -*-
+#
+# 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 Linke, christian.linke@bmw.de BMW 2012
+#
+# For further information see http://www.genivi.org/.
+#
+
+import sys
+import traceback
+import gobject
+import math
+import dbus
+import dbus.service
+
+def nodeState (nodeState):
+ bus = dbus.SessionBus()
+ remote_object = bus.get_object('org.genivi.NodeStateManager','/org/genivi/NodeStateManager')
+ iface = dbus.Interface(remote_object, 'org.genivi.NodeStateManager.Control')
+ iface.sendNodeState(int(nodeState))
+
+def appMode (appMode):
+ bus = dbus.SessionBus()
+ remote_object = bus.get_object('org.genivi.NodeStateManager','/org/genivi/NodeStateManager')
+ iface = dbus.Interface(remote_object, 'org.genivi.NodeStateManager.Control')
+ iface.sendNodeApplicationMode(int(appMode))
+
+def sessionState (SessionStateName,SeatID,SessionState):
+ bus = dbus.SessionBus()
+ remote_object = bus.get_object('org.genivi.NodeStateManager','/org/genivi/NodeStateManager')
+ iface = dbus.Interface(remote_object, 'org.genivi.NodeStateManager.Control')
+ iface.sendSessionState(SessionStateName,int(SeatID),int(SessionState))
+
+def finish():
+ bus = dbus.SessionBus()
+ remote_object = bus.get_object('org.genivi.NodeStateManager','/org/genivi/NodeStateManager')
+ iface = dbus.Interface(remote_object, 'org.genivi.NodeStateManager.Control')
+ iface.finish()
+
+def LifecycleRequest(Request,RequestID):
+ bus = dbus.SessionBus()
+ remote_object = bus.get_object('org.genivi.NodeStateManager','/org/genivi/NodeStateManager')
+ iface = dbus.Interface(remote_object, 'org.genivi.NodeStateManager.Control')
+ iface.sendLifeCycleRequest(dbus.UInt32(Request),dbus.UInt32(RequestID))
+
+command=sys.argv[1]
+if command=="nodeState":
+ nodeState(sys.argv[2])
+if command=="finish":
+ finish()
+if command=="appMode":
+ appMode(sys.argv[2])
+if command=="sessionState":
+ sessionState(sys.argv[2],sys.argv[3],sys.argv[4])
+if command=="LifecycleRequest":
+ LifecycleRequest(sys.argv[2],sys.argv[3])
diff --git a/AudioManagerDaemon/test/AmRouterMapTest/CMakeLists.txt b/AudioManagerDaemon/test/AmRouterMapTest/CMakeLists.txt
index d587f0c..2b16eda 100644
--- a/AudioManagerDaemon/test/AmRouterMapTest/CMakeLists.txt
+++ b/AudioManagerDaemon/test/AmRouterMapTest/CMakeLists.txt
@@ -60,9 +60,9 @@ file(GLOB ROUTINGMAP_SRCS_CXX
)
IF(WITH_NSM)
- SET (ROUTINGMAP_SRCS_CXX
- ${ROUTINGMAP_SRCS_CXX}
- "../../src/CAmNodeStateCommunicator.cpp")
+ SET (DATABASE_SRCS_CXX
+ ${DATABASE_SRCS_CXX}
+ "../../src/CAmNodeStateCommunicatorDBus.cpp")
ENDIF(WITH_NSM)
ADD_EXECUTABLE( AmRouterMapTest ${ROUTINGMAP_SRCS_CXX})
diff --git a/AudioManagerDaemon/test/AmRouterTest/CMakeLists.txt b/AudioManagerDaemon/test/AmRouterTest/CMakeLists.txt
index 6f556ff..602767b 100644
--- a/AudioManagerDaemon/test/AmRouterTest/CMakeLists.txt
+++ b/AudioManagerDaemon/test/AmRouterTest/CMakeLists.txt
@@ -61,9 +61,9 @@ file(GLOB ROUTING_SRCS_CXX
)
IF(WITH_NSM)
- SET (ROUTING_SRCS_CXX
- ${ROUTING_SRCS_CXX}
- "../../src/CAmNodeStateCommunicator.cpp")
+ SET (DATABASE_SRCS_CXX
+ ${DATABASE_SRCS_CXX}
+ "../../src/CAmNodeStateCommunicatorDBus.cpp")
ENDIF(WITH_NSM)
ADD_EXECUTABLE( AmRouterTest ${ROUTING_SRCS_CXX})
diff --git a/AudioManagerDaemon/test/AmRoutingInterfaceTest/CMakeLists.txt b/AudioManagerDaemon/test/AmRoutingInterfaceTest/CMakeLists.txt
index a73cec0..122ea69 100644
--- a/AudioManagerDaemon/test/AmRoutingInterfaceTest/CMakeLists.txt
+++ b/AudioManagerDaemon/test/AmRoutingInterfaceTest/CMakeLists.txt
@@ -62,9 +62,9 @@ file(GLOB ROUTING_INTERFACE_SRCS_CXX
)
IF(WITH_NSM)
- SET (ROUTING_INTERFACE_SRCS_CXX
- ${ROUTING_INTERFACE_SRCS_CXX}
- "../../src/CAmNodeStateCommunicator.cpp")
+ SET (DATABASE_SRCS_CXX
+ ${DATABASE_SRCS_CXX}
+ "../../src/CAmNodeStateCommunicatorDBus.cpp")
ENDIF(WITH_NSM)
ADD_EXECUTABLE(AmRoutingInterfaceTest ${ROUTING_INTERFACE_SRCS_CXX})
diff --git a/AudioManagerDaemon/test/AmTelnetServerTest/CMakeLists.txt b/AudioManagerDaemon/test/AmTelnetServerTest/CMakeLists.txt
index 6c20e4e..26c83d9 100644
--- a/AudioManagerDaemon/test/AmTelnetServerTest/CMakeLists.txt
+++ b/AudioManagerDaemon/test/AmTelnetServerTest/CMakeLists.txt
@@ -69,9 +69,9 @@ file(GLOB TELNET_SRCS_CXX
)
IF(WITH_NSM)
- SET (TELNET_SRCS_CXX
- ${TELNET_SRCS_CXX}
- "../../src/CAmNodeStateCommunicator.cpp")
+ SET (DATABASE_SRCS_CXX
+ ${DATABASE_SRCS_CXX}
+ "../../src/CAmNodeStateCommunicatorDBus.cpp")
ENDIF(WITH_NSM)
ADD_EXECUTABLE(AmTelnetServerTest ${TELNET_SRCS_CXX})
diff --git a/AudioManagerDaemon/test/CAmCommonFunctions.cpp b/AudioManagerDaemon/test/CAmCommonFunctions.cpp
index 7ee9090..d8c2e03 100644
--- a/AudioManagerDaemon/test/CAmCommonFunctions.cpp
+++ b/AudioManagerDaemon/test/CAmCommonFunctions.cpp
@@ -92,7 +92,7 @@ IAmControlBackdoor::~IAmControlBackdoor()
bool IAmControlBackdoor::replaceController(CAmControlSender *controlSender, IAmControlSend *newController)
{
controlSender->mController = newController;
- return true;
+ return controlSender->mController == newController;
}
//int GetRandomNumber(int nLow, int nHigh) {
diff --git a/AudioManagerDaemon/test/CMakeLists.txt b/AudioManagerDaemon/test/CMakeLists.txt
index 5eda5cb..e0ae651 100644
--- a/AudioManagerDaemon/test/CMakeLists.txt
+++ b/AudioManagerDaemon/test/CMakeLists.txt
@@ -27,8 +27,13 @@ add_subdirectory (AmRouterTest)
add_subdirectory (AmRouterMapTest)
add_subdirectory (AmRoutingInterfaceTest)
add_subdirectory (AmSocketHandlerTest)
+
IF(WITH_NSM)
- add_subdirectory (AmNodeStateCommunicatorTest)
+ IF(WITH_DBUS_WRAPPER)
+ add_subdirectory (AmNodeStateCommunicatorDBusTest)
+ ELSEIF(WITH_CAPI_WRAPPER)
+ add_subdirectory (AmNodeStateCommunicatorCAPITest)
+ ENDIF()
ENDIF(WITH_NSM)
IF(WITH_TELNET)