diff options
author | christian linke <christian.linke@bmw.de> | 2013-01-09 15:01:19 +0100 |
---|---|---|
committer | christian linke <christian.linke@bmw.de> | 2013-01-09 15:01:19 +0100 |
commit | 1c3e5d99546d0c2d803d50411168d0d887365399 (patch) | |
tree | 75e990e26706fe0116156976071593a3bff56135 | |
parent | 5485dee80853f3d014f929d538eb02fee1a62a66 (diff) | |
download | audiomanager-1c3e5d99546d0c2d803d50411168d0d887365399.tar.gz |
* fix WITH_NSM=off option
Signed-off-by: christian linke <christian.linke@bmw.de>
-rw-r--r-- | AudioManagerDaemon/CMakeLists.txt | 12 | ||||
-rw-r--r-- | AudioManagerDaemon/src/CAmControlReceiver.cpp | 68 | ||||
-rw-r--r-- | AudioManagerDaemon/src/CAmNodeStateCommunicator.cpp | 1 | ||||
-rwxr-xr-x | AudioManagerDaemon/src/main.cpp | 9 | ||||
-rw-r--r-- | AudioManagerDaemon/test/AmControlInterfaceTest/CMakeLists.txt | 9 | ||||
-rw-r--r-- | AudioManagerDaemon/test/AmDatabaseHandlerTest/CMakeLists.txt | 7 | ||||
-rw-r--r-- | AudioManagerDaemon/test/AmRouterTest/CMakeLists.txt | 7 | ||||
-rw-r--r-- | AudioManagerDaemon/test/AmRoutingInterfaceTest/CMakeLists.txt | 7 | ||||
-rw-r--r-- | AudioManagerDaemon/test/AmTelnetServerTest/CMakeLists.txt | 7 | ||||
-rw-r--r-- | AudioManagerDaemon/test/CMakeLists.txt | 5 | ||||
-rwxr-xr-x | CMakeLists.txt | 4 |
11 files changed, 121 insertions, 15 deletions
diff --git a/AudioManagerDaemon/CMakeLists.txt b/AudioManagerDaemon/CMakeLists.txt index bfc026f..270b542 100644 --- a/AudioManagerDaemon/CMakeLists.txt +++ b/AudioManagerDaemon/CMakeLists.txt @@ -71,10 +71,16 @@ IF(WITH_DBUS_WRAPPER) SET (AUDIOMAN_SRCS_CXX ${AUDIOMAN_SRCS_CXX} src/CAmDbusWrapper.cpp - src/CAmNodeStateCommunicator.cpp ) ENDIF(WITH_DBUS_WRAPPER) +IF(WITH_NSM) + SET (AUDIOMAN_SRCS_CXX + ${AUDIOMAN_SRCS_CXX} + src/CAmNodeStateCommunicator.cpp + ) +ENDIF(WITH_NSM) + IF(WITH_SOCKETHANDLER_LOOP) SET (AUDIOMAN_SRCS_CXX ${AUDIOMAN_SRCS_CXX} @@ -154,7 +160,7 @@ INSTALL(DIRECTORY "${AUDIO_INCLUDE_FOLDER}/" COMPONENT dev ) -IF(WITH_DBUS_WRAPPER) +IF(WITH_NSM) IF(USE_BUILD_LIBS) SET(NSM_INTROSPECTION_FILE ${EXECUTABLE_OUTPUT_PATH}/LifeCycleConsumer.xml) execute_process( @@ -167,7 +173,7 @@ IF(WITH_DBUS_WRAPPER) DESTINATION "${NSM_INTROSPECTION_FILE}" COMPONENT bin) ENDIF(USE_BUILD_LIBS) -ENDIF(WITH_DBUS_WRAPPER) +ENDIF(WITH_NSM) CONFIGURE_FILE( ${CMAKE_SOURCE_DIR}/cmake/config.cmake ${CMAKE_SOURCE_DIR}/include/config.h ) diff --git a/AudioManagerDaemon/src/CAmControlReceiver.cpp b/AudioManagerDaemon/src/CAmControlReceiver.cpp index cfa9467..86c6399 100644 --- a/AudioManagerDaemon/src/CAmControlReceiver.cpp +++ b/AudioManagerDaemon/src/CAmControlReceiver.cpp @@ -28,9 +28,12 @@ #include "CAmRoutingSender.h" #include "CAmCommandSender.h" #include "CAmRouter.h" -#include "CAmNodeStateCommunicator.h" #include "shared/CAmDltWrapper.h" #include "shared/CAmSocketHandler.h" +#ifdef WITH_NSM + #include "CAmNodeStateCommunicator.h" +#endif + namespace am { @@ -605,70 +608,133 @@ am_Error_e CAmControlReceiver::nsmGetRestartReasonProperty(NsmRestartReason_e& r { if (!mNodeStateCommunicator) return (E_NON_EXISTENT); +#ifdef WITH_NSM return (mNodeStateCommunicator->nsmGetRestartReasonProperty(restartReason)); +#else + (void)restartReason; + return (E_NON_EXISTENT); +#endif } am_Error_e CAmControlReceiver::nsmGetShutdownReasonProperty(NsmShutdownReason_e& ShutdownReason) { if (!mNodeStateCommunicator) return (E_NON_EXISTENT); +#ifdef WITH_NSM return (mNodeStateCommunicator->nsmGetShutdownReasonProperty(ShutdownReason)); +#else + (void)ShutdownReason; + return (E_NON_EXISTENT); +#endif + } am_Error_e CAmControlReceiver::nsmGetRunningReasonProperty(NsmRunningReason_e& nsmRunningReason) { if (!mNodeStateCommunicator) return (E_NON_EXISTENT); +#ifdef WITH_NSM return (mNodeStateCommunicator->nsmGetRunningReasonProperty(nsmRunningReason)); +#else + (void)nsmRunningReason; + return (E_NON_EXISTENT); +#endif + } NsmErrorStatus_e CAmControlReceiver::nsmGetNodeState(NsmNodeState_e& nsmNodeState) { if (!mNodeStateCommunicator) return (NsmErrorStatus_Error); +#ifdef WITH_NSM return (mNodeStateCommunicator->nsmGetNodeState(nsmNodeState)); +#else + (void) nsmNodeState; + return (NsmErrorStatus_Error); +#endif + } NsmErrorStatus_e CAmControlReceiver::nsmGetSessionState(const std::string& sessionName, const NsmSeat_e& seatID, NsmSessionState_e& sessionState) { if (!mNodeStateCommunicator) return (NsmErrorStatus_Error); +#ifdef WITH_NSM return (mNodeStateCommunicator->nsmGetSessionState(sessionName,seatID,sessionState)); +#else + (void) sessionName; + (void) seatID; + (void) sessionState; + return (NsmErrorStatus_Error); +#endif + } NsmErrorStatus_e CAmControlReceiver::nsmGetApplicationMode(NsmApplicationMode_e& applicationMode) { if (!mNodeStateCommunicator) return (NsmErrorStatus_Error); +#ifdef WITH_NSM return (mNodeStateCommunicator->nsmGetApplicationMode(applicationMode)); +#else + (void) applicationMode; + return (NsmErrorStatus_Error); +#endif + } NsmErrorStatus_e CAmControlReceiver::nsmRegisterShutdownClient(const uint32_t shutdownMode, const uint32_t timeoutMs) { if (!mNodeStateCommunicator) return (NsmErrorStatus_Error); +#ifdef WITH_NSM return (mNodeStateCommunicator->nsmRegisterShutdownClient(shutdownMode,timeoutMs)); +#else + (void) shutdownMode; + (void) timeoutMs; + return (NsmErrorStatus_Error); +#endif + } NsmErrorStatus_e CAmControlReceiver::nsmUnRegisterShutdownClient(const uint32_t shutdownMode) { if (!mNodeStateCommunicator) return (NsmErrorStatus_Error); +#ifdef WITH_NSM return (mNodeStateCommunicator->nsmUnRegisterShutdownClient(shutdownMode)); +#else + (void) shutdownMode; + return (NsmErrorStatus_Error); +#endif + } am_Error_e CAmControlReceiver::nsmGetInterfaceVersion(uint32_t& version) { if (!mNodeStateCommunicator) return (E_NON_EXISTENT); +#ifdef WITH_NSM return (mNodeStateCommunicator->nsmGetInterfaceVersion(version)); +#else + (void) version; + return (E_NON_EXISTENT); +#endif + } NsmErrorStatus_e CAmControlReceiver::nsmSendLifecycleRequestComplete(const uint32_t RequestId, const NsmErrorStatus_e status) { if (!mNodeStateCommunicator) return (NsmErrorStatus_Error); +#ifdef WITH_NSM return (mNodeStateCommunicator->nsmSendLifecycleRequestComplete(RequestId,status)); +#else + (void) RequestId; + (void) status; + return (NsmErrorStatus_Error); +#endif + } } diff --git a/AudioManagerDaemon/src/CAmNodeStateCommunicator.cpp b/AudioManagerDaemon/src/CAmNodeStateCommunicator.cpp index 16c5e8b..a80e44b 100644 --- a/AudioManagerDaemon/src/CAmNodeStateCommunicator.cpp +++ b/AudioManagerDaemon/src/CAmNodeStateCommunicator.cpp @@ -25,7 +25,6 @@ #include <fstream> #include <stdexcept> #include "CAmControlSender.h" -#include "shared/CAmDbusWrapper.h" #include "shared/CAmDltWrapper.h" #include "config.h" diff --git a/AudioManagerDaemon/src/main.cpp b/AudioManagerDaemon/src/main.cpp index f8319b3..de10b73 100755 --- a/AudioManagerDaemon/src/main.cpp +++ b/AudioManagerDaemon/src/main.cpp @@ -30,10 +30,13 @@ #include "config.h" #ifdef WITH_TELNET -#include "CAmTelnetServer.h" + #include "CAmTelnetServer.h" #endif #ifdef WITH_DBUS_WRAPPER -#include <shared/CAmDbusWrapper.h> + #include "shared/CAmDbusWrapper.h" +#endif +#ifdef WITH_NSM + #include "CAmNodeStateCommunicator.h" #endif #include <sys/resource.h> @@ -57,11 +60,11 @@ #include "CAmControlReceiver.h" #include "CAmDatabaseObserver.h" #include "CAmWatchdog.h" -#include "CAmNodeStateCommunicator.h" #include "shared/CAmDltWrapper.h" #include "shared/CAmSocketHandler.h" + using namespace am; DLT_DECLARE_CONTEXT(AudioManager) diff --git a/AudioManagerDaemon/test/AmControlInterfaceTest/CMakeLists.txt b/AudioManagerDaemon/test/AmControlInterfaceTest/CMakeLists.txt index 5fb5020..a6c7234 100644 --- a/AudioManagerDaemon/test/AmControlInterfaceTest/CMakeLists.txt +++ b/AudioManagerDaemon/test/AmControlInterfaceTest/CMakeLists.txt @@ -48,18 +48,23 @@ file(GLOB CONTROL_INTERFACE_SRCS_CXX "../../src/CAmRoutingSender.cpp" "../../src/CAmRoutingReceiver.cpp" "../../src/CAmCommandSender.cpp" + "../../src/CAmCommandReceiver.cpp" "../../src/CAmControlReceiver.cpp" "../../src/CAmControlSender.cpp" "../../src/CAmRouter.cpp" "../../src/CAmDltWrapper.cpp" "../../src/CAmSocketHandler.cpp" - "../../src/CAmCommandReceiver.cpp" - "../../src/CAmNodeStateCommunicator.cpp" "../../src/CAmDbusWrapper.cpp" "../CAmCommonFunctions.cpp" "*.cpp" ) +IF(WITH_NSM) + SET (CONTROL_INTERFACE_SRCS_CXX + ${CONTROL_INTERFACE_SRCS_CXX} + "../../src/CAmNodeStateCommunicator.cpp") +ENDIF(WITH_NSM) + ADD_EXECUTABLE(AmControlInterfaceTest ${CONTROL_INTERFACE_SRCS_CXX}) TARGET_LINK_LIBRARIES(AmControlInterfaceTest diff --git a/AudioManagerDaemon/test/AmDatabaseHandlerTest/CMakeLists.txt b/AudioManagerDaemon/test/AmDatabaseHandlerTest/CMakeLists.txt index f8303b3..f4c7ecb 100644 --- a/AudioManagerDaemon/test/AmDatabaseHandlerTest/CMakeLists.txt +++ b/AudioManagerDaemon/test/AmDatabaseHandlerTest/CMakeLists.txt @@ -55,11 +55,16 @@ file(GLOB DATABASE_SRCS_CXX "../../src/CAmSocketHandler.cpp" "../../src/CAmCommandReceiver.cpp" "../../src/CAmRoutingReceiver.cpp" - "../../src/CAmNodeStateCommunicator.cpp" "../../src/CAmDbusWrapper.cpp" "../CAmCommonFunctions.cpp" "*.cpp" ) + +IF(WITH_NSM) + SET (CONTROL_INTERFACE_SRCS_CXX + ${CONTROL_INTERFACE_SRCS_CXX} + "../../src/CAmNodeStateCommunicator.cpp") +ENDIF(WITH_NSM) ADD_EXECUTABLE( AmDatabaseHandlerTest ${DATABASE_SRCS_CXX}) diff --git a/AudioManagerDaemon/test/AmRouterTest/CMakeLists.txt b/AudioManagerDaemon/test/AmRouterTest/CMakeLists.txt index a43b9de..67c1065 100644 --- a/AudioManagerDaemon/test/AmRouterTest/CMakeLists.txt +++ b/AudioManagerDaemon/test/AmRouterTest/CMakeLists.txt @@ -55,11 +55,16 @@ file(GLOB ROUTING_SRCS_CXX "../../src/CAmSocketHandler.cpp" "../../src/CAmCommandReceiver.cpp" "../../src/CAmRoutingReceiver.cpp" - "../../src/CAmNodeStateCommunicator.cpp" "../../src/CAmDbusWrapper.cpp" "../CAmCommonFunctions.cpp" "*.cpp" ) + +IF(WITH_NSM) + SET (CONTROL_INTERFACE_SRCS_CXX + ${CONTROL_INTERFACE_SRCS_CXX} + "../../src/CAmNodeStateCommunicator.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 0316083..2928335 100644 --- a/AudioManagerDaemon/test/AmRoutingInterfaceTest/CMakeLists.txt +++ b/AudioManagerDaemon/test/AmRoutingInterfaceTest/CMakeLists.txt @@ -57,11 +57,16 @@ file(GLOB ROUTING_INTERFACE_SRCS_CXX "../../src/CAmSocketHandler.cpp" "../../src/CAmRoutingReceiver.cpp" "../../src/CAmCommandReceiver.cpp" - "../../src/CAmNodeStateCommunicator.cpp" "../../src/CAmDbusWrapper.cpp" "*.cpp" ) +IF(WITH_NSM) + SET (CONTROL_INTERFACE_SRCS_CXX + ${CONTROL_INTERFACE_SRCS_CXX} + "../../src/CAmNodeStateCommunicator.cpp") +ENDIF(WITH_NSM) + ADD_EXECUTABLE(AmRoutingInterfaceTest ${ROUTING_INTERFACE_SRCS_CXX}) TARGET_LINK_LIBRARIES(AmRoutingInterfaceTest diff --git a/AudioManagerDaemon/test/AmTelnetServerTest/CMakeLists.txt b/AudioManagerDaemon/test/AmTelnetServerTest/CMakeLists.txt index ba09129..925b2f0 100644 --- a/AudioManagerDaemon/test/AmTelnetServerTest/CMakeLists.txt +++ b/AudioManagerDaemon/test/AmTelnetServerTest/CMakeLists.txt @@ -63,11 +63,16 @@ file(GLOB TELNET_SRCS_CXX "../../src/CAmRouter.cpp" "../../src/CAmDltWrapper.cpp" "../../src/CAmTelnetMenuHelper.cpp" - "../../src/CAmNodeStateCommunicator.cpp" "../../src/CAmDbusWrapper.cpp" "*.cpp" ) +IF(WITH_NSM) + SET (CONTROL_INTERFACE_SRCS_CXX + ${CONTROL_INTERFACE_SRCS_CXX} + "../../src/CAmNodeStateCommunicator.cpp") +ENDIF(WITH_NSM) + ADD_EXECUTABLE(AmTelnetServerTest ${TELNET_SRCS_CXX}) TARGET_LINK_LIBRARIES(AmTelnetServerTest diff --git a/AudioManagerDaemon/test/CMakeLists.txt b/AudioManagerDaemon/test/CMakeLists.txt index 2588e8f..c897645 100644 --- a/AudioManagerDaemon/test/CMakeLists.txt +++ b/AudioManagerDaemon/test/CMakeLists.txt @@ -25,7 +25,10 @@ add_subdirectory (AmDatabaseHandlerTest) add_subdirectory (AmRouterTest) add_subdirectory (AmRoutingInterfaceTest) add_subdirectory (AmSocketHandlerTest) -add_subdirectory (AmNodeStateCommunicatorTest) +IF(WITH_NSM) + add_subdirectory (AmNodeStateCommunicatorTest) +ENDIF(WITH_NSM) + IF(WITH_TELNET) add_subdirectory (AmTelnetServerTest) ENDIF(WITH_TELNET) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1f4e4da..a5e60d7 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -79,6 +79,10 @@ OPTION ( GLIB_DBUS_TYPES_TOLERANT OPTION ( WITH_NSM "build with NSM support" ON) +IF (NOT WITH_DBUS_WRAPPER) + SET (WITH_NSM OFF) +ENDIF (NOT WITH_DBUS_WRAPPER) + #Can be changed via passing -DDBUS_SERVICE_PREFIX="XXX" to cmake IF(NOT DEFINED DBUS_SERVICE_PREFIX) |