summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchristian mueller <christian.ei.mueller@bmw.de>2012-01-30 18:38:07 +0100
committerchristian mueller <christian.ei.mueller@bmw.de>2012-01-31 17:40:32 +0100
commitad0c452e9890a35a1b7a6c2e2421e092c5cf2c2d (patch)
tree48cc38fa0a4ada0ece0f8571260c5438b64a675c
parent58d62c4af578c10375bf9baa946e33f340c42a1f (diff)
downloadaudiomanager-ad0c452e9890a35a1b7a6c2e2421e092c5cf2c2d.tar.gz
* wrapping DLT calls in a new Class because of performance, codesize and lazyness reasons
* the whole project now compiles without a warning with -pedantic
-rw-r--r--AudioManagerDaemon/CMakeLists.txt1
-rw-r--r--AudioManagerDaemon/include/PluginTemplate.h12
-rw-r--r--AudioManagerDaemon/include/RoutingReceiver.h4
-rw-r--r--AudioManagerDaemon/src/CommandReceiver.cpp20
-rw-r--r--AudioManagerDaemon/src/CommandSender.cpp16
-rw-r--r--AudioManagerDaemon/src/ControlReceiver.cpp99
-rw-r--r--AudioManagerDaemon/src/ControlSender.cpp10
-rw-r--r--AudioManagerDaemon/src/DBusWrapper.cpp65
-rw-r--r--AudioManagerDaemon/src/DLTWrapper.cpp122
-rw-r--r--AudioManagerDaemon/src/DatabaseHandler.cpp585
-rw-r--r--AudioManagerDaemon/src/Router.cpp14
-rw-r--r--AudioManagerDaemon/src/RoutingReceiver.cpp4
-rw-r--r--AudioManagerDaemon/src/RoutingSender.cpp18
-rw-r--r--AudioManagerDaemon/src/SocketHandler.cpp9
-rw-r--r--AudioManagerDaemon/src/TelnetServer.cpp8
-rw-r--r--AudioManagerDaemon/src/main.cpp20
-rw-r--r--AudioManagerDaemon/test/controlInterface/CMakeLists.txt1
-rw-r--r--AudioManagerDaemon/test/controlInterface/controlInterfaceTest.cpp9
-rw-r--r--AudioManagerDaemon/test/controlInterface/controlInterfaceTest.h1
-rw-r--r--AudioManagerDaemon/test/database/CMakeLists.txt1
-rw-r--r--AudioManagerDaemon/test/database/databaseTest.cpp12
-rw-r--r--AudioManagerDaemon/test/database/databaseTest.h1
-rw-r--r--AudioManagerDaemon/test/routing/CMakeLists.txt1
-rw-r--r--AudioManagerDaemon/test/routing/routingTest.cpp913
-rw-r--r--AudioManagerDaemon/test/routing/routingTest.h1
-rw-r--r--AudioManagerDaemon/test/routingInterface/CMakeLists.txt1
-rw-r--r--AudioManagerDaemon/test/routingInterface/routingInterfaceTest.cpp8
-rw-r--r--AudioManagerDaemon/test/routingInterface/routingInterfaceTest.h1
-rw-r--r--AudioManagerDaemon/test/sockethandler/CMakeLists.txt1
-rw-r--r--AudioManagerDaemon/test/sockethandler/sockethandlerTest.cpp3
-rw-r--r--CHANGELOG11
-rw-r--r--CMakeLists.txt4
-rw-r--r--PluginCommandInterfaceDbus/CMakeLists.txt3
-rw-r--r--PluginCommandInterfaceDbus/include/CommandReceiverShadow.h1
-rw-r--r--PluginCommandInterfaceDbus/include/DBusCommandSender.h1
-rw-r--r--PluginCommandInterfaceDbus/include/DBusMessageHandler.h1
-rw-r--r--PluginCommandInterfaceDbus/src/CommandReceiverShadow.cpp41
-rw-r--r--PluginCommandInterfaceDbus/src/DBusCommandSender.cpp58
-rw-r--r--PluginCommandInterfaceDbus/src/DBusMessageHandler.cpp66
-rw-r--r--PluginCommandInterfaceDbus/test/CMakeLists.txt2
-rw-r--r--PluginCommandInterfaceDbus/test/dbuscommandpluginInterfaceTest.cpp2
-rw-r--r--PluginCommandInterfaceDbus/test/dbuscommandpluginInterfaceTest.h2
-rw-r--r--PluginCommandInterfaceDbus/test/dbuscommaninterfacesignalsTest.cpp9
-rw-r--r--PluginCommandInterfaceDbus/test/dbuscommaninterfacesignalsTest.h1
-rw-r--r--PluginControlInterface/CMakeLists.txt2
-rw-r--r--PluginRoutingInterfaceAsync/include/DltContext.h31
-rw-r--r--PluginRoutingInterfaceAsync/src/RoutingReceiverAsyncShadow.cpp38
-rw-r--r--PluginRoutingInterfaceAsync/src/RoutingSenderAsync.cpp56
-rw-r--r--PluginRoutingInterfaceAsync/test/CMakeLists.txt2
-rw-r--r--PluginRoutingInterfaceAsync/test/mocklnterfaces.h4
-rw-r--r--PluginRoutingInterfaceAsync/test/testRoutingInterfaceAsync.cpp8
-rw-r--r--PluginRoutingInterfaceAsync/test/testRoutingInterfaceAsync.h1
-rw-r--r--PluginRoutingInterfaceAsync/test/testRoutingInterfaceAsyncInterrupt.cpp8
-rw-r--r--PluginRoutingInterfaceDbus/CMakeLists.txt2
-rw-r--r--includes/DLTWrapper.h457
-rw-r--r--includes/config.h2
-rw-r--r--includes/routing/RoutingReceiveInterface.h12
57 files changed, 2143 insertions, 643 deletions
diff --git a/AudioManagerDaemon/CMakeLists.txt b/AudioManagerDaemon/CMakeLists.txt
index c6cbb62..b10c8fb 100644
--- a/AudioManagerDaemon/CMakeLists.txt
+++ b/AudioManagerDaemon/CMakeLists.txt
@@ -38,6 +38,7 @@ SET(AUDIOMAN_SRCS_CXX
src/SocketHandler.cpp
src/TelnetServer.cpp
src/Router.cpp
+ src/DLTWrapper.cpp
)
IF(WITH_DBUS_WRAPPER)
diff --git a/AudioManagerDaemon/include/PluginTemplate.h b/AudioManagerDaemon/include/PluginTemplate.h
index e677acf..2c4dc42 100644
--- a/AudioManagerDaemon/include/PluginTemplate.h
+++ b/AudioManagerDaemon/include/PluginTemplate.h
@@ -25,11 +25,9 @@
#ifndef PLUGINTEMPLATE_H_
#define PLUGINTEMPLATE_H_
-#include <dlt/dlt.h>
#include <dlfcn.h>
#include <libgen.h>
-
-DLT_IMPORT_CONTEXT(AudioManager)
+#include "DLTWrapper.h"
namespace am
{
@@ -42,7 +40,7 @@ namespace am
template<class T> T* getCreateFunction(const std::string& libname, void*& libraryHandle)
{
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("Trying to load libray with name: "), DLT_STRING(libname.c_str()));
+ logInfo("getCreateFunction : Trying to load library with name: ",libname);
// cut off directories
char* fileWithPath = const_cast<char*>(libname.c_str());
@@ -57,7 +55,7 @@ template<class T> T* getCreateFunction(const std::string& libname, void*& librar
const char* dlopen_error = dlerror();
if (!libraryHandle || dlopen_error)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("dlopen failed"), DLT_STRING(dlopen_error));
+ logError("getCreateFunction : dlopen failed",dlopen_error);
return 0;
}
@@ -80,11 +78,11 @@ template<class T> T* getCreateFunction(const std::string& libname, void*& librar
const char* dlsym_error = dlerror();
if (!createFunction || dlsym_error)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("Failed to load shared lib entry point"), DLT_STRING(dlsym_error));
+ logError("getCreateFunction: Failed to load shared lib entry point",dlsym_error);
}
else
{
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("loaded successfully plugin"), DLT_STRING(createFunctionName.c_str()));
+ logInfo("getCreateFunction : loaded successfully plugin", createFunctionName);
}
return createFunction;
}
diff --git a/AudioManagerDaemon/include/RoutingReceiver.h b/AudioManagerDaemon/include/RoutingReceiver.h
index 7c59978..90885ca 100644
--- a/AudioManagerDaemon/include/RoutingReceiver.h
+++ b/AudioManagerDaemon/include/RoutingReceiver.h
@@ -72,8 +72,8 @@ public:
am_Error_e deregisterSource(const am_sourceID_t sourceID);
am_Error_e registerCrossfader(const am_Crossfader_s& crossfaderData, am_crossfaderID_t& crossfaderID);
am_Error_e deregisterCrossfader(const am_crossfaderID_t crossfaderID);
- am_Error_e peekSinkClassID(const std::string name, const am_sinkClass_t& sinkClassID);
- am_Error_e peekSourceClassID(const std::string name, const am_sourceClass_t& sourceClassID);
+ am_Error_e peekSinkClassID(const std::string& name, const am_sinkClass_t& sinkClassID);
+ am_Error_e peekSourceClassID(const std::string& name, const am_sourceClass_t& sourceClassID);
void hookInterruptStatusChange(const am_sourceID_t sourceID, const am_InterruptState_e interruptState);
void hookDomainRegistrationComplete(const am_domainID_t domainID);
void hookSinkAvailablityStatusChange(const am_sinkID_t sinkID, const am_Availability_s& availability);
diff --git a/AudioManagerDaemon/src/CommandReceiver.cpp b/AudioManagerDaemon/src/CommandReceiver.cpp
index 46d1714..b0145f1 100644
--- a/AudioManagerDaemon/src/CommandReceiver.cpp
+++ b/AudioManagerDaemon/src/CommandReceiver.cpp
@@ -25,12 +25,10 @@
#include "CommandReceiver.h"
#include "DatabaseHandler.h"
#include "ControlSender.h"
+#include "DLTWrapper.h"
#include <SocketHandler.h>
#include <config.h>
#include <assert.h>
-#include <dlt/dlt.h>
-
-DLT_IMPORT_CONTEXT(AudioManager)
using namespace am;
@@ -72,49 +70,49 @@ CommandReceiver::~CommandReceiver()
am_Error_e CommandReceiver::connect(const am_sourceID_t sourceID, const am_sinkID_t sinkID, am_mainConnectionID_t & mainConnectionID)
{
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("CommandReceiver::connect got called:"), DLT_STRING("sourceID"), DLT_INT(sourceID), DLT_STRING("sinkID"), DLT_INT(sinkID));
+ logInfo("CommandReceiver::connect got called, sourceID=", sourceID, "sinkID=", sinkID);
return mControlSender->hookUserConnectionRequest(sourceID, sinkID, mainConnectionID);
}
am_Error_e CommandReceiver::disconnect(const am_mainConnectionID_t mainConnectionID)
{
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("CommandReceiver::disconnect got called, mainConnectionID="), DLT_INT(mainConnectionID));
+ logInfo("CommandReceiver::disconnect got called, mainConnectionID=", mainConnectionID);
return mControlSender->hookUserDisconnectionRequest(mainConnectionID);
}
am_Error_e CommandReceiver::setVolume(const am_sinkID_t sinkID, const am_mainVolume_t volume)
{
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("CommandReceiver::setVolume got called, sinkID="), DLT_INT(sinkID), DLT_STRING("volume="), DLT_INT(volume));
+ logInfo("CommandReceiver::setVolume got called, sinkID=", sinkID, "volume=", volume);
return mControlSender->hookUserVolumeChange(sinkID, volume);
}
am_Error_e CommandReceiver::volumeStep(const am_sinkID_t sinkID, const int16_t volumeStep)
{
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("CommandReceiver::volumeStep got called, sinkID="), DLT_INT(sinkID), DLT_STRING("volumeStep="), DLT_INT(volumeStep));
+ logInfo("CommandReceiver::volumeStep got called, sinkID=", sinkID, "volumeStep=", volumeStep);
return mControlSender->hookUserVolumeStep(sinkID, volumeStep);
}
am_Error_e CommandReceiver::setSinkMuteState(const am_sinkID_t sinkID, const am_MuteState_e muteState)
{
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("CommandReceiver::setSinkMuteState got called, sinkID="), DLT_INT(sinkID), DLT_STRING("muteState="), DLT_INT(muteState));
+ logInfo("CommandReceiver::setSinkMuteState got called, sinkID=", sinkID, "muteState=", muteState);
return mControlSender->hookUserSetSinkMuteState(sinkID, muteState);
}
am_Error_e CommandReceiver::setMainSinkSoundProperty(const am_MainSoundProperty_s & soundProperty, const am_sinkID_t sinkID)
{
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("CommandReceiver::setMainSinkSoundProperty got called, sinkID="), DLT_INT(sinkID), DLT_STRING("soundPropertyType="), DLT_INT(soundProperty.type), DLT_STRING("soundPropertyValue="), DLT_INT(soundProperty.value));
+ logInfo("CommandReceiver::setMainSinkSoundProperty got called, sinkID=", sinkID, "soundPropertyType=", soundProperty.type, "soundPropertyValue=", soundProperty.value);
return mControlSender->hookUserSetMainSinkSoundProperty(sinkID, soundProperty);
}
am_Error_e CommandReceiver::setMainSourceSoundProperty(const am_MainSoundProperty_s & soundProperty, const am_sourceID_t sourceID)
{
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("CommandReceiver::setMainSourceSoundProperty got called, sourceID="), DLT_INT(sourceID), DLT_STRING("soundPropertyType="), DLT_INT(soundProperty.type), DLT_STRING("soundPropertyValue="), DLT_INT(soundProperty.value));
+ logInfo("CommandReceiver::setMainSourceSoundProperty got called, sourceID=", sourceID, "soundPropertyType=", soundProperty.type, "soundPropertyValue=", soundProperty.value);
return mControlSender->hookUserSetMainSourceSoundProperty(sourceID, soundProperty);
}
am_Error_e CommandReceiver::setSystemProperty(const am_SystemProperty_s & property)
{
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("CommandReceiver::setSystemProperty got called"), DLT_STRING("type="), DLT_INT(property.type), DLT_STRING("soundPropertyValue="), DLT_INT(property.value));
+ logInfo("CommandReceiver::setSystemProperty got called", "type=", property.type, "soundPropertyValue=", property.value);
return mControlSender->hookUserSetSystemProperty(property);
}
diff --git a/AudioManagerDaemon/src/CommandSender.cpp b/AudioManagerDaemon/src/CommandSender.cpp
index a02d3f8..7a5b75e 100644
--- a/AudioManagerDaemon/src/CommandSender.cpp
+++ b/AudioManagerDaemon/src/CommandSender.cpp
@@ -25,14 +25,12 @@
#include "CommandSender.h"
#include "command/CommandReceiveInterface.h"
#include <dirent.h>
-#include <dlt/dlt.h>
#include "PluginTemplate.h"
+#include "DLTWrapper.h"
using namespace am;
#define REQUIRED_INTERFACE_VERSION 1
-DLT_IMPORT_CONTEXT(AudioManager)
-
//!< macro to call all interfaces
#define CALL_ALL_INTERFACES(...) \
std::vector<CommandSendInterface*>::iterator iter = mListInterfaces.begin(); \
@@ -54,12 +52,12 @@ CommandSender::CommandSender(const std::vector<std::string>& listOfPluginDirecto
for (; dirIter < dirIterEnd; ++dirIter)
{
const char* directoryName = dirIter->c_str();
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("Searching for CommandPlugins in"), DLT_STRING(directoryName));
+ logInfo("Searching for CommandPlugins in",directoryName);
DIR *directory = opendir(directoryName);
if (!directory)
{
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("Error opening directory "), DLT_STRING(directoryName));
+ logInfo("Error opening directory ",directoryName);
continue;
}
@@ -88,14 +86,14 @@ CommandSender::CommandSender(const std::vector<std::string>& listOfPluginDirecto
for (; iter < iterEnd; ++iter)
{
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("Loading CommandSender plugin"), DLT_STRING(iter->c_str()));
+ logInfo("Loading CommandSender plugin",*iter);
CommandSendInterface* (*createFunc)();
void* tempLibHandle = NULL;
createFunc = getCreateFunction<CommandSendInterface*()>(*iter, tempLibHandle);
if (!createFunc)
{
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("Entry point of CommandPlugin not found"), DLT_STRING(iter->c_str()));
+ logInfo("Entry point of CommandPlugin not found",*iter);
continue;
}
@@ -103,14 +101,14 @@ CommandSender::CommandSender(const std::vector<std::string>& listOfPluginDirecto
if (!commander)
{
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("CommandPlugin initialization failed. Entry Function not callable"));
+ logInfo("CommandPlugin initialization failed. Entry Function not callable");
continue;
}
//check libversion
if (commander->getInterfaceVersion() < REQUIRED_INTERFACE_VERSION)
{
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("RoutingPlugin initialization failed. Version of Interface to old"));
+ logInfo("RoutingPlugin initialization failed. Version of Interface to old");
continue;
}
diff --git a/AudioManagerDaemon/src/ControlReceiver.cpp b/AudioManagerDaemon/src/ControlReceiver.cpp
index ac51be7..b32ffdd 100644
--- a/AudioManagerDaemon/src/ControlReceiver.cpp
+++ b/AudioManagerDaemon/src/ControlReceiver.cpp
@@ -29,10 +29,8 @@
#include "RoutingSender.h"
#include "CommandSender.h"
#include "Router.h"
-#include <assert.h>
-#include <dlt/dlt.h>
-
-DLT_IMPORT_CONTEXT(AudioManager)
+#include "DLTWrapper.h"
+#include <cassert>
using namespace am;
@@ -68,13 +66,13 @@ ControlReceiver::~ControlReceiver()
am_Error_e ControlReceiver::getRoute(const bool onlyfree, const am_sourceID_t sourceID, const am_sinkID_t sinkID, std::vector<am_Route_s> & returnList)
{
- mRouter->getRoute(onlyfree,sourceID,sinkID,returnList);
+ mRouter->getRoute(onlyfree, sourceID, sinkID, returnList);
return E_NOT_USED;
}
am_Error_e ControlReceiver::connect(am_Handle_s & handle, am_connectionID_t & connectionID, const am_ConnectionFormat_e format, const am_sourceID_t sourceID, const am_sinkID_t sinkID)
{
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("ControlReceiver::connect got called, connectionFormat"), DLT_INT(format), DLT_STRING("sourceID"), DLT_INT(sourceID), DLT_STRING("sinkID"), DLT_INT(sinkID));
+ logInfo("ControlReceiver::connect got called, connectionFormat=", format, "sourceID=", sourceID, "sinkID=", sinkID);
am_Connection_s tempConnection;
tempConnection.sinkID = sinkID;
@@ -83,7 +81,8 @@ am_Error_e ControlReceiver::connect(am_Handle_s & handle, am_connectionID_t & co
tempConnection.connectionID = 0;
//todo: enter function to find out what happends if the same connection is in the course of being build up.
- if (mDatabaseHandler->existConnection(tempConnection)) return E_ALREADY_EXISTS; //todo:enter the correct connectionID here?
+ if (mDatabaseHandler->existConnection(tempConnection))
+ return E_ALREADY_EXISTS; //todo:enter the correct connectionID here?
mDatabaseHandler->enterConnectionDB(tempConnection, connectionID);
return mRoutingSender->asyncConnect(handle, connectionID, sourceID, sinkID, format);
@@ -91,115 +90,135 @@ am_Error_e ControlReceiver::connect(am_Handle_s & handle, am_connectionID_t & co
am_Error_e ControlReceiver::disconnect(am_Handle_s & handle, const am_connectionID_t connectionID)
{
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("ControlReceiver::disconnect got called, connectionID="), DLT_INT(connectionID));
+ logInfo("ControlReceiver::disconnect got called, connectionID=", connectionID);
- if (!mDatabaseHandler->existConnectionID(connectionID)) return E_NON_EXISTENT; //todo: check with EA model and correct
+ if (!mDatabaseHandler->existConnectionID(connectionID))
+ return E_NON_EXISTENT; //todo: check with EA model and correct
return mRoutingSender->asyncDisconnect(handle, connectionID);
}
am_Error_e ControlReceiver::crossfade(am_Handle_s & handle, const am_HotSink_e hotSource, const am_crossfaderID_t crossfaderID, const am_RampType_e rampType, const am_time_t rampTime)
{
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("ControlReceiver::crossfade got called, hotSource="), DLT_INT(hotSource), DLT_STRING("crossfaderID="), DLT_INT(crossfaderID), DLT_STRING("rampType="), DLT_INT(rampType), DLT_STRING("rampTime="), DLT_INT(rampTime));
+ logInfo("ControlReceiver::crossfade got called, hotSource=",hotSource,"crossfaderID=",crossfaderID,"rampType=",rampType,"rampTime=",rampTime);
- if (!mDatabaseHandler->existcrossFader(crossfaderID)) return E_NON_EXISTENT;
+ if (!mDatabaseHandler->existcrossFader(crossfaderID))
+ return E_NON_EXISTENT;
return mRoutingSender->asyncCrossFade(handle, crossfaderID, hotSource, rampType, rampTime);
}
am_Error_e ControlReceiver::setSourceState(am_Handle_s & handle, const am_sourceID_t sourceID, const am_SourceState_e state)
{
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("ControlReceiver::setSourceState got called, sourceID="), DLT_INT(sourceID), DLT_STRING("state="), DLT_INT(state));
+ logInfo("ControlReceiver::setSourceState got called, sourceID=",sourceID,"state=",state);
am_SourceState_e sourceState;
- if (mDatabaseHandler->getSoureState(sourceID, sourceState) != E_OK) return E_UNKNOWN;
- if (sourceState == state) return E_NO_CHANGE;
+ if (mDatabaseHandler->getSoureState(sourceID, sourceState) != E_OK)
+ return E_UNKNOWN;
+ if (sourceState == state)
+ return E_NO_CHANGE;
return mRoutingSender->asyncSetSourceState(handle, sourceID, state);
}
am_Error_e ControlReceiver::setSinkVolume(am_Handle_s & handle, const am_sinkID_t sinkID, const am_volume_t volume, const am_RampType_e ramp, const am_time_t time)
{
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("ControlReceiver::setSinkVolume got called, sinkID="), DLT_INT(sinkID), DLT_STRING("volume="), DLT_INT(volume), DLT_STRING("ramp="), DLT_INT(ramp), DLT_STRING("time="), DLT_INT(time));
+ logInfo("ControlReceiver::setSinkVolume got called, sinkID=",sinkID,"volume=",volume,"ramp=",ramp, "time=",time);
am_volume_t tempVolume;
- if (mDatabaseHandler->getSinkVolume(sinkID, tempVolume) != E_OK) return E_UNKNOWN;
- if (tempVolume == volume) return E_NO_CHANGE;
+ if (mDatabaseHandler->getSinkVolume(sinkID, tempVolume) != E_OK)
+ return E_UNKNOWN;
+ if (tempVolume == volume)
+ return E_NO_CHANGE;
return mRoutingSender->asyncSetSinkVolume(handle, sinkID, volume, ramp, time);
}
am_Error_e ControlReceiver::setSourceVolume(am_Handle_s & handle, const am_sourceID_t sourceID, const am_volume_t volume, const am_RampType_e rampType, const am_time_t time)
{
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("ControlReceiver::setSourceVolume got called, sourceID="), DLT_INT(sourceID), DLT_STRING("volume="), DLT_INT(volume), DLT_STRING("ramp="), DLT_INT(rampType), DLT_STRING("time="), DLT_INT(time));
+ logInfo("ControlReceiver::setSourceVolume got called, sourceID=",sourceID,"volume=",volume,"ramp=",rampType,"time=",time);
am_volume_t tempVolume;
- if (mDatabaseHandler->getSourceVolume(sourceID, tempVolume) != E_OK) return E_UNKNOWN;
- if (tempVolume == volume) return E_NO_CHANGE;
+ if (mDatabaseHandler->getSourceVolume(sourceID, tempVolume) != E_OK)
+ return E_UNKNOWN;
+ if (tempVolume == volume)
+ return E_NO_CHANGE;
return mRoutingSender->asyncSetSourceVolume(handle, sourceID, volume, rampType, time);
}
am_Error_e ControlReceiver::setSinkSoundProperty(am_Handle_s & handle, const am_sinkID_t sinkID, const am_SoundProperty_s & soundProperty)
{
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("ControlReceiver::setSinkSoundProperty got called, sinkID="), DLT_INT(sinkID), DLT_STRING("soundProperty.Type="), DLT_INT(soundProperty.type), DLT_STRING("soundProperty.value="), DLT_INT(soundProperty.value));
+ logInfo("ControlReceiver::setSinkSoundProperty got called, sinkID=",sinkID,"soundProperty.Type=",soundProperty.type,"soundProperty.value=",soundProperty.value);
uint16_t value;
- if (mDatabaseHandler->getSinkSoundPropertyValue(sinkID, soundProperty.type, value) != E_OK) return E_UNKNOWN;
- if (value == soundProperty.value) return E_NO_CHANGE;
+ if (mDatabaseHandler->getSinkSoundPropertyValue(sinkID, soundProperty.type, value) != E_OK)
+ return E_UNKNOWN;
+ if (value == soundProperty.value)
+ return E_NO_CHANGE;
return mRoutingSender->asyncSetSinkSoundProperty(handle, sinkID, soundProperty);
}
am_Error_e ControlReceiver::setSinkSoundProperties(am_Handle_s & handle, const am_sinkID_t sinkID, const std::vector<am_SoundProperty_s> & listSoundProperties)
{
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("ControlReceiver::setSinkSoundProperties got called, sinkID="), DLT_INT(sinkID));
+ logInfo("ControlReceiver::setSinkSoundProperties got called, sinkID=",sinkID);
uint16_t value;
bool noChange = true;
std::vector<am_SoundProperty_s>::const_iterator it = listSoundProperties.begin();
for (; it != listSoundProperties.end(); ++it)
{
- if (mDatabaseHandler->getSinkSoundPropertyValue(sinkID, it->type, value) != E_OK) return (E_UNKNOWN);
- if (value != it->value) noChange = false;
+ if (mDatabaseHandler->getSinkSoundPropertyValue(sinkID, it->type, value) != E_OK)
+ return (E_UNKNOWN);
+ if (value != it->value)
+ noChange = false;
}
- if (noChange) return (E_NO_CHANGE);
+ if (noChange)
+ return (E_NO_CHANGE);
return (mRoutingSender->asyncSetSinkSoundProperties(handle, listSoundProperties, sinkID));
}
am_Error_e ControlReceiver::setSourceSoundProperty(am_Handle_s & handle, const am_sourceID_t sourceID, const am_SoundProperty_s & soundProperty)
{
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("ControlReceiver::setSourceSoundProperty got called, sourceID="), DLT_INT(sourceID), DLT_STRING("soundProperty.Type="), DLT_INT(soundProperty.type), DLT_STRING("soundProperty.value="), DLT_INT(soundProperty.value));
+ logInfo("ControlReceiver::setSourceSoundProperty got called, sourceID=",sourceID,"soundProperty.Type=",soundProperty.type,"soundProperty.value=",soundProperty.value);
uint16_t value;
- if (mDatabaseHandler->getSourceSoundPropertyValue(sourceID, soundProperty.type, value) != E_OK) return E_UNKNOWN;
- if (value == soundProperty.value) return E_NO_CHANGE;
+ if (mDatabaseHandler->getSourceSoundPropertyValue(sourceID, soundProperty.type, value) != E_OK)
+ return E_UNKNOWN;
+ if (value == soundProperty.value)
+ return E_NO_CHANGE;
return mRoutingSender->asyncSetSourceSoundProperty(handle, sourceID, soundProperty);
}
am_Error_e ControlReceiver::setSourceSoundProperties(am_Handle_s & handle, const am_sourceID_t sourceID, const std::vector<am_SoundProperty_s> & listSoundProperties)
{
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("ControlReceiver::setSourceSoundProperties got called, sourceID="), DLT_INT(sourceID));
+ logInfo("ControlReceiver::setSourceSoundProperties got called, sourceID=",sourceID);
uint16_t value;
bool noChange = true;
std::vector<am_SoundProperty_s>::const_iterator it = listSoundProperties.begin();
for (; it != listSoundProperties.end(); ++it)
{
- if (mDatabaseHandler->getSourceSoundPropertyValue(sourceID, it->type, value) != E_OK) return (E_UNKNOWN);
- if (value != it->value) noChange = false;
+ if (mDatabaseHandler->getSourceSoundPropertyValue(sourceID, it->type, value) != E_OK)
+ return (E_UNKNOWN);
+ if (value != it->value)
+ noChange = false;
}
- if (noChange) return (E_NO_CHANGE);
+ if (noChange)
+ return (E_NO_CHANGE);
return (mRoutingSender->asyncSetSourceSoundProperties(handle, listSoundProperties, sourceID));
}
am_Error_e ControlReceiver::setDomainState(const am_domainID_t domainID, const am_DomainState_e domainState)
{
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("ControlReceiver::setDomainState got called, domainID="), DLT_INT(domainID), DLT_STRING("domainState="), DLT_INT(domainState));
+ logInfo("ControlReceiver::setDomainState got called, domainID=",domainID,"domainState=",domainState);
am_DomainState_e tempState = DS_MIN;
- if (mDatabaseHandler->getDomainState(domainID, tempState) != E_OK) return E_UNKNOWN;
- if (tempState == domainState) return E_NO_CHANGE;
+ if (mDatabaseHandler->getDomainState(domainID, tempState) != E_OK)
+ return E_UNKNOWN;
+ if (tempState == domainState)
+ return E_NO_CHANGE;
return mRoutingSender->setDomainState(domainID, domainState);
}
am_Error_e ControlReceiver::abortAction(const am_Handle_s handle)
{
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("ControlReceiver::abortAction got called, handle.type="), DLT_INT(handle.handle), DLT_STRING("handle.handleType="), DLT_INT(handle.handleType));
+ logInfo("ControlReceiver::abortAction got called, handle.type=",handle.handle,"handle.handleType=",handle.handleType);
return mRoutingSender->asyncAbort(handle);
}
@@ -446,13 +465,13 @@ am_Error_e ControlReceiver::removeSourceClassDB(const am_sourceClass_t sourceCla
void ControlReceiver::setCommandReady()
{
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("ControlReceiver::setCommandReady got called"));
+ logInfo("ControlReceiver::setCommandReady got called");
mCommandSender->cbCommunicationReady();
}
void ControlReceiver::setRoutingReady()
{
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("ControlReceiver::setRoutingReady got called"));
+ logInfo("ControlReceiver::setRoutingReady got called");
mRoutingSender->routingInterfacesReady();
}
diff --git a/AudioManagerDaemon/src/ControlSender.cpp b/AudioManagerDaemon/src/ControlSender.cpp
index ca7ce3a..934f594 100644
--- a/AudioManagerDaemon/src/ControlSender.cpp
+++ b/AudioManagerDaemon/src/ControlSender.cpp
@@ -23,12 +23,10 @@
*/
#include "ControlSender.h"
+#include "PluginTemplate.h"
+#include "DLTWrapper.h"
#include <assert.h>
-#include <dlt/dlt.h>
#include <fstream>
-#include "PluginTemplate.h"
-
-DLT_IMPORT_CONTEXT(AudioManager)
using namespace am;
@@ -41,7 +39,7 @@ ControlSender::ControlSender(std::string controlPluginFile) :
std::ifstream isfile(controlPluginFile.c_str());
if (!isfile)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("ControlSender::ControlSender: Controller plugin not found:"), DLT_STRING(controlPluginFile.c_str()));
+ logError("ControlSender::ControlSender: Controller plugin not found:",controlPluginFile);
}
else if (!controlPluginFile.empty())
{
@@ -55,7 +53,7 @@ ControlSender::ControlSender(std::string controlPluginFile) :
}
else
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("ControlSender::ControlSender: No controller loaded !"));
+ logError("ControlSender::ControlSender: No controller loaded !");
}
}
diff --git a/AudioManagerDaemon/src/DBusWrapper.cpp b/AudioManagerDaemon/src/DBusWrapper.cpp
index 94f0788..a271017 100644
--- a/AudioManagerDaemon/src/DBusWrapper.cpp
+++ b/AudioManagerDaemon/src/DBusWrapper.cpp
@@ -28,14 +28,12 @@
#include <fstream>
#include <sstream>
#include <string>
-#include <dlt/dlt.h>
#include <assert.h>
#include <stdlib.h>
+#include "DLTWrapper.h"
using namespace am;
-DLT_IMPORT_CONTEXT(AudioManager)
-
#define ROOT_INTROSPECT_XML \
DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE \
"<node>" \
@@ -58,16 +56,16 @@ DBusWrapper::DBusWrapper() :
mListTimerhandlePointer()
{
dbus_error_init(&mDBusError);
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("DBusWrapper::DBusWrapper Opening DBus connection"));
+ logInfo("DBusWrapper::DBusWrapper Opening DBus connection");
mDbusConnection = dbus_bus_get(DBUS_BUS_SESSION, &mDBusError);
if (dbus_error_is_set(&mDBusError))
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DBusWrapper::DBusWrapper Error while getting the DBus"));
+ logError("DBusWrapper::DBusWrapper Error while getting the DBus");
dbus_error_free(&mDBusError);
}
if (NULL == mDbusConnection)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DBusWrapper::DBusWrapper DBus Connection is null"));
+ logError("DBusWrapper::DBusWrapper DBus Connection is null");
}
//first, we are old enought to live longer then the connection:
@@ -78,12 +76,12 @@ DBusWrapper::DBusWrapper() :
int ret = dbus_bus_request_name(mDbusConnection, DBUS_SERVICE_PREFIX, DBUS_NAME_FLAG_DO_NOT_QUEUE, &mDBusError);
if (dbus_error_is_set(&mDBusError))
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DBusWrapper::DBusWrapper Name Error"), DLT_STRING(mDBusError.message));
+ logError("DBusWrapper::DBusWrapper Name Error",mDBusError.message);
dbus_error_free(&mDBusError);
}
if (DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER != ret)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DBusWrapper::DBusWrapper Wrapper is not the Primary Owner"), DLT_INT(ret));
+ logError("DBusWrapper::DBusWrapper Wrapper is not the Primary Owner",ret);
exit(1);
}
}
@@ -102,16 +100,16 @@ DBusWrapper::DBusWrapper(SocketHandler* socketHandler) :
assert(mSocketHandler!=0);
dbus_error_init(&mDBusError);
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("DBusWrapper::DBusWrapper Opening DBus connection"));
+ logInfo("DBusWrapper::DBusWrapper Opening DBus connection");
mDbusConnection = dbus_bus_get(DBUS_BUS_SESSION, &mDBusError);
if (dbus_error_is_set(&mDBusError))
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DBusWrapper::DBusWrapper Error while getting the DBus"));
+ logError("DBusWrapper::DBusWrapper Error while getting the DBus");
dbus_error_free(&mDBusError);
}
if (NULL == mDbusConnection)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DBusWrapper::DBusWrapper DBus Connection is null"));
+ logError("DBusWrapper::DBusWrapper DBus Connection is null");
}
//then we need to adopt the dbus to our mainloop:
@@ -125,14 +123,14 @@ DBusWrapper::DBusWrapper(SocketHandler* socketHandler) :
dbus_bool_t watch = dbus_connection_set_watch_functions(mDbusConnection, addWatch, removeWatch, toogleWatch, this, NULL);
if (!watch)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DBusWrapper::DBusWrapper Registering of watch functions failed"));
+ logError("DBusWrapper::DBusWrapper Registering of watch functions failed");
}
//add timer functions:
dbus_bool_t timer = dbus_connection_set_timeout_functions(mDbusConnection, addTimeout, removeTimeout, toggleTimeout, this, NULL);
if (!timer)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DBusWrapper::DBusWrapper Registering of timer functions failed"));
+ logError("DBusWrapper::DBusWrapper Registering of timer functions failed");
}
//register callback for Introspectio
@@ -141,12 +139,12 @@ DBusWrapper::DBusWrapper(SocketHandler* socketHandler) :
int ret = dbus_bus_request_name(mDbusConnection, DBUS_SERVICE_PREFIX, DBUS_NAME_FLAG_DO_NOT_QUEUE, &mDBusError);
if (dbus_error_is_set(&mDBusError))
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DBusWrapper::DBusWrapper Name Error"), DLT_STRING(mDBusError.message));
+ logError("DBusWrapper::DBusWrapper Name Error",mDBusError.message);
dbus_error_free(&mDBusError);
}
if (DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER != ret)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DBusWrapper::DBusWrapper Wrapper is not the Primary Owner"), DLT_INT(ret));
+ logError("DBusWrapper::DBusWrapper Wrapper is not the Primary Owner",ret);
exit(1);
}
}
@@ -154,7 +152,7 @@ DBusWrapper::DBusWrapper(SocketHandler* socketHandler) :
DBusWrapper::~DBusWrapper()
{
//close the connection again
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("DBusWrapper::~DBusWrapper Closing DBus connection"));
+ logInfo("DBusWrapper::~DBusWrapper Closing DBus connection");
dbus_connection_unref(mDbusConnection);
//clean up all timerhandles we created but did not delete before
@@ -167,7 +165,7 @@ DBusWrapper::~DBusWrapper()
void DBusWrapper::registerCallback(const DBusObjectPathVTable* vtable, const std::string& path, void* userdata)
{
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("DBusWrapper::~registerCallback register callback:"), DLT_STRING(path.c_str()));
+ logInfo("DBusWrapper::~registerCallback register callback:",path);
std::string completePath = std::string(DBUS_SERVICE_OBJECT_PATH) + "/" + path;
dbus_error_init(&mDBusError);
@@ -175,7 +173,7 @@ void DBusWrapper::registerCallback(const DBusObjectPathVTable* vtable, const std
dbus_connection_register_object_path(mDbusConnection, completePath.c_str(), vtable, userdata);
if (dbus_error_is_set(&mDBusError))
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DBusWrapper::registerCallack error: "), DLT_STRING(mDBusError.message));
+ logError("DBusWrapper::registerCallack error: ",mDBusError.message);
dbus_error_free(&mDBusError);
}
mNodesList.push_back(path);
@@ -183,7 +181,7 @@ void DBusWrapper::registerCallback(const DBusObjectPathVTable* vtable, const std
DBusHandlerResult DBusWrapper::cbRootIntrospection(DBusConnection *conn, DBusMessage *msg, void *reference)
{
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("DBusWrapper::~cbRootIntrospection called:"));
+ logInfo("DBusWrapper::~cbRootIntrospection called:");
mReference = (DBusWrapper*) reference;
std::list<std::string> nodesList = mReference->mNodesList;
@@ -210,13 +208,13 @@ DBusHandlerResult DBusWrapper::cbRootIntrospection(DBusConnection *conn, DBusMes
dbus_message_iter_init_append(reply, &args);
if (!dbus_message_iter_append_basic(&args, DBUS_TYPE_STRING, &string))
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DBusWrapper::~cbRootIntrospection DBUS Out Of Memory!"));
+ logError("DBusWrapper::~cbRootIntrospection DBUS Out Of Memory!");
}
// send the reply && flush the connection
if (!dbus_connection_send(conn, reply, &serial))
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DBusWrapper::~cbRootIntrospection DBUS Out Of Memory!"));
+ logError("DBusWrapper::~cbRootIntrospection DBUS Out Of Memory!");
}
dbus_connection_flush(conn);
// free the reply
@@ -232,7 +230,7 @@ DBusHandlerResult DBusWrapper::cbRootIntrospection(DBusConnection *conn, DBusMes
void DBusWrapper::dbusMainLoop()
{
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("DBusWrapper::dbusMainLoop Entering MainLoop"));
+ logInfo("DBusWrapper::dbusMainLoop Entering MainLoop");
while (dbus_connection_read_write_dispatch(mDbusConnection, -1))
{
@@ -268,7 +266,7 @@ dbus_bool_t DBusWrapper::addWatchDelegate(DBusWatch * watch, void* userData)
event |= POLLOUT;
}
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("DBusWrapper::addWatchDelegate entered new watch, fd="), DLT_INT(dbus_watch_get_unix_fd(watch)), DLT_STRING("event flag="), DLT_INT(event));
+ logInfo("DBusWrapper::addWatchDelegate entered new watch, fd=",dbus_watch_get_unix_fd(watch),"event flag=",event);
am_Error_e error = mSocketHandler->addFDPoll(dbus_watch_get_unix_fd(watch), event, NULL, &pDbusFireCallback, &pDbusCheckCallback, &pDbusDispatchCallback, watch, handle);
//if everything is alright, add the watch and the handle to our map so we know this relationship
@@ -276,7 +274,8 @@ dbus_bool_t DBusWrapper::addWatchDelegate(DBusWatch * watch, void* userData)
{
mMapHandleWatch.insert(std::make_pair(watch, handle));
return true;
- }DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DBusWrapper::addWatchDelegate entering watch failed"));
+ }
+ logError("DBusWrapper::addWatchDelegate entering watch failed");
return (true);
}
@@ -294,7 +293,7 @@ void DBusWrapper::removeWatchDelegate(DBusWatch *watch, void *userData)
iterator = mMapHandleWatch.find(watch);
if (iterator != mMapHandleWatch.end())
mSocketHandler->removeFDPoll(iterator->second);
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("DBusWrapper::removeWatch removed watch with handle"), DLT_INT(iterator->second));
+ logInfo("DBusWrapper::removeWatch removed watch with handle",iterator->second);
mMapHandleWatch.erase(iterator);
}
@@ -323,7 +322,7 @@ void DBusWrapper::toogleWatchDelegate(DBusWatch *watch, void *userData)
iterator = mMapHandleWatch.find(watch);
if (iterator != mMapHandleWatch.end())
mSocketHandler->updateEventFlags(iterator->second, event);
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("DBusWrapper::toogleWatchDelegate watch was toggeled"));
+ logInfo("DBusWrapper::toogleWatchDelegate watch was toggeled");
}
dbus_bool_t DBusWrapper::addTimeout(DBusTimeout *timeout, void* userData)
@@ -357,7 +356,7 @@ dbus_bool_t DBusWrapper::addTimeoutDelegate(DBusTimeout *timeout, void* userData
//save timeout in Socket context
userData = timeout;
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("DBusWrapper::addTimeoutDelegate a timeout was added"));
+ logInfo("DBusWrapper::addTimeoutDelegate a timeout was added");
return true;
}
@@ -386,7 +385,7 @@ void DBusWrapper::removeTimeoutDelegate(DBusTimeout *timeout, void* userData)
}
}
delete handle;
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("DBusWrapper::removeTimeoutDelegate a timeout was removed"));
+ logInfo("DBusWrapper::removeTimeoutDelegate a timeout was removed");
}
void DBusWrapper::toggleTimeout(DBusTimeout *timeout, void* userData)
@@ -405,7 +404,7 @@ bool am::DBusWrapper::dbusDispatchCallback(const sh_pollHandle_t handle, void *u
if (dbus_connection_dispatch(mDbusConnection) == DBUS_DISPATCH_COMPLETE)
returnVal = false;
dbus_connection_unref(mDbusConnection);
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("DBusWrapper::dbusDispatchCallback was called"));
+ logInfo("DBusWrapper::dbusDispatchCallback was called");
return returnVal;
}
@@ -418,7 +417,7 @@ bool am::DBusWrapper::dbusCheckCallback(const sh_pollHandle_t handle, void *user
if (dbus_connection_get_dispatch_status(mDbusConnection) == DBUS_DISPATCH_DATA_REMAINS)
returnVal = true;
dbus_connection_unref(mDbusConnection);
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("DBusWrapper::dbusCheckCallback was called"));
+ logInfo("DBusWrapper::dbusCheckCallback was called");
return returnVal;
}
@@ -443,7 +442,7 @@ void am::DBusWrapper::dbusFireCallback(const pollfd pollfd, const sh_pollHandle_
dbus_connection_ref(mDbusConnection);
dbus_watch_handle(watch, flags);
dbus_connection_unref(mDbusConnection);
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("DBusWrapper::dbusFireCallback was called"));
+ logInfo("DBusWrapper::dbusFireCallback was called");
}
void DBusWrapper::toggleTimeoutDelegate(DBusTimeout *timeout, void* userData)
@@ -465,7 +464,7 @@ void DBusWrapper::toggleTimeoutDelegate(DBusTimeout *timeout, void* userData)
else
{
mSocketHandler->stopTimer(*handle);
- }DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("DBusWrapper::toggleTimeoutDelegate was called"));
+ }logInfo("DBusWrapper::toggleTimeoutDelegate was called");
}
void DBusWrapper::dbusTimerCallback(sh_timerHandle_t handle, void *userData)
@@ -479,6 +478,6 @@ void DBusWrapper::dbusTimerCallback(sh_timerHandle_t handle, void *userData)
mSocketHandler->restartTimer(handle, ts);
}
dbus_timeout_handle((DBusTimeout*) userData);
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("DBusWrapper::dbusTimerCallback was called"));
+ logInfo("DBusWrapper::dbusTimerCallback was called");
}
diff --git a/AudioManagerDaemon/src/DLTWrapper.cpp b/AudioManagerDaemon/src/DLTWrapper.cpp
new file mode 100644
index 0000000..33a48e8
--- /dev/null
+++ b/AudioManagerDaemon/src/DLTWrapper.cpp
@@ -0,0 +1,122 @@
+/**
+ * Copyright (C) 2011, BMW AG
+ *
+ * GeniviAudioMananger AudioManagerDaemon
+ *
+ * \file DLTWrapper.cpp
+ *
+ * \date 20-Oct-2011 3:42:04 PM
+ * \author Christian Mueller (christian.ei.mueller@bmw.de)
+ *
+ * \section License
+ * GNU Lesser General Public License, version 2.1, with special exception (GENIVI clause)
+ * Copyright (C) 2011, BMW AG Christian Mueller Christian.ei.mueller@bmw.de
+ *
+ * This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License, version 2.1, as published by the Free Software Foundation.
+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License, version 2.1, for more details.
+ * You should have received a copy of the GNU Lesser General Public License, version 2.1, along with this program; if not, see <http://www.gnu.org/licenses/lgpl-2.1.html>.
+ * Note that the copyright holders assume that the GNU Lesser General Public License, version 2.1, may also be applicable to programs even in cases in which the program is not a library in the technical sense.
+ * Linking AudioManager statically or dynamically with other modules is making a combined work based on AudioManager. You may license such other modules under the GNU Lesser General Public License, version 2.1. If you do not want to license your linked modules under the GNU Lesser General Public License, version 2.1, you may use the program under the following exception.
+ * As a special exception, the copyright holders of AudioManager give you permission to combine AudioManager with software programs or libraries that are released under any license unless such a combination is not permitted by the license of such a software program or library. You may copy and distribute such a system following the terms of the GNU Lesser General Public License, version 2.1, including this special exception, for AudioManager and the licenses of the other code concerned.
+ * Note that people who make modified versions of AudioManager are not obligated to grant this special exception for their modified versions; it is their choice whether to do so. The GNU Lesser General Public License, version 2.1, gives permission to release a modified version without this exception; this exception also makes it possible to release a modified version which carries forward this exception.
+ *
+ */
+
+#include "DLTWrapper.h"
+#include <cassert>
+
+DLTWrapper* DLTWrapper::mDLTWrapper = NULL;
+
+DLTWrapper *DLTWrapper::instance()
+{
+ if (!mDLTWrapper)
+ mDLTWrapper = new DLTWrapper;
+ return mDLTWrapper;
+}
+
+void DLTWrapper::unregisterContext(DltContext & handle)
+{
+ dlt_unregister_context(&handle);
+}
+
+DLTWrapper::DLTWrapper() :
+ mDltContext(), //
+ mDltContextData()
+{
+}
+
+void DLTWrapper::registerApp(const char *appid, const char *description)
+{
+ dlt_register_app(appid, description);
+ //register a default context
+ dlt_register_context(&mDltContext, "def", "default Context registered by DLTWrapper CLass");
+}
+
+void DLTWrapper::registerContext(DltContext& handle, const char *contextid, const char *description)
+{
+ dlt_register_context(&handle, contextid, description);
+}
+
+void DLTWrapper::init(DltLogLevelType loglevel, DltContext* context)
+{
+ if (!context)
+ context = &mDltContext;
+ dlt_user_log_write_start(context, &mDltContextData, loglevel);
+}
+
+void DLTWrapper::send()
+{
+ dlt_user_log_write_finish(&mDltContextData);
+}
+
+void DLTWrapper::append(const int8_t value)
+{
+ dlt_user_log_write_int8(&mDltContextData, value);
+}
+
+void DLTWrapper::append(const uint8_t value)
+{
+ dlt_user_log_write_uint8(&mDltContextData, value);
+}
+
+void DLTWrapper::append(const int16_t value)
+{
+ dlt_user_log_write_int16(&mDltContextData, value);
+}
+
+void DLTWrapper::append(const uint16_t value)
+{
+ dlt_user_log_write_uint16(&mDltContextData, value);
+}
+
+void DLTWrapper::append(const int32_t value)
+{
+ dlt_user_log_write_int32(&mDltContextData, value);
+}
+
+void DLTWrapper::append(const uint32_t value)
+{
+ dlt_user_log_write_uint32(&mDltContextData, value);
+}
+
+void DLTWrapper::append(const char*& value)
+{
+ dlt_user_log_write_string(&mDltContextData, value);
+}
+
+void DLTWrapper::append(const std::string& value)
+{
+ dlt_user_log_write_string(&mDltContextData, value.c_str());
+}
+
+void DLTWrapper::append(const bool value)
+{
+ dlt_user_log_write_bool(&mDltContextData, static_cast<uint8_t>(value));
+}
+
+DLTWrapper::~DLTWrapper()
+{
+ if (mDLTWrapper)
+ delete mDLTWrapper;
+}
+
diff --git a/AudioManagerDaemon/src/DatabaseHandler.cpp b/AudioManagerDaemon/src/DatabaseHandler.cpp
index fb1e5c6..b1660e9 100644
--- a/AudioManagerDaemon/src/DatabaseHandler.cpp
+++ b/AudioManagerDaemon/src/DatabaseHandler.cpp
@@ -29,7 +29,7 @@
#include <fstream>
#include <sstream>
#include <string>
-#include <dlt/dlt.h>
+#include "DLTWrapper.h"
#include "Router.h"
#define DOMAIN_TABLE "Domains"
@@ -45,8 +45,6 @@
#define MAIN_TABLE "MainTable"
#define SYSTEM_TABLE "SystemProperties"
-DLT_IMPORT_CONTEXT(AudioManager)
-
using namespace am;
const std::string databaseTables[] =
@@ -90,14 +88,13 @@ DatabaseHandler::DatabaseHandler(std::string databasePath) :
if (infile)
{
remove(mPath.c_str());
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("DatabaseHandler::DatabaseHandler Knocked down database"));
+ logInfo("DatabaseHandler::DatabaseHandler Knocked down database");
}
bool dbOpen = openDatabase();
if (!dbOpen)
{
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("DatabaseHandler::DatabaseHandler problems opening the database!"));
- assert(!dbOpen);
+ logInfo("DatabaseHandler::DatabaseHandler problems opening the database!");
}
createTables();
@@ -105,7 +102,7 @@ DatabaseHandler::DatabaseHandler(std::string databasePath) :
DatabaseHandler::~DatabaseHandler()
{
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("Closed Database"));
+ logInfo("Closed Database");
sqlite3_close(mDatabase);
}
@@ -133,13 +130,13 @@ am_Error_e DatabaseHandler::enterDomainDB(const am_Domain_s & domainData, am_dom
}
else
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::enterDomainDB SQLITE Step error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::enterDomainDB SQLITE Step error code:", eCode);
return E_DATABASE_ERROR;
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::enterDomainDB SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::enterDomainDB SQLITE Finalize error code:", eCode);
return E_DATABASE_ERROR;
}
@@ -154,18 +151,18 @@ am_Error_e DatabaseHandler::enterDomainDB(const am_Domain_s & domainData, am_dom
if ((eCode = sqlite3_step(queryFinal)) != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::enterDomainDB SQLITE Step error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::enterDomainDB SQLITE Step error code:", eCode);
return E_DATABASE_ERROR;
}
if ((eCode = sqlite3_finalize(queryFinal)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::enterDomainDB SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::enterDomainDB SQLITE Finalize error code:", eCode);
return E_DATABASE_ERROR;
}
domainID = sqlite3_last_insert_rowid(mDatabase);
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("DatabaseHandler::enterDomainDB entered new domain with name"), DLT_STRING(domainData.name.c_str()), DLT_STRING("busname:"), DLT_STRING(domainData.busname.c_str()), DLT_STRING("nodename:"), DLT_STRING(domainData.nodename.c_str()), DLT_STRING("early:"), DLT_BOOL(domainData.early), DLT_STRING("complete:"), DLT_BOOL(domainData.complete), DLT_STRING("state:"), DLT_INT(domainData.state), DLT_STRING("assigned ID:"), DLT_INT16(domainID));
+ logInfo("DatabaseHandler::enterDomainDB entered new domain with name=", domainData.name, "busname=", domainData.busname, "nodename=", domainData.nodename, "assigned ID:", domainID);
am_Domain_s domain = domainData;
domain.domainID = domainID;
@@ -192,13 +189,13 @@ am_Error_e DatabaseHandler::enterMainConnectionDB(const am_MainConnection_s & ma
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::enterMainConnectionDB SQLITE Step error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::enterMainConnectionDB SQLITE Step error code:", eCode);
return E_DATABASE_ERROR;
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::enterMainConnectionDB SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::enterMainConnectionDB SQLITE Finalize error code:", eCode);
return E_DATABASE_ERROR;
}
@@ -227,7 +224,8 @@ am_Error_e DatabaseHandler::enterMainConnectionDB(const am_MainConnection_s & ma
}
else
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::enterMainConnectionDB did not find route for MainConnection:"), DLT_INT(eCode));
+ logError("DatabaseHandler::enterMainConnectionDB did not find route for MainConnection:", eCode);
+
return E_DATABASE_ERROR;
}
sqlite3_reset(query);
@@ -235,7 +233,7 @@ am_Error_e DatabaseHandler::enterMainConnectionDB(const am_MainConnection_s & ma
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::enterMainConnectionDB SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::enterMainConnectionDB SQLITE Finalize error code:", eCode);
return E_DATABASE_ERROR;
}
@@ -251,7 +249,7 @@ am_Error_e DatabaseHandler::enterMainConnectionDB(const am_MainConnection_s & ma
sqlite3_bind_int(query, 1, *listConnectionIterator);
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::enterMainConnectionDB SQLITE Step error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::enterMainConnectionDB SQLITE Step error code:", eCode);
return E_DATABASE_ERROR;
}
sqlite3_reset(query);
@@ -259,11 +257,11 @@ am_Error_e DatabaseHandler::enterMainConnectionDB(const am_MainConnection_s & ma
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::enterMainConnectionDB SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::enterMainConnectionDB SQLITE Finalize error code:", eCode);
return E_DATABASE_ERROR;
}
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("DatabaseHandler::enterMainConnectionDB entered new mainConnection with sourceID"), DLT_INT(mainConnectionData.route.sourceID), DLT_STRING("sinkID:"), DLT_INT16(mainConnectionData.route.sinkID), DLT_STRING("delay:"), DLT_INT16(delay), DLT_STRING("assigned ID:"), DLT_INT16(connectionID));
+ logInfo("DatabaseHandler::enterMainConnectionDB entered new mainConnection with sourceID", mainConnectionData.route.sourceID, "sinkID:", mainConnectionData.route.sinkID, "delay:", delay, "assigned ID:", connectionID);
if (mDatabaseObserver)
{
@@ -318,14 +316,14 @@ am_Error_e DatabaseHandler::enterSinkDB(const am_Sink_s & sinkData, am_sinkID_t
}
else
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::enterSinkDB SQLITE Step error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::enterSinkDB SQLITE Step error code:", eCode);
sqlite3_finalize(query);
return E_DATABASE_ERROR;
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::enterSinkDB SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::enterSinkDB SQLITE Finalize error code:", eCode);
return E_DATABASE_ERROR;
}
@@ -356,14 +354,14 @@ am_Error_e DatabaseHandler::enterSinkDB(const am_Sink_s & sinkData, am_sinkID_t
if ((eCode = sqlite3_step(queryFinal)) != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::enterSinkDB SQLITE Step error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::enterSinkDB SQLITE Step error code:", eCode);
sqlite3_finalize(queryFinal);
return E_DATABASE_ERROR;
}
if ((eCode = sqlite3_finalize(queryFinal)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::enterSinkDB SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::enterSinkDB SQLITE Finalize error code:", eCode);
return E_DATABASE_ERROR;
}
@@ -378,7 +376,7 @@ am_Error_e DatabaseHandler::enterSinkDB(const am_Sink_s & sinkData, am_sinkID_t
else
{
sinkID = 0;
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::existSink database error!:"), DLT_INT(eCode))
+ logError("DatabaseHandler::existSink database error!:", eCode);
sqlite3_finalize(query);
return E_DATABASE_ERROR;
}
@@ -401,7 +399,7 @@ am_Error_e DatabaseHandler::enterSinkDB(const am_Sink_s & sinkData, am_sinkID_t
sqlite3_bind_int(query, 1, *connectionFormatIterator);
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::enterSinkDB SQLITE Step error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::enterSinkDB SQLITE Step error code:", eCode);
sqlite3_finalize(query);
return E_DATABASE_ERROR;
}
@@ -418,7 +416,7 @@ am_Error_e DatabaseHandler::enterSinkDB(const am_Sink_s & sinkData, am_sinkID_t
sqlite3_bind_int(query, 2, mainSoundPropertyIterator->value);
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::enterSinkDB SQLITE Step error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::enterSinkDB SQLITE Step error code:", eCode);
sqlite3_finalize(query);
return E_DATABASE_ERROR;
}
@@ -435,20 +433,18 @@ am_Error_e DatabaseHandler::enterSinkDB(const am_Sink_s & sinkData, am_sinkID_t
sqlite3_bind_int(query, 2, SoundPropertyIterator->value);
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::enterSinkDB SQLITE Step error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::enterSinkDB SQLITE Step error code:", eCode);
sqlite3_finalize(query);
return E_DATABASE_ERROR;
}
sqlite3_reset(query);
}
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("DatabaseHandler::enterSinkDB entered new sink with name"), DLT_STRING(sinkData.name.c_str()), DLT_STRING("domainID:"), DLT_INT(sinkData.domainID), DLT_STRING("classID:"), DLT_INT(sinkData.sinkClassID), DLT_STRING("volume:"), DLT_INT(sinkData.volume), DLT_STRING("visible:"), DLT_BOOL(sinkData.visible), DLT_STRING("available.availability:"), DLT_INT(sinkData.available.availability), DLT_STRING("available.availabilityReason:"), DLT_INT(sinkData.available.availabilityReason), DLT_STRING("muteState:"), DLT_INT(sinkData.muteState), DLT_STRING("mainVolume:"), DLT_INT(sinkData.mainVolume), DLT_STRING("assigned ID:"), DLT_INT16(sinkID));
-
+ logInfo("DatabaseHandler::enterSinkDB entered new sink with name", sinkData.name, "domainID:", sinkData.domainID, "classID:", sinkData.sinkClassID, "volume:", sinkData.volume, "assigned ID:", sinkID);
am_Sink_s sink = sinkData;
sink.sinkID = sinkID;
if (mDatabaseObserver != NULL)
mDatabaseObserver->newSink(sink);
-
return E_OK;
}
@@ -513,13 +509,13 @@ am_Error_e DatabaseHandler::enterGatewayDB(const am_Gateway_s & gatewayData, am_
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::enterGatewayDB SQLITE Step error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::enterGatewayDB SQLITE Step error code:", eCode);
return E_DATABASE_ERROR;
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::enterGatewayDB SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::enterGatewayDB SQLITE Finalize error code:", eCode);
return E_DATABASE_ERROR;
}
@@ -542,7 +538,7 @@ am_Error_e DatabaseHandler::enterGatewayDB(const am_Gateway_s & gatewayData, am_
sqlite3_bind_int(query, 1, *connectionFormatIterator);
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::enterGatewayDB SQLITE Step error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::enterGatewayDB SQLITE Step error code:", eCode);
return E_DATABASE_ERROR;
}
sqlite3_reset(query);
@@ -556,14 +552,13 @@ am_Error_e DatabaseHandler::enterGatewayDB(const am_Gateway_s & gatewayData, am_
sqlite3_bind_int(query, 1, *connectionFormatIterator);
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::enterGatewayDB SQLITE Step error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::enterGatewayDB SQLITE Step error code:", eCode);
return E_DATABASE_ERROR;
}
sqlite3_reset(query);
}
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("DatabaseHandler::enterGatewayDB entered new gateway with name"), DLT_STRING(gatewayData.name.c_str()), DLT_STRING("sourceID:"), DLT_INT(gatewayData.sourceID), DLT_STRING("sinkID:"), DLT_INT(gatewayData.sinkID), DLT_STRING("domainSinkID:"), DLT_INT(gatewayData.domainSinkID), DLT_STRING("domainSourceID:"), DLT_BOOL(gatewayData.domainSourceID), DLT_STRING("controlDomainID:"), DLT_INT(gatewayData.controlDomainID), DLT_STRING("assigned ID:"), DLT_INT16(gatewayID));
-
+ logInfo("DatabaseHandler::enterGatewayDB entered new gateway with name", gatewayData.name, "sourceID:", gatewayData.sourceID, "sinkID:", gatewayData.sinkID, "assigned ID:", gatewayID);
am_Gateway_s gateway = gatewayData;
gateway.gatewayID = gatewayID;
if (mDatabaseObserver)
@@ -613,14 +608,14 @@ am_Error_e DatabaseHandler::enterSourceDB(const am_Source_s & sourceData, am_sou
}
else
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::enterSourceDB SQLITE Step error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::enterSourceDB SQLITE Step error code:", eCode);
sqlite3_finalize(query);
return E_DATABASE_ERROR;
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::enterSourceDB SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::enterSourceDB SQLITE Finalize error code:", eCode);
return E_DATABASE_ERROR;
}
sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &queryFinal, NULL);
@@ -650,14 +645,14 @@ am_Error_e DatabaseHandler::enterSourceDB(const am_Source_s & sourceData, am_sou
if ((eCode = sqlite3_step(queryFinal)) != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::enterSourceDB SQLITE Step error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::enterSourceDB SQLITE Step error code:", eCode);
sqlite3_finalize(queryFinal);
return E_DATABASE_ERROR;
}
if ((eCode = sqlite3_finalize(queryFinal)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::enterSourceDB SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::enterSourceDB SQLITE Finalize error code:", eCode);
sqlite3_finalize(queryFinal);
return E_DATABASE_ERROR;
}
@@ -673,7 +668,7 @@ am_Error_e DatabaseHandler::enterSourceDB(const am_Source_s & sourceData, am_sou
else
{
sourceID = 0;
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::existSink database error!:"), DLT_INT(eCode))
+ logError("DatabaseHandler::existSink database error!:", eCode);
sqlite3_finalize(query);
return E_DATABASE_ERROR;
}
@@ -696,7 +691,7 @@ am_Error_e DatabaseHandler::enterSourceDB(const am_Source_s & sourceData, am_sou
sqlite3_bind_int(query, 1, *connectionFormatIterator);
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::enterSourceDB SQLITE Step error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::enterSourceDB SQLITE Step error code:", eCode);
sqlite3_finalize(query);
return E_DATABASE_ERROR;
}
@@ -713,7 +708,7 @@ am_Error_e DatabaseHandler::enterSourceDB(const am_Source_s & sourceData, am_sou
sqlite3_bind_int(query, 2, mainSoundPropertyIterator->value);
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::enterSourceDB SQLITE Step error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::enterSourceDB SQLITE Step error code:", eCode);
sqlite3_finalize(query);
return E_DATABASE_ERROR;
}
@@ -730,14 +725,14 @@ am_Error_e DatabaseHandler::enterSourceDB(const am_Source_s & sourceData, am_sou
sqlite3_bind_int(query, 2, SoundPropertyIterator->value);
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::enterSinkDB SQLITE Step error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::enterSinkDB SQLITE Step error code:", eCode);
sqlite3_finalize(query);
return E_DATABASE_ERROR;
}
sqlite3_reset(query);
}
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("DatabaseHandler::enterSinkDB entered new source with name"), DLT_STRING(sourceData.name.c_str()), DLT_STRING("domainID:"), DLT_INT(sourceData.domainID), DLT_STRING("classID:"), DLT_INT(sourceData.sourceClassID), DLT_STRING("volume:"), DLT_INT(sourceData.volume), DLT_STRING("visible:"), DLT_BOOL(sourceData.visible), DLT_STRING("available.availability:"), DLT_INT(sourceData.available.availability), DLT_STRING("available.availabilityReason:"), DLT_INT(sourceData.available.availabilityReason), DLT_STRING("interruptState:"), DLT_INT(sourceData.interruptState), DLT_STRING("assigned ID:"), DLT_INT16(sourceID));
+ logInfo("DatabaseHandler::enterSinkDB entered new source with name", sourceData.name, "domainID:", sourceData.domainID, "classID:", sourceData.sourceClassID, "visible:", sourceData.visible, "assigned ID:", sourceID);
am_Source_s source = sourceData;
source.sourceID = sourceID;
@@ -779,7 +774,8 @@ am_Error_e DatabaseHandler::changeMainConnectionRouteDB(const am_mainConnectionI
}
else
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::changeMainConnectionRouteDB did not find route for MainConnection:"), DLT_INT(eCode));
+ logError("DatabaseHandler::changeMainConnectionRouteDB did not find route for MainConnection:", eCode);
+
return E_DATABASE_ERROR;
}
sqlite3_reset(query);
@@ -787,7 +783,8 @@ am_Error_e DatabaseHandler::changeMainConnectionRouteDB(const am_mainConnectionI
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::changeMainConnectionRouteDB SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::changeMainConnectionRouteDB SQLITE Finalize error code:", eCode);
+
return E_DATABASE_ERROR;
}
@@ -803,7 +800,8 @@ am_Error_e DatabaseHandler::changeMainConnectionRouteDB(const am_mainConnectionI
sqlite3_bind_int(query, 1, *listConnectionIterator);
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::changeMainConnectionRouteDB SQLITE Step error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::changeMainConnectionRouteDB SQLITE Step error code:", eCode);
+
return E_DATABASE_ERROR;
}
sqlite3_reset(query);
@@ -811,9 +809,11 @@ am_Error_e DatabaseHandler::changeMainConnectionRouteDB(const am_mainConnectionI
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::changeMainConnectionRouteDB SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::changeMainConnectionRouteDB SQLITE Finalize error code:", eCode);
+
return E_DATABASE_ERROR;
- }DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("DatabaseHandler::changeMainConnectionRouteDB entered new route:"), DLT_INT(mainconnectionID));
+ }
+ logInfo("DatabaseHandler::changeMainConnectionRouteDB entered new route:", mainconnectionID);
return E_OK;
}
@@ -834,14 +834,15 @@ am_Error_e DatabaseHandler::changeMainConnectionStateDB(const am_mainConnectionI
sqlite3_bind_int(query, 1, connectionState);
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::changeMainConnectionStateDB SQLITE Step error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::changeMainConnectionStateDB SQLITE Step error code:", eCode);
return E_DATABASE_ERROR;
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::changeMainConnectionStateDB SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::changeMainConnectionStateDB SQLITE Finalize error code:", eCode);
return E_DATABASE_ERROR;
- }DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("DatabaseHandler::changeMainConnectionStateDB changed mainConnectionState of MainConnection:"), DLT_INT(mainconnectionID), DLT_STRING("to:"), DLT_INT(connectionState));
+ }
+ logInfo("DatabaseHandler::changeMainConnectionStateDB changed mainConnectionState of MainConnection:", mainconnectionID, "to:", connectionState);
if (mDatabaseObserver)
mDatabaseObserver->mainConnectionStateChanged(mainconnectionID, connectionState);
@@ -865,16 +866,16 @@ am_Error_e DatabaseHandler::changeSinkMainVolumeDB(const am_mainVolume_t mainVol
sqlite3_bind_int(query, 1, mainVolume);
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::changeSinkMainVolumeDB SQLITE Step error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::changeSinkMainVolumeDB SQLITE Step error code:", eCode);
return E_DATABASE_ERROR;
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::changeSinkMainVolumeDB SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::changeSinkMainVolumeDB SQLITE Finalize error code:", eCode);
return E_DATABASE_ERROR;
}
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("DatabaseHandler::changeSinkMainVolumeDB changed mainVolume of sink:"), DLT_INT(sinkID), DLT_STRING("to:"), DLT_INT(mainVolume));
+ logInfo("DatabaseHandler::changeSinkMainVolumeDB changed mainVolume of sink:", sinkID, "to:", mainVolume);
if (mDatabaseObserver)
mDatabaseObserver->volumeChanged(sinkID, mainVolume);
@@ -900,17 +901,17 @@ am_Error_e DatabaseHandler::changeSinkAvailabilityDB(const am_Availability_s & a
sqlite3_bind_int(query, 2, availability.availabilityReason);
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::changeSinkAvailabilityDB SQLITE Step error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::changeSinkAvailabilityDB SQLITE Step error code:", eCode);
return E_DATABASE_ERROR;
}assert(sinkID!=0);
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::changeSinkAvailabilityDB SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::changeSinkAvailabilityDB SQLITE Finalize error code:", eCode);
return E_DATABASE_ERROR;
}
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("DatabaseHandler::changeSinkAvailabilityDB changed sinkAvailability of sink:"), DLT_INT(sinkID), DLT_STRING("to:"), DLT_INT(availability.availability), DLT_STRING("Reason:"), DLT_INT(availability.availabilityReason));
+ logInfo("DatabaseHandler::changeSinkAvailabilityDB changed sinkAvailability of sink:", sinkID, "to:", availability.availability, "Reason:", availability.availabilityReason);
if (mDatabaseObserver && sourceVisible(sinkID))
mDatabaseObserver->sinkAvailabilityChanged(sinkID, availability);
@@ -934,17 +935,18 @@ am_Error_e DatabaseHandler::changDomainStateDB(const am_DomainState_e domainStat
sqlite3_bind_int(query, 1, domainState);
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::changDomainStateDB SQLITE Step error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::changDomainStateDB SQLITE Step error code:", eCode);
+
return E_DATABASE_ERROR;
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::changDomainStateDB SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::changDomainStateDB SQLITE Finalize error code:", eCode);
return E_DATABASE_ERROR;
}
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("DatabaseHandler::changDomainStateDB changed domainState of domain:"), DLT_INT(domainID), DLT_STRING("to:"), DLT_INT(domainState));
+ logInfo("DatabaseHandler::changDomainStateDB changed domainState of domain:", domainID, "to:", domainState);
return E_OK;
}
@@ -965,17 +967,17 @@ am_Error_e DatabaseHandler::changeSinkMuteStateDB(const am_MuteState_e muteState
sqlite3_bind_int(query, 1, muteState);
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::changeSinkMuteStateDB SQLITE Step error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::changeSinkMuteStateDB SQLITE Step error code:", eCode);
return E_DATABASE_ERROR;
}assert(sinkID!=0);
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::changeSinkMuteStateDB SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::changeSinkMuteStateDB SQLITE Finalize error code:", eCode);
return E_DATABASE_ERROR;
}
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("DatabaseHandler::changeSinkMuteStateDB changed sinkMuteState of sink:"), DLT_INT(sinkID), DLT_STRING("to:"), DLT_INT(muteState));
+ logInfo("DatabaseHandler::changeSinkMuteStateDB changed sinkMuteState of sink:", sinkID, "to:", muteState);
if (mDatabaseObserver)
mDatabaseObserver->sinkMuteStateChanged(sinkID, muteState);
@@ -1001,17 +1003,17 @@ am_Error_e DatabaseHandler::changeMainSinkSoundPropertyDB(const am_MainSoundProp
sqlite3_bind_int(query, 1, soundProperty.value);
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::changeMainSinkSoundPropertyDB SQLITE Step error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::changeMainSinkSoundPropertyDB SQLITE Step error code:", eCode);
return E_DATABASE_ERROR;
}assert(sinkID!=0);
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::changeMainSinkSoundPropertyDB SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::changeMainSinkSoundPropertyDB SQLITE Finalize error code:", eCode);
return E_DATABASE_ERROR;
}
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("DatabaseHandler::changeMainSinkSoundPropertyDB changed MainSinkSoundProperty of sink:"), DLT_INT(sinkID), DLT_STRING("type:"), DLT_INT(soundProperty.type), DLT_STRING("to:"), DLT_INT(soundProperty.value));
+ logInfo("DatabaseHandler::changeMainSinkSoundPropertyDB changed MainSinkSoundProperty of sink:", sinkID, "type:", soundProperty.type, "to:", soundProperty.value);
if (mDatabaseObserver)
mDatabaseObserver->mainSinkSoundPropertyChanged(sinkID, soundProperty);
return E_OK;
@@ -1035,17 +1037,17 @@ am_Error_e DatabaseHandler::changeMainSourceSoundPropertyDB(const am_MainSoundPr
sqlite3_bind_int(query, 1, soundProperty.value);
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::changeMainSourceSoundPropertyDB SQLITE Step error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::changeMainSourceSoundPropertyDB SQLITE Step error code:", eCode);
return E_DATABASE_ERROR;
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::changeMainSourceSoundPropertyDB SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::changeMainSourceSoundPropertyDB SQLITE Finalize error code:", eCode);
return E_DATABASE_ERROR;
}
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("DatabaseHandler::changeMainSourceSoundPropertyDB changed MainSinkSoundProperty of source:"), DLT_INT(sourceID), DLT_STRING("type:"), DLT_INT(soundProperty.type), DLT_STRING("to:"), DLT_INT(soundProperty.value));
+ logInfo("DatabaseHandler::changeMainSourceSoundPropertyDB changed MainSinkSoundProperty of source:", sourceID, "type:", soundProperty.type, "to:", soundProperty.value);
if (mDatabaseObserver)
mDatabaseObserver->mainSourceSoundPropertyChanged(sourceID, soundProperty);
@@ -1070,17 +1072,17 @@ am_Error_e DatabaseHandler::changeSourceAvailabilityDB(const am_Availability_s &
sqlite3_bind_int(query, 2, availability.availabilityReason);
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::changeSourceAvailabilityDB SQLITE Step error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::changeSourceAvailabilityDB SQLITE Step error code:", eCode);
return E_DATABASE_ERROR;
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::changeSourceAvailabilityDB SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::changeSourceAvailabilityDB SQLITE Finalize error code:", eCode);
return E_DATABASE_ERROR;
}
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("DatabaseHandler::changeSourceAvailabilityDB changed changeSourceAvailabilityDB of source:"), DLT_INT(sourceID), DLT_STRING("to:"), DLT_INT(availability.availability), DLT_STRING("Reason:"), DLT_INT(availability.availabilityReason));
+ logInfo("DatabaseHandler::changeSourceAvailabilityDB changed changeSourceAvailabilityDB of source:", sourceID, "to:", availability.availability, "Reason:", availability.availabilityReason);
if (mDatabaseObserver && sourceVisible(sourceID))
mDatabaseObserver->sourceAvailabilityChanged(sourceID, availability);
@@ -1099,17 +1101,17 @@ am_Error_e DatabaseHandler::changeSystemPropertyDB(const am_SystemProperty_s & p
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::changeSystemPropertyDB SQLITE Step error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::changeSystemPropertyDB SQLITE Step error code:", eCode);
return E_DATABASE_ERROR;
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::changeSystemPropertyDB SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::changeSystemPropertyDB SQLITE Finalize error code:", eCode);
return E_DATABASE_ERROR;
}
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("DatabaseHandler::changeSystemPropertyDB changed system property"));
+ logInfo("DatabaseHandler::changeSystemPropertyDB changed system property");
if (mDatabaseObserver)
mDatabaseObserver->systemPropertyChanged(property);
@@ -1130,7 +1132,8 @@ am_Error_e DatabaseHandler::removeMainConnectionDB(const am_mainConnectionID_t m
if (!sqQuery(command))
return E_DATABASE_ERROR;
if (!sqQuery(command1))
- return E_DATABASE_ERROR;DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("DatabaseHandler::removeMainConnectionDB removed:"), DLT_INT(mainConnectionID));
+ return E_DATABASE_ERROR;
+ logInfo("DatabaseHandler::removeMainConnectionDB removed:", mainConnectionID);
if (mDatabaseObserver)
{
mDatabaseObserver->mainConnectionStateChanged(mainConnectionID, CS_DISCONNECTED);
@@ -1158,7 +1161,8 @@ am_Error_e DatabaseHandler::removeSinkDB(const am_sinkID_t sinkID)
if (!sqQuery(command2))
return E_DATABASE_ERROR;
if (!sqQuery(command3))
- return E_DATABASE_ERROR;DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("DatabaseHandler::removeSinkDB removed:"), DLT_INT(sinkID));
+ return E_DATABASE_ERROR;
+ logInfo("DatabaseHandler::removeSinkDB removed:", sinkID);
if (mDatabaseObserver != NULL)
mDatabaseObserver->removedSink(sinkID);
@@ -1185,7 +1189,8 @@ am_Error_e DatabaseHandler::removeSourceDB(const am_sourceID_t sourceID)
if (!sqQuery(command2))
return E_DATABASE_ERROR;
if (!sqQuery(command3))
- return E_DATABASE_ERROR;DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("DatabaseHandler::removeSourceDB removed:"), DLT_INT(sourceID));
+ return E_DATABASE_ERROR;
+ logInfo("DatabaseHandler::removeSourceDB removed:", sourceID);
if (mDatabaseObserver)
mDatabaseObserver->removedSource(sourceID);
return E_OK;
@@ -1201,7 +1206,8 @@ am_Error_e DatabaseHandler::removeGatewayDB(const am_gatewayID_t gatewayID)
}
std::string command = "DELETE from " + std::string(GATEWAY_TABLE) + " WHERE gatewayID=" + i2s(gatewayID);
if (!sqQuery(command))
- return E_DATABASE_ERROR;DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("DatabaseHandler::removeGatewayDB removed:"), DLT_INT(gatewayID));
+ return E_DATABASE_ERROR;
+ logInfo("DatabaseHandler::removeGatewayDB removed:", gatewayID);
if (mDatabaseObserver)
mDatabaseObserver->removeGateway(gatewayID);
return E_OK;
@@ -1224,7 +1230,8 @@ am_Error_e DatabaseHandler::removeDomainDB(const am_domainID_t domainID)
}
std::string command = "DELETE from " + std::string(DOMAIN_TABLE) + " WHERE domainID=" + i2s(domainID);
if (!sqQuery(command))
- return E_DATABASE_ERROR;DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("DatabaseHandler::removeDomainDB removed:"), DLT_INT(domainID));
+ return E_DATABASE_ERROR;
+ logInfo("DatabaseHandler::removeDomainDB removed:", domainID);
if (mDatabaseObserver)
mDatabaseObserver->removeDomain(domainID);
return E_OK;
@@ -1245,7 +1252,7 @@ am_Error_e DatabaseHandler::removeSinkClassDB(const am_sinkClass_t sinkClassID)
if (!sqQuery(command1))
return E_DATABASE_ERROR;
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("DatabaseHandler::removeSinkClassDB removed:"), DLT_INT(sinkClassID));
+ logInfo("DatabaseHandler::removeSinkClassDB removed:", sinkClassID);
if (mDatabaseObserver)
mDatabaseObserver->numberOfSinkClassesChanged();
@@ -1265,8 +1272,8 @@ am_Error_e DatabaseHandler::removeSourceClassDB(const am_sourceClass_t sourceCla
if (!sqQuery(command))
return E_DATABASE_ERROR;
if (!sqQuery(command1))
- return E_DATABASE_ERROR;DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("DatabaseHandler::removeSourceClassDB removed:"), DLT_INT(sourceClassID));
-
+ return E_DATABASE_ERROR;
+ logInfo("DatabaseHandler::removeSourceClassDB removed:", sourceClassID);
if (mDatabaseObserver)
mDatabaseObserver->numberOfSourceClassesChanged();
return E_OK;
@@ -1281,8 +1288,8 @@ am_Error_e DatabaseHandler::removeConnection(const am_connectionID_t connectionI
if (!sqQuery(command))
return E_DATABASE_ERROR;
if (!sqQuery(command1))
- return E_DATABASE_ERROR;DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("DatabaseHandler::removeConnection removed:"), DLT_INT(connectionID));
-
+ return E_DATABASE_ERROR;
+ logInfo("DatabaseHandler::removeConnection removed:", connectionID);
return E_OK;
}
@@ -1307,13 +1314,13 @@ am_Error_e DatabaseHandler::getSourceClassInfoDB(const am_sourceID_t sourceID, a
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getSourceClassInfoDB SQLITE error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getSourceClassInfoDB SQLITE error code:", eCode);
return E_DATABASE_ERROR;
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getSourceClassInfoDB SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getSourceClassInfoDB SQLITE Finalize error code:", eCode);
return E_DATABASE_ERROR;
}
@@ -1327,13 +1334,13 @@ am_Error_e DatabaseHandler::getSourceClassInfoDB(const am_sourceID_t sourceID, a
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getSourceClassInfoDB SQLITE error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getSourceClassInfoDB SQLITE error code:", eCode);
return E_DATABASE_ERROR;
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getSourceClassInfoDB SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getSourceClassInfoDB SQLITE Finalize error code:", eCode);
return E_DATABASE_ERROR;
}
@@ -1349,13 +1356,13 @@ am_Error_e DatabaseHandler::getSourceClassInfoDB(const am_sourceID_t sourceID, a
if (eCode != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getSourceClassInfoDB SQLITE error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getSourceClassInfoDB SQLITE error code:", eCode);
return E_DATABASE_ERROR;
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getSourceClassInfoDB SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getSourceClassInfoDB SQLITE Finalize error code:", eCode);
return E_DATABASE_ERROR;
}
return E_OK;
@@ -1383,7 +1390,7 @@ am_Error_e DatabaseHandler::changeSinkClassInfoDB(const am_SinkClass_s& sinkClas
sqlite3_bind_int(query, 2, Iterator->classProperty);
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::setSinkClassInfoDB SQLITE Step error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::setSinkClassInfoDB SQLITE Step error code:", eCode);
return E_DATABASE_ERROR;
}
sqlite3_reset(query);
@@ -1391,11 +1398,11 @@ am_Error_e DatabaseHandler::changeSinkClassInfoDB(const am_SinkClass_s& sinkClas
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::setSinkClassInfoDB SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::setSinkClassInfoDB SQLITE Finalize error code:", eCode);
return E_DATABASE_ERROR;
}
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("DatabaseHandler::setSinkClassInfoDB set setSinkClassInfo"));
+ logInfo("DatabaseHandler::setSinkClassInfoDB set setSinkClassInfo");
return E_OK;
}
@@ -1421,7 +1428,7 @@ am_Error_e DatabaseHandler::changeSourceClassInfoDB(const am_SourceClass_s& sour
sqlite3_bind_int(query, 2, Iterator->classProperty);
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::setSinkClassInfoDB SQLITE Step error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::setSinkClassInfoDB SQLITE Step error code:", eCode);
return E_DATABASE_ERROR;
}
sqlite3_reset(query);
@@ -1429,11 +1436,11 @@ am_Error_e DatabaseHandler::changeSourceClassInfoDB(const am_SourceClass_s& sour
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::setSinkClassInfoDB SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::setSinkClassInfoDB SQLITE Finalize error code:", eCode);
return E_DATABASE_ERROR;
}
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("DatabaseHandler::setSinkClassInfoDB set setSinkClassInfo"));
+ logInfo("DatabaseHandler::setSinkClassInfoDB set setSinkClassInfo");
return E_OK;
}
@@ -1458,13 +1465,13 @@ am_Error_e DatabaseHandler::getSinkClassInfoDB(const am_sinkID_t sinkID, am_Sink
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getSinkClassInfoDB SQLITE error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getSinkClassInfoDB SQLITE error code:", eCode);
return E_DATABASE_ERROR;
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getSinkClassInfoDB SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getSinkClassInfoDB SQLITE Finalize error code:", eCode);
return E_DATABASE_ERROR;
}
@@ -1478,13 +1485,13 @@ am_Error_e DatabaseHandler::getSinkClassInfoDB(const am_sinkID_t sinkID, am_Sink
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getSinkClassInfoDB SQLITE error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getSinkClassInfoDB SQLITE error code:", eCode);
return E_DATABASE_ERROR;
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getSinkClassInfoDB SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getSinkClassInfoDB SQLITE Finalize error code:", eCode);
return E_DATABASE_ERROR;
}
@@ -1500,13 +1507,13 @@ am_Error_e DatabaseHandler::getSinkClassInfoDB(const am_sinkID_t sinkID, am_Sink
if (eCode != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getSinkClassInfoDB SQLITE error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getSinkClassInfoDB SQLITE error code:", eCode);
return E_DATABASE_ERROR;
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getSinkClassInfoDB SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getSinkClassInfoDB SQLITE Finalize error code:", eCode);
return E_DATABASE_ERROR;
}
return E_OK;
@@ -1540,7 +1547,7 @@ am_Error_e DatabaseHandler::getGatewayInfoDB(const am_gatewayID_t gatewayID, am_
iter = mListConnectionFormat.find(gatewayData.gatewayID);
if (iter == mListConnectionFormat.end())
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getGatewayInfoDB database error with convertionFormat"));
+ logError("DatabaseHandler::getGatewayInfoDB database error with convertionFormat");
return E_DATABASE_ERROR;
}
gatewayData.convertionMatrix = iter->second;
@@ -1556,7 +1563,7 @@ am_Error_e DatabaseHandler::getGatewayInfoDB(const am_gatewayID_t gatewayID, am_
if ((eCode = sqlite3_finalize(qSourceConnectionFormat)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getGatewayInfoDB SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getGatewayInfoDB SQLITE Finalize error code:", eCode);
return E_DATABASE_ERROR;
}
@@ -1571,7 +1578,7 @@ am_Error_e DatabaseHandler::getGatewayInfoDB(const am_gatewayID_t gatewayID, am_
if ((eCode = sqlite3_finalize(qSinkConnectionFormat)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getGatewayInfoDB SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getGatewayInfoDB SQLITE Finalize error code:", eCode);
return E_DATABASE_ERROR;
}
@@ -1579,13 +1586,13 @@ am_Error_e DatabaseHandler::getGatewayInfoDB(const am_gatewayID_t gatewayID, am_
if (eCode != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getGatewayInfoDB SQLITE error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getGatewayInfoDB SQLITE error code:", eCode);
return E_DATABASE_ERROR;
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getGatewayInfoDB SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getGatewayInfoDB SQLITE Finalize error code:", eCode);
return E_DATABASE_ERROR;
}
@@ -1623,13 +1630,13 @@ am_Error_e DatabaseHandler::getListSinksOfDomain(const am_domainID_t domainID, s
if (eCode != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getListSinksOfDomain SQLITE error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getListSinksOfDomain SQLITE error code:", eCode);
return E_DATABASE_ERROR;
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getListSinksOfDomain SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getListSinksOfDomain SQLITE Finalize error code:", eCode);
return E_DATABASE_ERROR;
}
@@ -1659,13 +1666,13 @@ am_Error_e DatabaseHandler::getListSourcesOfDomain(const am_domainID_t domainID,
if (eCode != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getListSourcesOfDomain SQLITE error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getListSourcesOfDomain SQLITE error code:", eCode);
return E_DATABASE_ERROR;
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getListSourcesOfDomain SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getListSourcesOfDomain SQLITE Finalize error code:", eCode);
return E_DATABASE_ERROR;
}
@@ -1704,13 +1711,13 @@ am_Error_e DatabaseHandler::getListGatewaysOfDomain(const am_domainID_t domainID
if (eCode != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getListGatewaysOfDomain SQLITE error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getListGatewaysOfDomain SQLITE error code:", eCode);
return E_DATABASE_ERROR;
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getListGatewaysOfDomain SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getListGatewaysOfDomain SQLITE Finalize error code:", eCode);
return E_DATABASE_ERROR;
}
@@ -1759,13 +1766,13 @@ am_Error_e DatabaseHandler::getListMainConnections(std::vector<am_MainConnection
if (eCode != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getListMainConnections SQLITE error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getListMainConnections SQLITE error code:", eCode);
return E_DATABASE_ERROR;
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getListMainConnections SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getListMainConnections SQLITE Finalize error code:", eCode);
return E_DATABASE_ERROR;
}
@@ -1795,13 +1802,15 @@ am_Error_e DatabaseHandler::getListDomains(std::vector<am_Domain_s> & listDomain
if (eCode != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getListDomains SQLITE error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getListDomains SQLITE error code:", eCode);
+
return E_DATABASE_ERROR;
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getListDomains SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getListDomains SQLITE Finalize error code:", eCode);
+
return E_DATABASE_ERROR;
}
@@ -1829,13 +1838,13 @@ am_Error_e DatabaseHandler::getListConnections(std::vector<am_Connection_s> & li
if (eCode != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getListConnections SQLITE error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getListConnections SQLITE error code:", eCode);
return E_DATABASE_ERROR;
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getListConnections SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getListConnections SQLITE Finalize error code:", eCode);
return E_DATABASE_ERROR;
}
@@ -1878,7 +1887,8 @@ am_Error_e DatabaseHandler::getListSinks(std::vector<am_Sink_s> & listSinks) con
if ((eCode = sqlite3_finalize(qConnectionFormat)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getListSinks SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getListSinks SQLITE Finalize error code:", eCode);
+
return E_DATABASE_ERROR;
}
@@ -1894,7 +1904,8 @@ am_Error_e DatabaseHandler::getListSinks(std::vector<am_Sink_s> & listSinks) con
if ((eCode = sqlite3_finalize(qSoundProperty)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getListSinks SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getListSinks SQLITE Finalize error code:", eCode);
+
return E_DATABASE_ERROR;
}
@@ -1910,7 +1921,8 @@ am_Error_e DatabaseHandler::getListSinks(std::vector<am_Sink_s> & listSinks) con
if ((eCode = sqlite3_finalize(qMAinSoundProperty)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getListSinks SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getListSinks SQLITE Finalize error code:", eCode);
+
return E_DATABASE_ERROR;
}
listSinks.push_back(temp);
@@ -1921,13 +1933,15 @@ am_Error_e DatabaseHandler::getListSinks(std::vector<am_Sink_s> & listSinks) con
if (eCode != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getListSinks SQLITE error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getListSinks SQLITE error code:", eCode);
+
return E_DATABASE_ERROR;
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getListSinks SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getListSinks SQLITE Finalize error code:", eCode);
+
return E_DATABASE_ERROR;
}
@@ -1970,7 +1984,8 @@ am_Error_e DatabaseHandler::getListSources(std::vector<am_Source_s> & listSource
if ((eCode = sqlite3_finalize(qConnectionFormat)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getListSources SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getListSources SQLITE Finalize error code:", eCode);
+
return E_DATABASE_ERROR;
}
@@ -1986,7 +2001,8 @@ am_Error_e DatabaseHandler::getListSources(std::vector<am_Source_s> & listSource
if ((eCode = sqlite3_finalize(qSoundProperty)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getListSources SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getListSources SQLITE Finalize error code:", eCode);
+
return E_DATABASE_ERROR;
}
@@ -2002,7 +2018,8 @@ am_Error_e DatabaseHandler::getListSources(std::vector<am_Source_s> & listSource
if ((eCode = sqlite3_finalize(qMAinSoundProperty)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getListSources SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getListSources SQLITE Finalize error code:", eCode);
+
return E_DATABASE_ERROR;
}
listSources.push_back(temp);
@@ -2013,13 +2030,15 @@ am_Error_e DatabaseHandler::getListSources(std::vector<am_Source_s> & listSource
if (eCode != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getListSources SQLITE error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getListSources SQLITE error code:", eCode);
+
return E_DATABASE_ERROR;
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getListSources SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getListSources SQLITE Finalize error code:", eCode);
+
return E_DATABASE_ERROR;
}
@@ -2057,13 +2076,15 @@ am_Error_e DatabaseHandler::getListSourceClasses(std::vector<am_SourceClass_s> &
if (eCode1 != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getListSourceClasses SQLITE error code:"), DLT_INT(eCode1));
+ logError("DatabaseHandler::getListSourceClasses SQLITE error code:", eCode1);
+
return E_DATABASE_ERROR;
}
if ((eCode1 = sqlite3_finalize(subQuery)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getListSourceClasses SQLITE Finalize error code:"), DLT_INT(eCode1));
+ logError("DatabaseHandler::getListSourceClasses SQLITE Finalize error code:", eCode1);
+
return E_DATABASE_ERROR;
}
listSourceClasses.push_back(classTemp);
@@ -2071,13 +2092,15 @@ am_Error_e DatabaseHandler::getListSourceClasses(std::vector<am_SourceClass_s> &
if (eCode != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getListSourceClasses SQLITE error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getListSourceClasses SQLITE error code:", eCode);
+
return E_DATABASE_ERROR;
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getListSourceClasses SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getListSourceClasses SQLITE Finalize error code:", eCode);
+
return E_DATABASE_ERROR;
}
@@ -2117,7 +2140,8 @@ am_Error_e DatabaseHandler::getListGateways(std::vector<am_Gateway_s> & listGate
iter = mListConnectionFormat.find(temp.gatewayID);
if (iter == mListConnectionFormat.end())
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getListGateways database error with convertionFormat"));
+ logError("DatabaseHandler::getListGateways database error with convertionFormat");
+
return E_DATABASE_ERROR;
}
temp.convertionMatrix = iter->second;
@@ -2133,7 +2157,8 @@ am_Error_e DatabaseHandler::getListGateways(std::vector<am_Gateway_s> & listGate
if ((eCode = sqlite3_finalize(qSourceConnectionFormat)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getListGateways SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getListGateways SQLITE Finalize error code:", eCode);
+
return E_DATABASE_ERROR;
}
@@ -2148,7 +2173,8 @@ am_Error_e DatabaseHandler::getListGateways(std::vector<am_Gateway_s> & listGate
if ((eCode = sqlite3_finalize(qSinkConnectionFormat)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getListGateways SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getListGateways SQLITE Finalize error code:", eCode);
+
return E_DATABASE_ERROR;
}
@@ -2159,13 +2185,15 @@ am_Error_e DatabaseHandler::getListGateways(std::vector<am_Gateway_s> & listGate
if (eCode != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getListGateways SQLITE error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getListGateways SQLITE error code:", eCode);
+
return E_DATABASE_ERROR;
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getListGateways SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getListGateways SQLITE Finalize error code:", eCode);
+
return E_DATABASE_ERROR;
}
@@ -2203,13 +2231,15 @@ am_Error_e DatabaseHandler::getListSinkClasses(std::vector<am_SinkClass_s> & lis
if (eCode != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getListSourceClasses SQLITE error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getListSourceClasses SQLITE error code:", eCode);
+
return E_DATABASE_ERROR;
}
if ((eCode = sqlite3_finalize(subQuery)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getListSourceClasses SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getListSourceClasses SQLITE Finalize error code:", eCode);
+
return E_DATABASE_ERROR;
}
listSinkClasses.push_back(classTemp);
@@ -2217,13 +2247,15 @@ am_Error_e DatabaseHandler::getListSinkClasses(std::vector<am_SinkClass_s> & lis
if (eCode != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getListSourceClasses SQLITE error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getListSourceClasses SQLITE error code:", eCode);
+
return E_DATABASE_ERROR;
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getListSourceClasses SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getListSourceClasses SQLITE Finalize error code:", eCode);
+
return E_DATABASE_ERROR;
}
@@ -2252,13 +2284,15 @@ am_Error_e DatabaseHandler::getListVisibleMainConnections(std::vector<am_MainCon
if (eCode != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getListVisibleMainConnections SQLITE error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getListVisibleMainConnections SQLITE error code:", eCode);
+
return E_DATABASE_ERROR;
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getListVisibleMainConnections SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getListVisibleMainConnections SQLITE Finalize error code:", eCode);
+
return E_DATABASE_ERROR;
}
@@ -2289,13 +2323,15 @@ am_Error_e DatabaseHandler::getListMainSinks(std::vector<am_SinkType_s> & listMa
if (eCode != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getListSinks SQLITE error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getListSinks SQLITE error code:", eCode);
+
return E_DATABASE_ERROR;
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getListSinks SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getListSinks SQLITE Finalize error code:", eCode);
+
return E_DATABASE_ERROR;
}
@@ -2324,13 +2360,15 @@ am_Error_e DatabaseHandler::getListMainSources(std::vector<am_SourceType_s> & li
if (eCode != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getListSources SQLITE error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getListSources SQLITE error code:", eCode);
+
return E_DATABASE_ERROR;
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getListSources SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getListSources SQLITE Finalize error code:", eCode);
+
return E_DATABASE_ERROR;
}
@@ -2359,13 +2397,15 @@ am_Error_e DatabaseHandler::getListMainSinkSoundProperties(const am_sinkID_t sin
if (eCode != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getListMainSinkSoundProperties SQLITE error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getListMainSinkSoundProperties SQLITE error code:", eCode);
+
return E_DATABASE_ERROR;
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getListMainSinkSoundProperties SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getListMainSinkSoundProperties SQLITE Finalize error code:", eCode);
+
return E_DATABASE_ERROR;
}
@@ -2394,13 +2434,15 @@ am_Error_e DatabaseHandler::getListMainSourceSoundProperties(const am_sourceID_t
if (eCode != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getListMainSinkSoundProperties SQLITE error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getListMainSinkSoundProperties SQLITE error code:", eCode);
+
return E_DATABASE_ERROR;
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getListMainSinkSoundProperties SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getListMainSinkSoundProperties SQLITE Finalize error code:", eCode);
+
return E_DATABASE_ERROR;
}
@@ -2426,13 +2468,15 @@ am_Error_e DatabaseHandler::getListSystemProperties(std::vector<am_SystemPropert
if (eCode != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getListSystemProperties SQLITE error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getListSystemProperties SQLITE error code:", eCode);
+
return E_DATABASE_ERROR;
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getListSystemProperties SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getListSystemProperties SQLITE Finalize error code:", eCode);
+
return E_DATABASE_ERROR;
}
@@ -2455,7 +2499,8 @@ am_Error_e am::DatabaseHandler::getListSinkConnectionFormats(const am_sinkID_t s
if ((eCode = sqlite3_finalize(qConnectionFormat)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getListSinkConnectionFormats SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getListSinkConnectionFormats SQLITE Finalize error code:", eCode);
+
return E_DATABASE_ERROR;
}
@@ -2480,7 +2525,8 @@ am_Error_e am::DatabaseHandler::getListSourceConnectionFormats(const am_sourceID
if ((eCode = sqlite3_finalize(qConnectionFormat)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getListSources SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getListSources SQLITE Finalize error code:", eCode);
+
return E_DATABASE_ERROR;
}
@@ -2493,7 +2539,8 @@ am_Error_e am::DatabaseHandler::getListGatewayConnectionFormats(const am_gateway
iter = mListConnectionFormat.find(gatewayID);
if (iter == mListConnectionFormat.end())
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getListGatewayConnectionFormats database error with convertionFormat"));
+ logError("DatabaseHandler::getListGatewayConnectionFormats database error with convertionFormat");
+
return (E_DATABASE_ERROR);
}
listConnectionFormat = iter->second;
@@ -2518,13 +2565,15 @@ am_Error_e DatabaseHandler::getTimingInformation(const am_mainConnectionID_t mai
if (eCode != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getTimingInformation SQLITE error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getTimingInformation SQLITE error code:", eCode);
+
return E_DATABASE_ERROR;
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getTimingInformation SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getTimingInformation SQLITE Finalize error code:", eCode);
+
return E_DATABASE_ERROR;
}
@@ -2540,7 +2589,7 @@ bool DatabaseHandler::sqQuery(const std::string& query)
int eCode = 0;
if ((eCode = sqlite3_exec(mDatabase, query.c_str(), NULL, &statement, NULL)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::sqQuery SQL Query failed:"), DLT_STRING(query.c_str()), DLT_STRING("error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::sqQuery SQL Query failed:", query.c_str(), "error code:", eCode);
return false;
}
return true;
@@ -2550,9 +2599,10 @@ bool DatabaseHandler::openDatabase()
{
if (sqlite3_open_v2(mPath.c_str(), &mDatabase, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_FULLMUTEX, NULL) == SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("DatabaseHandler::openDatabase opened database"));
+ logInfo("DatabaseHandler::openDatabase opened database");
return true;
- }DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::openDatabase failed to open database"));
+ }
+ logError("DatabaseHandler::openDatabase failed to open database");
return false;
}
@@ -2578,13 +2628,15 @@ am_Error_e DatabaseHandler::changeDelayMainConnection(const am_timeSync_t & dela
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::changeDelayMainConnection SQLITE Step error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::changeDelayMainConnection SQLITE Step error code:", eCode);
+
return E_DATABASE_ERROR;
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::changeDelayMainConnection SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::changeDelayMainConnection SQLITE Finalize error code:", eCode);
+
return E_DATABASE_ERROR;
}
@@ -2614,19 +2666,21 @@ am_Error_e DatabaseHandler::enterConnectionDB(const am_Connection_s& connection,
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::enterConnectionDB SQLITE Step error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::enterConnectionDB SQLITE Step error code:", eCode);
+
return E_DATABASE_ERROR;
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::enterConnectionDB SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::enterConnectionDB SQLITE Finalize error code:", eCode);
+
return E_DATABASE_ERROR;
}
connectionID = sqlite3_last_insert_rowid(mDatabase);
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("DatabaseHandler::enterConnectionDB entered new connection sourceID:"), DLT_INT16(connection.sourceID), DLT_STRING("sinkID:"), DLT_INT16(connection.sinkID), DLT_STRING("sourceID:"), DLT_INT16(connection.sourceID), DLT_STRING("delay:"), DLT_INT16(connection.delay), DLT_STRING("connectionFormat:"), DLT_INT16(connection.connectionFormat), DLT_STRING("assigned ID:"), DLT_INT16(connectionID));
+ logInfo("DatabaseHandler::enterConnectionDB entered new connection sourceID=", connection.sourceID, "sinkID=", connection.sinkID, "sourceID=", connection.sourceID, "connectionFormat=", connection.connectionFormat, "assigned ID=", connectionID);
return E_OK;
}
@@ -2671,13 +2725,15 @@ am_Error_e DatabaseHandler::enterSinkClassDB(const am_SinkClass_s & sinkClass, a
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::enterSinkClassDB SQLITE Step error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::enterSinkClassDB SQLITE Step error code:", eCode);
+
return E_DATABASE_ERROR;
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::enterSinkClassDB SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::enterSinkClassDB SQLITE Finalize error code:", eCode);
+
return E_DATABASE_ERROR;
}
@@ -2697,7 +2753,8 @@ am_Error_e DatabaseHandler::enterSinkClassDB(const am_SinkClass_s & sinkClass, a
sqlite3_bind_int(query, 2, Iterator->value);
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::enterSinkClassDB SQLITE Step error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::enterSinkClassDB SQLITE Step error code:", eCode);
+
return E_DATABASE_ERROR;
}
sqlite3_reset(query);
@@ -2705,11 +2762,12 @@ am_Error_e DatabaseHandler::enterSinkClassDB(const am_SinkClass_s & sinkClass, a
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::enterSinkClassDB SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::enterSinkClassDB SQLITE Finalize error code:", eCode);
+
return E_DATABASE_ERROR;
}
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("DatabaseHandler::enterSinkClassDB entered new sinkClass"));
+ logInfo("DatabaseHandler::enterSinkClassDB entered new sinkClass");
if (mDatabaseObserver)
mDatabaseObserver->numberOfSinkClassesChanged();
return E_OK;
@@ -2756,13 +2814,15 @@ am_Error_e DatabaseHandler::enterSourceClassDB(am_sourceClass_t & sourceClassID,
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::enterSourceClassDB SQLITE Step error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::enterSourceClassDB SQLITE Step error code:", eCode);
+
return E_DATABASE_ERROR;
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::enterSourceClassDB SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::enterSourceClassDB SQLITE Finalize error code:", eCode);
+
return E_DATABASE_ERROR;
}
@@ -2782,7 +2842,8 @@ am_Error_e DatabaseHandler::enterSourceClassDB(am_sourceClass_t & sourceClassID,
sqlite3_bind_int(query, 2, Iterator->value);
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::enterSourceClassDB SQLITE Step error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::enterSourceClassDB SQLITE Step error code:", eCode);
+
return E_DATABASE_ERROR;
}
sqlite3_reset(query);
@@ -2790,11 +2851,12 @@ am_Error_e DatabaseHandler::enterSourceClassDB(am_sourceClass_t & sourceClassID,
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::enterSourceClassDB SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::enterSourceClassDB SQLITE Finalize error code:", eCode);
+
return E_DATABASE_ERROR;
}
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("DatabaseHandler::enterSourceClassDB entered new sourceClass"));
+ logInfo("DatabaseHandler::enterSourceClassDB entered new sourceClass");
if (mDatabaseObserver)
mDatabaseObserver->numberOfSourceClassesChanged();
@@ -2819,7 +2881,8 @@ am_Error_e DatabaseHandler::enterSystemProperties(const std::vector<am_SystemPro
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::enterSystemProperties SQLITE Step error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::enterSystemProperties SQLITE Step error code:", eCode);
+
return E_DATABASE_ERROR;
}
@@ -2828,11 +2891,12 @@ am_Error_e DatabaseHandler::enterSystemProperties(const std::vector<am_SystemPro
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::enterSystemProperties SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::enterSystemProperties SQLITE Finalize error code:", eCode);
+
return E_DATABASE_ERROR;
}
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("DatabaseHandler::enterSystemProperties entered system properties"));
+ logInfo("DatabaseHandler::enterSystemProperties entered system properties");
return E_OK;
}
@@ -2848,7 +2912,7 @@ bool DatabaseHandler::existMainConnection(const am_mainConnectionID_t mainConnec
else if (eCode != SQLITE_ROW)
{
returnVal = false;
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::existMainConnection database error!:"), DLT_INT(eCode))
+ logError("DatabaseHandler::existMainConnection database error!:", eCode);
}
sqlite3_finalize(query);
return returnVal;
@@ -2866,7 +2930,7 @@ bool DatabaseHandler::existSource(const am_sourceID_t sourceID) const
else if (eCode != SQLITE_ROW)
{
returnVal = false;
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::existSource database error!:"), DLT_INT(eCode))
+ logError("DatabaseHandler::existSource database error!:", eCode);
}
sqlite3_finalize(query);
return returnVal;
@@ -2886,7 +2950,7 @@ bool DatabaseHandler::existSourceNameOrID(const am_sourceID_t sourceID, const st
else if (eCode != SQLITE_ROW)
{
returnVal = false;
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::existSource database error!:"), DLT_INT(eCode))
+ logError("DatabaseHandler::existSource database error!:", eCode);
}
sqlite3_finalize(query);
return returnVal;
@@ -2905,7 +2969,7 @@ bool DatabaseHandler::existSourceName(const std::string & name) const
else if (eCode != SQLITE_ROW)
{
returnVal = false;
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::existSource database error!:"), DLT_INT(eCode))
+ logError("DatabaseHandler::existSource database error!:", eCode);
}
sqlite3_finalize(query);
return returnVal;
@@ -2923,7 +2987,7 @@ bool DatabaseHandler::existSink(const am_sinkID_t sinkID) const
else if (eCode != SQLITE_ROW)
{
returnVal = false;
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::existSink database error!:"), DLT_INT(eCode))
+ logError("DatabaseHandler::existSink database error!:", eCode);
}
sqlite3_finalize(query);
return returnVal;
@@ -2943,7 +3007,7 @@ bool DatabaseHandler::existSinkNameOrID(const am_sinkID_t sinkID, const std::str
else if (eCode != SQLITE_ROW)
{
returnVal = false;
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::existSink database error!:"), DLT_INT(eCode))
+ logError("DatabaseHandler::existSink database error!:", eCode);
}
sqlite3_finalize(query);
return returnVal;
@@ -2962,7 +3026,7 @@ bool DatabaseHandler::existSinkName(const std::string & name) const
else if (eCode != SQLITE_ROW)
{
returnVal = false;
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::existSink database error!:"), DLT_INT(eCode))
+ logError("DatabaseHandler::existSink database error!:", eCode);
}
sqlite3_finalize(query);
return returnVal;
@@ -2980,7 +3044,7 @@ bool DatabaseHandler::existDomain(const am_domainID_t domainID) const
else if (eCode != SQLITE_ROW)
{
returnVal = false;
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::existDomain database error!:"), DLT_INT(eCode))
+ logError("DatabaseHandler::existDomain database error!:", eCode);
}
sqlite3_finalize(query);
return returnVal;
@@ -2998,7 +3062,7 @@ bool DatabaseHandler::existGateway(const am_gatewayID_t gatewayID) const
else if (eCode != SQLITE_ROW)
{
returnVal = false;
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::existGateway database error!:"), DLT_INT(eCode))
+ logError("DatabaseHandler::existGateway database error!:", eCode);
}
sqlite3_finalize(query);
return returnVal;
@@ -3020,7 +3084,7 @@ am_Error_e DatabaseHandler::getDomainOfSource(const am_sourceID_t sourceID, am_d
}
else
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getDomainOfSource database error!:"), DLT_INT(eCode))
+ logError("DatabaseHandler::getDomainOfSource database error!:", eCode);
}
sqlite3_finalize(query);
return (returnVal);
@@ -3042,7 +3106,7 @@ am_Error_e am::DatabaseHandler::getDomainOfSink(const am_sinkID_t sinkID, am_dom
}
else
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getDomainOfSink database error!:"), DLT_INT(eCode))
+ logError("DatabaseHandler::getDomainOfSink database error!:", eCode);
}
sqlite3_finalize(query);
return (returnVal);
@@ -3060,7 +3124,7 @@ bool DatabaseHandler::existSinkClass(const am_sinkClass_t sinkClassID) const
else if (eCode != SQLITE_ROW)
{
returnVal = false;
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::existSinkClass database error!:"), DLT_INT(eCode))
+ logError("DatabaseHandler::existSinkClass database error!:", eCode);
}
sqlite3_finalize(query);
return returnVal;
@@ -3078,7 +3142,7 @@ bool DatabaseHandler::existSourceClass(const am_sourceClass_t sourceClassID) con
else if (eCode != SQLITE_ROW)
{
returnVal = false;
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::existSinkClass database error!:"), DLT_INT(eCode))
+ logError("DatabaseHandler::existSinkClass database error!:", eCode);
}
sqlite3_finalize(query);
return returnVal;
@@ -3098,13 +3162,15 @@ am_Error_e DatabaseHandler::changeConnectionTimingInformation(const am_connectio
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::changeConnectionTimingInformation SQLITE Step error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::changeConnectionTimingInformation SQLITE Step error code:", eCode);
+
return E_DATABASE_ERROR;
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::changeConnectionTimingInformation SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::changeConnectionTimingInformation SQLITE Finalize error code:", eCode);
+
return E_DATABASE_ERROR;
}
@@ -3129,20 +3195,23 @@ am_Error_e DatabaseHandler::changeConnectionTimingInformation(const am_connectio
}
else if (eCode1 != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::changeConnectionTimingInformation SQLITE error code:"), DLT_INT(eCode1));
+ logError("DatabaseHandler::changeConnectionTimingInformation SQLITE error code:", eCode1);
+
return E_DATABASE_ERROR;
}
}
if (eCode != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::changeConnectionTimingInformation SQLITE error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::changeConnectionTimingInformation SQLITE error code:", eCode);
+
return E_DATABASE_ERROR;
}
if ((eCode = sqlite3_finalize(queryMainConnections)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::changeConnectionTimingInformation SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::changeConnectionTimingInformation SQLITE Finalize error code:", eCode);
+
return E_DATABASE_ERROR;
}
@@ -3162,13 +3231,15 @@ am_Error_e DatabaseHandler::changeConnectionFinal(const am_connectionID_t connec
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::changeConnectionFinal SQLITE Step error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::changeConnectionFinal SQLITE Step error code:", eCode);
+
return E_DATABASE_ERROR;
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::changeConnectionFinal SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::changeConnectionFinal SQLITE Finalize error code:", eCode);
+
return E_DATABASE_ERROR;
}
return E_OK;
@@ -3190,13 +3261,15 @@ am_timeSync_t DatabaseHandler::calculateMainConnectionDelay(const am_mainConnect
}
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::calculateMainConnectionDelay SQLITE Step error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::calculateMainConnectionDelay SQLITE Step error code:", eCode);
+
return E_DATABASE_ERROR;
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::calculateMainConnectionDelay SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::calculateMainConnectionDelay SQLITE Finalize error code:", eCode);
+
return E_DATABASE_ERROR;
}
if (min < 0)
@@ -3226,7 +3299,7 @@ bool DatabaseHandler::sourceVisible(const am_sourceID_t sourceID) const
else if (eCode != SQLITE_ROW)
{
returnVal = false;
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::sourceVisible database error!:"), DLT_INT(eCode))
+ logError("DatabaseHandler::sourceVisible database error!:", eCode);
}
sqlite3_finalize(query);
return returnVal;
@@ -3246,7 +3319,7 @@ bool DatabaseHandler::sinkVisible(const am_sinkID_t sinkID) const
else if (eCode != SQLITE_ROW)
{
returnVal = false;
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::sinkVisible database error!:"), DLT_INT(eCode))
+ logError("DatabaseHandler::sinkVisible database error!:", eCode);
}
sqlite3_finalize(query);
return returnVal;
@@ -3267,7 +3340,7 @@ bool DatabaseHandler::existConnection(const am_Connection_s connection)
else if (eCode != SQLITE_ROW)
{
returnVal = false;
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::existMainConnection database error!:"), DLT_INT(eCode))
+ logError("DatabaseHandler::existMainConnection database error!:", eCode);
}
sqlite3_finalize(query);
return returnVal;
@@ -3286,7 +3359,7 @@ bool DatabaseHandler::existConnectionID(const am_connectionID_t connectionID)
else if (eCode != SQLITE_ROW)
{
returnVal = false;
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::existMainConnection database error!:"), DLT_INT(eCode))
+ logError("DatabaseHandler::existMainConnection database error!:", eCode);
}
sqlite3_finalize(query);
return returnVal;
@@ -3305,7 +3378,7 @@ bool DatabaseHandler::existcrossFader(const am_crossfaderID_t crossfaderID) cons
else if (eCode != SQLITE_ROW)
{
returnVal = false;
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::existMainConnection database error!:"), DLT_INT(eCode))
+ logError("DatabaseHandler::existMainConnection database error!:", eCode);
}
sqlite3_finalize(query);
return returnVal;
@@ -3325,8 +3398,7 @@ am_Error_e DatabaseHandler::getSoureState(const am_sourceID_t sourceID, am_Sourc
}
else if ((eCode = sqlite3_step(query)) == SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getSoureState database error!:"), DLT_INT(eCode))
-
+ logError("DatabaseHandler::getSoureState database error!:", eCode);
}
sqlite3_finalize(query);
return E_OK;
@@ -3342,13 +3414,15 @@ am_Error_e DatabaseHandler::changeSourceState(const am_sourceID_t sourceID, cons
sqlite3_bind_int(query, 1, sourceState);
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::changeSourceState SQLITE Step error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::changeSourceState SQLITE Step error code:", eCode);
+
return E_DATABASE_ERROR;
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::changeSourceState SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::changeSourceState SQLITE Finalize error code:", eCode);
+
return E_DATABASE_ERROR;
}
return E_OK;
@@ -3368,8 +3442,7 @@ am_Error_e DatabaseHandler::getSinkVolume(const am_sinkID_t sinkID, am_volume_t
}
else if ((eCode = sqlite3_step(query)) == SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getSinkVolume database error!:"), DLT_INT(eCode))
-
+ logError("DatabaseHandler::getSinkVolume database error!:", eCode);
}
sqlite3_finalize(query);
return E_OK;
@@ -3389,7 +3462,7 @@ am_Error_e DatabaseHandler::getSourceVolume(const am_sourceID_t sourceID, am_vol
}
else if ((eCode = sqlite3_step(query)) == SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getSourceVolume database error!:"), DLT_INT(eCode))
+ logError("DatabaseHandler::getSourceVolume database error!:", eCode);
}
sqlite3_finalize(query);
return E_OK;
@@ -3413,13 +3486,15 @@ am_Error_e DatabaseHandler::getSinkSoundPropertyValue(const am_sinkID_t sinkID,
if (eCode != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getSinkSoundPropertyValue SQLITE error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getSinkSoundPropertyValue SQLITE error code:", eCode);
+
return E_DATABASE_ERROR;
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getSinkSoundPropertyValue SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getSinkSoundPropertyValue SQLITE Finalize error code:", eCode);
+
return E_DATABASE_ERROR;
}
@@ -3444,13 +3519,15 @@ am_Error_e DatabaseHandler::getSourceSoundPropertyValue(const am_sourceID_t sour
if (eCode != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getSinkSoundPropertyValue SQLITE error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getSinkSoundPropertyValue SQLITE error code:", eCode);
+
return E_DATABASE_ERROR;
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getSinkSoundPropertyValue SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getSinkSoundPropertyValue SQLITE Finalize error code:", eCode);
+
return E_DATABASE_ERROR;
}
@@ -3471,8 +3548,7 @@ am_Error_e DatabaseHandler::getDomainState(const am_domainID_t domainID, am_Doma
}
else if ((eCode = sqlite3_step(query)) == SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getDomainState database error!:"), DLT_INT(eCode))
-
+ logError("DatabaseHandler::getDomainState database error!:", eCode);
}
sqlite3_finalize(query);
return E_OK;
@@ -3492,7 +3568,7 @@ am_Error_e DatabaseHandler::peekDomain(const std::string & name, am_domainID_t &
}
else if (eCode != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::peekDomain database error!:"), DLT_INT(eCode))
+ logError("DatabaseHandler::peekDomain database error!:", eCode);
return E_DATABASE_ERROR;
}
else
@@ -3503,13 +3579,13 @@ am_Error_e DatabaseHandler::peekDomain(const std::string & name, am_domainID_t &
sqlite3_bind_int(queryInsert, 2, 1); //reservation flag
if ((eCode1 = sqlite3_step(queryInsert)) != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::peekDomain SQLITE Step error code:"), DLT_INT(eCode1));
+ logError("DatabaseHandler::peekDomain SQLITE Step error code:", eCode1);
return E_DATABASE_ERROR;
}
if ((eCode1 = sqlite3_finalize(queryInsert)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::peekDomain SQLITE Finalize error code:"), DLT_INT(eCode1));
+ logError("DatabaseHandler::peekDomain SQLITE Finalize error code:", eCode1);
return E_DATABASE_ERROR;
}
domainID = sqlite3_last_insert_rowid(mDatabase);
@@ -3531,7 +3607,7 @@ am_Error_e DatabaseHandler::peekSink(const std::string & name, am_sinkID_t & sin
}
else if (eCode != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::peekSink database error!:"), DLT_INT(eCode))
+ logError("DatabaseHandler::peekSink database error!:", eCode);
return E_DATABASE_ERROR;
}
else
@@ -3550,13 +3626,13 @@ am_Error_e DatabaseHandler::peekSink(const std::string & name, am_sinkID_t & sin
sqlite3_bind_int(queryInsert, 2, 1); //reservation flag
if ((eCode1 = sqlite3_step(queryInsert)) != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::peekSink SQLITE Step error code:"), DLT_INT(eCode1));
+ logError("DatabaseHandler::peekSink SQLITE Step error code:", eCode1);
return E_DATABASE_ERROR;
}
if ((eCode1 = sqlite3_finalize(queryInsert)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::peekDomain SQLITE Finalize error code:"), DLT_INT(eCode1));
+ logError("DatabaseHandler::peekDomain SQLITE Finalize error code:", eCode1);
return E_DATABASE_ERROR;
}
sinkID = sqlite3_last_insert_rowid(mDatabase);
@@ -3578,7 +3654,7 @@ am_Error_e DatabaseHandler::peekSource(const std::string & name, am_sourceID_t &
}
else if (eCode != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::peekSink database error!:"), DLT_INT(eCode))
+ logError("DatabaseHandler::peekSink database error!:", eCode);
return E_DATABASE_ERROR;
}
else
@@ -3597,13 +3673,13 @@ am_Error_e DatabaseHandler::peekSource(const std::string & name, am_sourceID_t &
sqlite3_bind_int(queryInsert, 2, 1); //reservation flag
if ((eCode1 = sqlite3_step(queryInsert)) != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::peekSink SQLITE Step error code:"), DLT_INT(eCode1));
+ logError("DatabaseHandler::peekSink SQLITE Step error code:", eCode1);
return E_DATABASE_ERROR;
}
if ((eCode1 = sqlite3_finalize(queryInsert)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::peekDomain SQLITE Finalize error code:"), DLT_INT(eCode1));
+ logError("DatabaseHandler::peekDomain SQLITE Finalize error code:", eCode1);
return E_DATABASE_ERROR;
}
sourceID = sqlite3_last_insert_rowid(mDatabase);
@@ -3629,16 +3705,18 @@ am_Error_e DatabaseHandler::changeSinkVolume(const am_sinkID_t sinkID, const am_
sqlite3_bind_int(query, 1, volume);
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::changeSinkVolume SQLITE Step error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::changeSinkVolume SQLITE Step error code:", eCode);
+
return E_DATABASE_ERROR;
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::changeSinkVolume SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::changeSinkVolume SQLITE Finalize error code:", eCode);
+
return E_DATABASE_ERROR;
}
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("DatabaseHandler::changeSinkVolume changed volume of sink:"), DLT_INT(sinkID), DLT_STRING("to:"), DLT_INT(volume));
+ logInfo("DatabaseHandler::changeSinkVolume changed volume of sink:", sinkID, "to:", volume);
return E_OK;
}
@@ -3660,16 +3738,18 @@ am_Error_e DatabaseHandler::changeSourceVolume(const am_sourceID_t sourceID, con
sqlite3_bind_int(query, 1, volume);
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::changeSourceVolume SQLITE Step error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::changeSourceVolume SQLITE Step error code:", eCode);
+
return E_DATABASE_ERROR;
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::changeSourceVolume SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::changeSourceVolume SQLITE Finalize error code:", eCode);
+
return E_DATABASE_ERROR;
}
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("DatabaseHandler::changeSourceVolume changed volume of source=:"), DLT_INT(sourceID), DLT_STRING("to:"), DLT_INT(volume));
+ logInfo("DatabaseHandler::changeSourceVolume changed volume of source=:", sourceID, "to:", volume);
return E_OK;
}
@@ -3692,17 +3772,19 @@ am_Error_e DatabaseHandler::changeSourceSoundPropertyDB(const am_SoundProperty_s
sqlite3_bind_int(query, 1, soundProperty.value);
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::changeSourceSoundPropertyDB SQLITE Step error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::changeSourceSoundPropertyDB SQLITE Step error code:", eCode);
+
return E_DATABASE_ERROR;
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::changeSourceSoundPropertyDB SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::changeSourceSoundPropertyDB SQLITE Finalize error code:", eCode);
+
return E_DATABASE_ERROR;
}
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("DatabaseHandler::changeSourceSoundPropertyDB changed SourceSoundProperty of source:"), DLT_INT(sourceID), DLT_STRING("type:"), DLT_INT(soundProperty.type), DLT_STRING("to:"), DLT_INT(soundProperty.value));
+ logInfo("DatabaseHandler::changeSourceSoundPropertyDB changed SourceSoundProperty of source:", sourceID, "type:", soundProperty.type, "to:", soundProperty.value);
return E_OK;
}
@@ -3725,17 +3807,17 @@ am_Error_e DatabaseHandler::changeSinkSoundPropertyDB(const am_SoundProperty_s &
sqlite3_bind_int(query, 1, soundProperty.value);
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::changeSinkSoundPropertyDB SQLITE Step error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::changeSinkSoundPropertyDB SQLITE Step error code:", eCode);
return E_DATABASE_ERROR;
}assert(sinkID!=0);
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::changeSinkSoundPropertyDB SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::changeSinkSoundPropertyDB SQLITE Finalize error code:", eCode);
return E_DATABASE_ERROR;
}
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("DatabaseHandler::changeSinkSoundPropertyDB changed MainSinkSoundProperty of sink:"), DLT_INT(sinkID), DLT_STRING("type:"), DLT_INT(soundProperty.type), DLT_STRING("to:"), DLT_INT(soundProperty.value));
+ logInfo("DatabaseHandler::changeSinkSoundPropertyDB changed MainSinkSoundProperty of sink:", sinkID, "type:", soundProperty.type, "to:", soundProperty.value);
return E_OK;
}
@@ -3757,17 +3839,18 @@ am_Error_e DatabaseHandler::changeCrossFaderHotSink(const am_crossfaderID_t cros
sqlite3_bind_int(query, 1, hotsink);
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::changeCrossFaderHotSink SQLITE Step error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::changeCrossFaderHotSink SQLITE Step error code:", eCode);
+
return E_DATABASE_ERROR;
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::changeCrossFaderHotSink SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::changeCrossFaderHotSink SQLITE Finalize error code:", eCode);
+
return E_DATABASE_ERROR;
}
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("DatabaseHandler::changeCrossFaderHotSink changed hotsink of crossfader="), DLT_INT(crossfaderID), DLT_STRING("to:"), DLT_INT(hotsink));
-
+ logInfo("DatabaseHandler::changeCrossFaderHotSink changed hotsink of crossfader=", crossfaderID, "to:", hotsink);
return E_OK;
}
@@ -3800,13 +3883,15 @@ am_Error_e DatabaseHandler::getRoutingTree(bool onlyfree, RoutingTree& tree, std
if (eCode != SQLITE_DONE)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getRoutingTree SQLITE error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getRoutingTree SQLITE error code:", eCode);
+
return (E_DATABASE_ERROR);
}
if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::getRoutingTree SQLITE Finalize error code:"), DLT_INT(eCode));
+ logError("DatabaseHandler::getRoutingTree SQLITE Finalize error code:", eCode);
+
return (E_DATABASE_ERROR);
}
i++;
diff --git a/AudioManagerDaemon/src/Router.cpp b/AudioManagerDaemon/src/Router.cpp
index 30d7f5f..afb6aa1 100644
--- a/AudioManagerDaemon/src/Router.cpp
+++ b/AudioManagerDaemon/src/Router.cpp
@@ -55,7 +55,6 @@ am_Error_e Router::getRoute(const bool onlyfree, const am_sourceID_t sourceID, c
std::vector<RoutingTreeItem*> matchtree;
std::vector<am_gatewayID_t> listGatewayID; //holds all gateway ids of the route
am_RoutingElement_s routingElement;
- std::vector<am_RoutingElement_s> actualRoutingElement; //intermediate list of current routing pairs
am_Route_s actualRoute; //holds the actual Route
am_sourceID_t lastSource = 0;
@@ -76,6 +75,7 @@ am_Error_e Router::getRoute(const bool onlyfree, const am_sourceID_t sourceID, c
iterator = matchtree.begin();
for (; iterator != matchtree.end(); ++iterator)
{
+ std::vector<am_RoutingElement_s> actualRoutingElement; //intermediate list of current routing pairs
//getting the route for the actual item
routingtree.getRoute(*iterator, listGatewayID); //This gives only the Gateway IDs we need more
@@ -133,9 +133,10 @@ void Router::listPossibleConnectionFormats(const am_sourceID_t sourceID, const a
std::vector<am_ConnectionFormat_e> listSinkFormats;
mDatabaseHandler->getListSinkConnectionFormats(sinkID, listSinkFormats);
mDatabaseHandler->getListSourceConnectionFormats(sourceID, listSourceFormats);
+ std::sort(listSinkFormats.begin(),listSinkFormats.end()); //todo: this might be not needed if we use strictly sorted input
+ std::sort(listSourceFormats.begin(),listSourceFormats.end()); //todo: this might be not needed if we use strictly sorted input
std::insert_iterator<std::vector<am_ConnectionFormat_e> > inserter(listFormats, listFormats.begin());
set_intersection(listSourceFormats.begin(), listSourceFormats.end(), listSinkFormats.begin(), listSinkFormats.end(), inserter);
- std::vector<am_ConnectionFormat_e>::iterator it = listSourceFormats.begin();
}
am_Error_e Router::findBestWay(std::vector<am_RoutingElement_s> & listRoute, std::vector<am_RoutingElement_s>::iterator routeIterator, std::vector<am_gatewayID_t>::iterator gatewayIterator)
@@ -157,6 +158,7 @@ am_Error_e Router::findBestWay(std::vector<am_RoutingElement_s> & listRoute, std
std::vector<am_RoutingElement_s>::iterator tempIterator(routeIterator);
tempIterator--;
listRestrictedOutputFormatsGateways(*gatewayIterator, (tempIterator)->connectionFormat, listRestrictedConnectionFormats);
+ std::sort(listRestrictedConnectionFormats.begin(),listRestrictedConnectionFormats.end()); //todo: this might be not needed if we use strictly sorted input
set_intersection(listConnectionFormats.begin(), listConnectionFormats.end(), listRestrictedConnectionFormats.begin(), listRestrictedConnectionFormats.end(), inserter);
gatewayIterator++;
}
@@ -208,17 +210,17 @@ void Router::listRestrictedOutputFormatsGateways(const am_gatewayID_t gatewayID,
int rowNumberSink = rowSinkIterator - gatewayData.listSinkFormats.begin();
//go through the convertionMatrix and find out if the conversion is possible, if yes, add connectionFormat ...
- matrixIterator + rowNumberSink;
+ std::advance(matrixIterator, rowNumberSink);
//iterate line-wise through the matrix and add more formats
do
{
if (*matrixIterator)
{
- listFormats.push_back(gatewayData.listSourceFormats.at(matrixIterator - gatewayData.convertionMatrix.begin()));
+ listFormats.push_back(gatewayData.listSourceFormats.at((matrixIterator - gatewayData.convertionMatrix.begin()) / gatewayData.listSinkFormats.size()));
}
- matrixIterator += gatewayData.listSinkFormats.size();
- } while (matrixIterator - gatewayData.convertionMatrix.begin() < (int) gatewayData.listSourceFormats.size());
+ std::advance(matrixIterator, gatewayData.listSinkFormats.size());
+ } while (gatewayData.convertionMatrix.end() - matrixIterator > 0);
}
Router::~Router()
diff --git a/AudioManagerDaemon/src/RoutingReceiver.cpp b/AudioManagerDaemon/src/RoutingReceiver.cpp
index a6f35e7..00575fe 100644
--- a/AudioManagerDaemon/src/RoutingReceiver.cpp
+++ b/AudioManagerDaemon/src/RoutingReceiver.cpp
@@ -317,7 +317,7 @@ am_Error_e RoutingReceiver::sendChangedData(const std::vector<am_EarlyData_s> &
//todo: change return type to void in EA model
}
-am_Error_e RoutingReceiver::peekSinkClassID(const std::string name, const am_sinkClass_t& sinkClassID)
+am_Error_e RoutingReceiver::peekSinkClassID(const std::string& name, const am_sinkClass_t& sinkClassID)
{
(void) name;
(void) sinkClassID;
@@ -325,7 +325,7 @@ am_Error_e RoutingReceiver::peekSinkClassID(const std::string name, const am_sin
return E_NOT_USED;
}
-am_Error_e RoutingReceiver::peekSourceClassID(const std::string name, const am_sourceClass_t& sourceClassID)
+am_Error_e RoutingReceiver::peekSourceClassID(const std::string& name, const am_sourceClass_t& sourceClassID)
{
(void) name;
(void) sourceClassID;
diff --git a/AudioManagerDaemon/src/RoutingSender.cpp b/AudioManagerDaemon/src/RoutingSender.cpp
index ac99fb7..8b35800 100644
--- a/AudioManagerDaemon/src/RoutingSender.cpp
+++ b/AudioManagerDaemon/src/RoutingSender.cpp
@@ -26,9 +26,9 @@
#include <utility>
#include <dirent.h>
#include <dlfcn.h>
-#include <dlt/dlt.h>
#include <assert.h>
#include "PluginTemplate.h"
+#include "DLTWrapper.h"
using namespace am;
@@ -61,12 +61,12 @@ RoutingSender::RoutingSender(const std::vector<std::string>& listOfPluginDirecto
for (; dirIter < dirIterEnd; ++dirIter)
{
const char* directoryName = dirIter->c_str();
- //DLT_LOG(AudioManager,DLT_LOG_INFO, DLT_STRING("Searching for HookPlugins in"),DLT_STRING(directoryName));
+ logInfo("Searching for HookPlugins in",directoryName);
DIR *directory = opendir(directoryName);
if (!directory)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("RoutingSender::RoutingSender Error opening directory "), DLT_STRING(directoryName));
+ logError("RoutingSender::RoutingSender Error opening directory: ", directoryName);
continue;
}
@@ -82,13 +82,13 @@ RoutingSender::RoutingSender(const std::vector<std::string>& listOfPluginDirecto
if (regularFile && sharedLibExtension)
{
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("RoutingSender::RoutingSender adding file "), DLT_STRING(entryName.c_str()));
+ logInfo("RoutingSender::RoutingSender adding file: ", entryName);
std::string name(directoryName);
sharedLibraryNameList.push_back(name + "/" + entryName);
}
else
{
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("RoutingSender::RoutingSender PluginSearch ignoring file "), DLT_STRING(entryName.c_str()));
+ logInfo("RoutingSender::RoutingSender PluginSearch ignoring file :", entryName);
}
}
@@ -101,7 +101,7 @@ RoutingSender::RoutingSender(const std::vector<std::string>& listOfPluginDirecto
for (; iter != iterEnd; ++iter)
{
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("RoutingSender::RoutingSender try loading "), DLT_STRING(iter->c_str()));
+ logInfo("RoutingSender::RoutingSender try loading: " , *iter);
RoutingSendInterface* (*createFunc)();
void* tempLibHandle = NULL;
@@ -109,7 +109,7 @@ RoutingSender::RoutingSender(const std::vector<std::string>& listOfPluginDirecto
if (!createFunc)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("RoutingSender::RoutingSender Entry point of RoutingPlugin not found"));
+ logError("RoutingSender::RoutingSender Entry point of RoutingPlugin not found");
continue;
}
@@ -117,7 +117,7 @@ RoutingSender::RoutingSender(const std::vector<std::string>& listOfPluginDirecto
if (!router)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("RoutingSender::RoutingSender RoutingPlugin initialization failed. Entry Function not callable"));
+ logError("RoutingSender::RoutingSender RoutingPlugin initialization failed. Entry Function not callable");
continue;
}
@@ -127,7 +127,7 @@ RoutingSender::RoutingSender(const std::vector<std::string>& listOfPluginDirecto
//check libversion
if (router->getInterfaceVersion() < REQUIRED_INTERFACE_VERSION)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("RoutingSender::RoutingSender RoutingPlugin initialization failed. Version of Interface to old"));
+ logError("RoutingSender::RoutingSender RoutingPlugin initialization failed. Version of Interface to old");
continue;
}
diff --git a/AudioManagerDaemon/src/SocketHandler.cpp b/AudioManagerDaemon/src/SocketHandler.cpp
index dbff14c..26f6d66 100644
--- a/AudioManagerDaemon/src/SocketHandler.cpp
+++ b/AudioManagerDaemon/src/SocketHandler.cpp
@@ -31,14 +31,11 @@
#include <algorithm>
#include <time.h>
#include <features.h>
-#include <dlt/dlt.h>
#include <signal.h>
+#include "DLTWrapper.h"
-#include <iostream>
//todo: implement time correction if timer was interrupted by call
-DLT_IMPORT_CONTEXT(AudioManager)
-
using namespace am;
SocketHandler::SocketHandler() :
@@ -112,7 +109,7 @@ void SocketHandler::start_listenting()
}
else
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("SocketHandler::start_listenting ppoll returned with error"), DLT_INT(errno));
+ logError("SocketHandler::start_listenting ppoll returned with error",errno);
exit(0);
}
}
@@ -128,7 +125,7 @@ void SocketHandler::start_listenting()
//todo: add things to do here before going to sleep
exit(0);
}
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("SocketHandler::start_listenting poll returned with error"),DLT_INT(errno));
+ logError("SocketHandler::start_listenting poll returned with error",errno);
exit(0);
}
//sigprocmask (SIG_SETMASK, &oldmask, NULL);
diff --git a/AudioManagerDaemon/src/TelnetServer.cpp b/AudioManagerDaemon/src/TelnetServer.cpp
index 43fcc46..dea5ddc 100644
--- a/AudioManagerDaemon/src/TelnetServer.cpp
+++ b/AudioManagerDaemon/src/TelnetServer.cpp
@@ -29,7 +29,6 @@
#include <sys/ioctl.h>
#include <string.h>
#include <netdb.h>
-#include <dlt/dlt.h>
#include <config.h>
#include <errno.h>
#include <sstream>
@@ -41,8 +40,6 @@
using namespace am;
-DLT_IMPORT_CONTEXT(AudioManager)
-
TelnetServer* TelnetServer::instance = NULL;
#define PRINT_BOOL(var) var ? output+="true\t\t" : output+="false\t\t";
@@ -93,11 +90,6 @@ TelnetServer::TelnetServer(SocketHandler *iSocketHandler, CommandSender *iComman
servAddr.sin_port = htons(servPort);
bind(mConnectFD, (struct sockaddr *) &servAddr, sizeof(servAddr));
- if (listen(mConnectFD, mMaxConnections) < 0)
- {
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("TelnetServer::TelnetServerk cannot listen "), DLT_INT(errno));
- }DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("TelnetServer::TelnetServerk started listening on port"), DLT_INT(mServerPort));
-
int a = 1;
ioctl(mConnectFD, FIONBIO, (char *) &a);
setsockopt(mConnectFD, SOL_SOCKET, SO_KEEPALIVE, (char *) &a, sizeof(a));
diff --git a/AudioManagerDaemon/src/main.cpp b/AudioManagerDaemon/src/main.cpp
index 48b00a7..a57e6c0 100644
--- a/AudioManagerDaemon/src/main.cpp
+++ b/AudioManagerDaemon/src/main.cpp
@@ -50,6 +50,7 @@
#include "DatabaseObserver.h"
#include "TelnetServer.h"
#include "Router.h"
+#include "DLTWrapper.h"
#include <sys/resource.h>
#include <sys/stat.h>
#include <unistd.h>
@@ -61,8 +62,6 @@
#include <string.h>
#include <stdio.h>
-#include <dlt/dlt.h>
-
DLT_DECLARE_CONTEXT(AudioManager)
using namespace am;
@@ -98,13 +97,13 @@ void daemonize()
rlimit rl;
if (getrlimit(RLIMIT_NOFILE, &rl) < 0)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("can't get file limit "));
+ logError("can't get file limit ");
}
pid_t pid;
if ((pid = fork()) < 0)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("cannot fork!"));
+ logError("cannot fork!");
}
else if (pid != 0)
{
@@ -115,7 +114,7 @@ void daemonize()
if (!dir.empty() && chdir(dir.c_str()) < 0)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("couldn't chdir to the new directory"));
+ logError("couldn't chdir to the new directory");
}
if (rl.rlim_max == RLIM_INFINITY)
@@ -134,7 +133,7 @@ void daemonize()
if (fd0 != STDIN_FILENO || fd1 != STDOUT_FILENO || fd2 != STDERR_FILENO)
{
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("new standard file descriptors were not opened"));
+ logError("new standard file descriptors were not opened");
}
}
@@ -209,7 +208,7 @@ static void signalHandler(int sig, siginfo_t *siginfo, void *context)
(void) sig;
(void) siginfo;
(void) context;
- DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("signal handler was called, exit now..."));
+ logError("signal handler was called, exit now...");
gDispatchDone = 1;
//todo: maually fire the mainloop
//todo: ifdef no sockethandler
@@ -218,9 +217,10 @@ static void signalHandler(int sig, siginfo_t *siginfo, void *context)
int main(int argc, char *argv[])
{
- DLT_REGISTER_APP("AudioManagerDeamon", "AudioManagerDeamon");
- DLT_REGISTER_CONTEXT(AudioManager, "Main", "Main Context");
- DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("The AudioManager is started, "), DLT_STRING(DAEMONVERSION));
+ DLTWrapper::instance()->registerApp("AudioManagerDeamon", "AudioManagerDeamon");
+ DLTWrapper::instance()->registerContext(AudioManager,"Main", "Main Context");
+ logInfo("The Audiomanager is started");
+ log(&AudioManager,DLT_LOG_ERROR,"The version of the Audiomanager",DAEMONVERSION);
listCommandPluginDirs.push_back(std::string(DEFAULT_PLUGIN_COMMAND_DIR));
listRoutingPluginDirs.push_back(std::string(DEFAULT_PLUGIN_ROUTING_DIR));
diff --git a/AudioManagerDaemon/test/controlInterface/CMakeLists.txt b/AudioManagerDaemon/test/controlInterface/CMakeLists.txt
index 0e4f1ee..5071326 100644
--- a/AudioManagerDaemon/test/controlInterface/CMakeLists.txt
+++ b/AudioManagerDaemon/test/controlInterface/CMakeLists.txt
@@ -53,6 +53,7 @@ file(GLOB CONTROL_INTERFACE_SRCS_CXX
"../../src/ControlReceiver.cpp"
"../../src/ControlSender.cpp"
"../../src/Router.cpp"
+ "../../src/DLTWrapper.cpp"
"../CommonFunctions.cpp"
"*.cpp"
)
diff --git a/AudioManagerDaemon/test/controlInterface/controlInterfaceTest.cpp b/AudioManagerDaemon/test/controlInterface/controlInterfaceTest.cpp
index c22f175..599d15f 100644
--- a/AudioManagerDaemon/test/controlInterface/controlInterfaceTest.cpp
+++ b/AudioManagerDaemon/test/controlInterface/controlInterfaceTest.cpp
@@ -27,12 +27,11 @@
#include <string>
#include <vector>
#include <set>
+#include "DLTWrapper.h"
using namespace am;
using namespace testing;
-DLT_DECLARE_CONTEXT(DLT_CONTEXT)
-
controlInterfaceTest::controlInterfaceTest() :
pDBusWrapper((DBusWrapper*) 1), //
plistCommandPluginDirs(), //
@@ -63,15 +62,11 @@ controlInterfaceTest::~controlInterfaceTest()
void controlInterfaceTest::SetUp()
{
- DLT_REGISTER_APP("Rtest", "RoutingInterfacetest");
- DLT_REGISTER_CONTEXT(DLT_CONTEXT, "Main", "Main Context");
- DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("RoutingSendInterface Test started "));
-
+ logInfo("RoutingSendInterface Test started");
}
void controlInterfaceTest::TearDown()
{
- DLT_UNREGISTER_CONTEXT(DLT_CONTEXT);
}
TEST_F(controlInterfaceTest,registerDomain)
diff --git a/AudioManagerDaemon/test/controlInterface/controlInterfaceTest.h b/AudioManagerDaemon/test/controlInterface/controlInterfaceTest.h
index 0029d73..7eb182d 100644
--- a/AudioManagerDaemon/test/controlInterface/controlInterfaceTest.h
+++ b/AudioManagerDaemon/test/controlInterface/controlInterfaceTest.h
@@ -28,7 +28,6 @@
#include <gtest/gtest.h>
#include <gmock/gmock.h>
#include <dbus/DBusWrapper.h>
-#include <dlt/dlt.h>
#include "MockInterfaces.h"
#include "DatabaseHandler.h"
#include "ControlReceiver.h"
diff --git a/AudioManagerDaemon/test/database/CMakeLists.txt b/AudioManagerDaemon/test/database/CMakeLists.txt
index 79aff0e..4f8ac3a 100644
--- a/AudioManagerDaemon/test/database/CMakeLists.txt
+++ b/AudioManagerDaemon/test/database/CMakeLists.txt
@@ -51,6 +51,7 @@ file(GLOB DATABASE_SRCS_CXX
"../../src/ControlReceiver.cpp"
"../../src/ControlSender.cpp"
"../../src/Router.cpp"
+ "../../src/DLTWrapper.cpp"
"../CommonFunctions.cpp"
"*.cpp"
)
diff --git a/AudioManagerDaemon/test/database/databaseTest.cpp b/AudioManagerDaemon/test/database/databaseTest.cpp
index 064cc05..6122505 100644
--- a/AudioManagerDaemon/test/database/databaseTest.cpp
+++ b/AudioManagerDaemon/test/database/databaseTest.cpp
@@ -32,12 +32,11 @@
#include "../ControlInterfaceBackdoor.h"
#include "../CommandInterfaceBackdoor.h"
#include "../CommonFunctions.h"
+#include "DLTWrapper.h"
using namespace am;
using namespace testing;
-DLT_DECLARE_CONTEXT(DLT_CONTEXT)
-
//extern int GetRandomNumber(int nLow, int nHigh);
//extern bool equalSoundProperty (const am_SoundProperty_s a, const am_SoundProperty_s b);
extern bool equalMainSoundProperty(const am_MainSoundProperty_s a, const am_MainSoundProperty_s b);
@@ -54,8 +53,8 @@ routingTest::routingTest() :
pMockInterface(), //
pRoutingInterfaceBackdoor(), //
pCommandInterfaceBackdoor(), //
- pControlSender(""),//
- pRouter(&pDatabaseHandler,&pControlSender), //
+ pControlSender(""), //
+ pRouter(&pDatabaseHandler, &pControlSender), //
pControlReceiver(&pDatabaseHandler, &pRoutingSender, &pCommandSender, &pRouter), //
pObserver(&pCommandSender, &pRoutingSender)
{
@@ -148,14 +147,11 @@ void routingTest::createMainConnectionSetup()
void routingTest::SetUp()
{
- DLT_REGISTER_APP("Dtest", "AudioManagerDeamon");
- DLT_REGISTER_CONTEXT(DLT_CONTEXT, "Main", "Main Context");
- DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("Database Test started "));
+ logInfo("Database Test started ");
}
void routingTest::TearDown()
{
- DLT_UNREGISTER_CONTEXT(DLT_CONTEXT);
}
TEST_F(routingTest,crossfaders)
diff --git a/AudioManagerDaemon/test/database/databaseTest.h b/AudioManagerDaemon/test/database/databaseTest.h
index 466567b..dd260b1 100644
--- a/AudioManagerDaemon/test/database/databaseTest.h
+++ b/AudioManagerDaemon/test/database/databaseTest.h
@@ -30,7 +30,6 @@
#include <gtest/gtest.h>
#include <gmock/gmock.h>
-#include <dlt/dlt.h>
#include <algorithm>
#include <string>
#include <vector>
diff --git a/AudioManagerDaemon/test/routing/CMakeLists.txt b/AudioManagerDaemon/test/routing/CMakeLists.txt
index 07d9b04..8f45741 100644
--- a/AudioManagerDaemon/test/routing/CMakeLists.txt
+++ b/AudioManagerDaemon/test/routing/CMakeLists.txt
@@ -51,6 +51,7 @@ file(GLOB ROUTING_SRCS_CXX
"../../src/ControlReceiver.cpp"
"../../src/ControlSender.cpp"
"../../src/Router.cpp"
+ "../../src/DLTWrapper.cpp"
"../CommonFunctions.cpp"
"*.cpp"
)
diff --git a/AudioManagerDaemon/test/routing/routingTest.cpp b/AudioManagerDaemon/test/routing/routingTest.cpp
index 2ed2c9b..fdfbcf8 100644
--- a/AudioManagerDaemon/test/routing/routingTest.cpp
+++ b/AudioManagerDaemon/test/routing/routingTest.cpp
@@ -33,19 +33,18 @@
#include "../ControlInterfaceBackdoor.h"
#include "../CommandInterfaceBackdoor.h"
#include "../CommonFunctions.h"
+#include "DLTWrapper.h"
#include <string.h>
using namespace am;
using namespace testing;
-DLT_DECLARE_CONTEXT(DLT_CONTEXT)
-
routingTest::routingTest() :
plistRoutingPluginDirs(), //
plistCommandPluginDirs(), //
pDatabaseHandler(std::string(":memory:")), //
pControlSender(std::string("")), //
- pRouter(&pDatabaseHandler,&pControlSender), //
+ pRouter(&pDatabaseHandler, &pControlSender), //
pRoutingSender(plistRoutingPluginDirs), //
pCommandSender(plistCommandPluginDirs), //
pMockInterface(), //
@@ -67,19 +66,720 @@ routingTest::~routingTest()
void routingTest::SetUp()
{
- DLT_REGISTER_APP("Dtest", "AudioManagerDeamon");
- DLT_REGISTER_CONTEXT(DLT_CONTEXT, "Main", "Main Context");
- DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("Database Test started "));
+ logInfo("Routing Test started ");
}
void routingTest::TearDown()
{
- DLT_UNREGISTER_CONTEXT(DLT_CONTEXT);
}
-ACTION(returnConnectionFormat)
+ACTION(returnConnectionFormat){
+arg3=arg2;
+}
+
+//test that checks 3 domains, one sink one source, longer lists of connectionformats.
+TEST_F(routingTest,simpleRoute3DomainsListConnectionFormats_2)
+{
+ EXPECT_CALL(pMockInterface,cbNumberOfSourcesChanged()).Times(3);
+ EXPECT_CALL(pMockInterface,cbNumberOfSinksChanged()).Times(3);
+ EXPECT_CALL(pMockControlInterface,getConnectionFormatChoice(_,_,_,_)).WillRepeatedly(DoAll(returnConnectionFormat(), Return(E_OK)));
+
+ //initialize 2 domains
+ am_Domain_s domain1, domain2, domain3;
+ am_domainID_t domainID1, domainID2, domainID3;
+
+ domain1.domainID = 0;
+ domain1.name = "domain1";
+ domain1.busname = "domain1bus";
+ domain1.state = DS_CONTROLLED;
+ domain2.domainID = 0;
+ domain2.name = "domain2";
+ domain2.busname = "domain2bus";
+ domain2.state = DS_CONTROLLED;
+ domain3.domainID = 0;
+ domain3.name = "domain3";
+ domain3.busname = "domain3bus";
+ domain3.state = DS_CONTROLLED;
+
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterDomainDB(domain1,domainID1));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterDomainDB(domain2,domainID2));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterDomainDB(domain3,domainID3));
+
+ am_Source_s source, gwSource, gwSource1;
+ am_sourceID_t sourceID, gwSourceID, gwSourceID1;
+
+ source.domainID = domainID1;
+ source.name = "source1";
+ source.sourceState = SS_ON;
+ source.sourceID = 0;
+ source.sourceClassID = 5;
+ source.listConnectionFormats.push_back(CF_STEREO);
+ source.listConnectionFormats.push_back(CF_MONO);
+
+ gwSource.domainID = domainID2;
+ gwSource.name = "gwsource1";
+ gwSource.sourceState = SS_ON;
+ gwSource.sourceID = 0;
+ gwSource.sourceClassID = 5;
+ gwSource.listConnectionFormats.push_back(CF_MONO);
+ gwSource.listConnectionFormats.push_back(CF_STEREO);
+ gwSource.listConnectionFormats.push_back(CF_ANALOG);
+
+ gwSource1.domainID = domainID3;
+ gwSource1.name = "gwsource2";
+ gwSource1.sourceState = SS_ON;
+ gwSource1.sourceID = 0;
+ gwSource1.sourceClassID = 5;
+ gwSource1.listConnectionFormats.push_back(CF_STEREO);
+ gwSource1.listConnectionFormats.push_back(CF_MONO);
+
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(source,sourceID));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(gwSource,gwSourceID));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(gwSource1,gwSourceID1));
+
+ am_Sink_s sink, gwSink, gwSink1;
+ am_sinkID_t sinkID, gwSinkID, gwSinkID1;
+
+ sink.domainID = domainID3;
+ sink.name = "sink1";
+ sink.sinkID = 0;
+ sink.sinkClassID = 5;
+ sink.muteState = MS_MUTED;
+ sink.listConnectionFormats.push_back(CF_MONO);
+
+ gwSink.domainID = domainID1;
+ gwSink.name = "gwSink";
+ gwSink.sinkID = 0;
+ gwSink.sinkClassID = 5;
+ gwSink.muteState = MS_MUTED;
+ gwSink.listConnectionFormats.push_back(CF_STEREO);
+ gwSink.listConnectionFormats.push_back(CF_MONO);
+
+ gwSink1.domainID = domainID2;
+ gwSink1.name = "gwSink1";
+ gwSink1.sinkID = 0;
+ gwSink1.sinkClassID = 5;
+ gwSink1.muteState = MS_MUTED;
+ gwSink1.listConnectionFormats.push_back(CF_ANALOG);
+ gwSink1.listConnectionFormats.push_back(CF_STEREO);
+
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(sink,sinkID));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(gwSink,gwSinkID));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(gwSink1,gwSinkID1));
+
+ am_Gateway_s gateway, gateway1;
+ am_gatewayID_t gatewayID, gatewayID1;
+
+ gateway.controlDomainID = domainID1;
+ gateway.gatewayID = 0;
+ gateway.sinkID = gwSinkID;
+ gateway.sourceID = gwSourceID;
+ gateway.domainSourceID = domainID2;
+ gateway.domainSinkID = domainID1;
+ gateway.listSinkFormats = gwSink.listConnectionFormats;
+ gateway.listSourceFormats = gwSource.listConnectionFormats;
+ gateway.convertionMatrix.push_back(false);
+ gateway.convertionMatrix.push_back(false);
+ gateway.convertionMatrix.push_back(false);
+ gateway.convertionMatrix.push_back(true);
+ gateway.convertionMatrix.push_back(true);
+ gateway.convertionMatrix.push_back(false);
+ gateway.name = "gateway";
+
+ gateway1.controlDomainID = domainID2;
+ gateway1.gatewayID = 0;
+ gateway1.sinkID = gwSinkID1;
+ gateway1.sourceID = gwSourceID1;
+ gateway1.domainSourceID = domainID3;
+ gateway1.domainSinkID = domainID2;
+ gateway1.listSinkFormats = gwSink1.listConnectionFormats;
+ gateway1.listSourceFormats = gwSource1.listConnectionFormats;
+ gateway1.convertionMatrix.push_back(false);
+ gateway1.convertionMatrix.push_back(false);
+ gateway1.convertionMatrix.push_back(false);
+ gateway1.convertionMatrix.push_back(true);
+ gateway1.name = "gateway1";
+
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterGatewayDB(gateway,gatewayID));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterGatewayDB(gateway1,gatewayID1));
+
+ std::vector<am_Route_s> listRoutes;
+ std::vector<am_RoutingElement_s> listRoutingElements;
+ am_RoutingElement_s hopp1;
+ am_RoutingElement_s hopp2;
+ am_RoutingElement_s hopp3;
+
+ hopp1.sourceID = sourceID;
+ hopp1.sinkID = gwSinkID;
+ hopp1.domainID = domainID1;
+ hopp1.connectionFormat = source.listConnectionFormats[1];
+
+ hopp2.sourceID = gwSourceID;
+ hopp2.sinkID = gwSinkID1;
+ hopp2.domainID = domainID2;
+ hopp2.connectionFormat = gwSink1.listConnectionFormats[1];
+
+ hopp3.sourceID = gwSourceID1;
+ hopp3.sinkID = sinkID;
+ hopp3.domainID = domainID3;
+ hopp3.connectionFormat = sink.listConnectionFormats[0];
+
+ listRoutingElements.push_back(hopp1);
+ listRoutingElements.push_back(hopp2);
+ listRoutingElements.push_back(hopp3);
+
+ am_Route_s compareRoute;
+ compareRoute.route = listRoutingElements;
+ compareRoute.sinkID = sinkID;
+ compareRoute.sourceID = sourceID;
+
+ ASSERT_EQ(E_OK, pRouter.getRoute(false,sourceID,sinkID,listRoutes));
+ ASSERT_EQ(1, listRoutes.size());
+ ASSERT_TRUE(pCF.compareRoute(compareRoute,listRoutes[0]));
+}
+
+//test that checks 3 domains, one sink one source, longer lists of connectionformats.
+TEST_F(routingTest,simpleRoute3DomainsListConnectionFormats_1)
+{
+ EXPECT_CALL(pMockInterface,cbNumberOfSourcesChanged()).Times(3);
+ EXPECT_CALL(pMockInterface,cbNumberOfSinksChanged()).Times(3);
+ EXPECT_CALL(pMockControlInterface,getConnectionFormatChoice(_,_,_,_)).WillRepeatedly(DoAll(returnConnectionFormat(), Return(E_OK)));
+
+ //initialize 2 domains
+ am_Domain_s domain1, domain2, domain3;
+ am_domainID_t domainID1, domainID2, domainID3;
+
+ domain1.domainID = 0;
+ domain1.name = "domain1";
+ domain1.busname = "domain1bus";
+ domain1.state = DS_CONTROLLED;
+ domain2.domainID = 0;
+ domain2.name = "domain2";
+ domain2.busname = "domain2bus";
+ domain2.state = DS_CONTROLLED;
+ domain3.domainID = 0;
+ domain3.name = "domain3";
+ domain3.busname = "domain3bus";
+ domain3.state = DS_CONTROLLED;
+
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterDomainDB(domain1,domainID1));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterDomainDB(domain2,domainID2));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterDomainDB(domain3,domainID3));
+
+ am_Source_s source, gwSource, gwSource1;
+ am_sourceID_t sourceID, gwSourceID, gwSourceID1;
+
+ source.domainID = domainID1;
+ source.name = "source1";
+ source.sourceState = SS_ON;
+ source.sourceID = 0;
+ source.sourceClassID = 5;
+ source.listConnectionFormats.push_back(CF_STEREO);
+ source.listConnectionFormats.push_back(CF_MONO);
+
+ gwSource.domainID = domainID2;
+ gwSource.name = "gwsource1";
+ gwSource.sourceState = SS_ON;
+ gwSource.sourceID = 0;
+ gwSource.sourceClassID = 5;
+ gwSource.listConnectionFormats.push_back(CF_STEREO);
+ gwSource.listConnectionFormats.push_back(CF_MONO);
+ gwSource.listConnectionFormats.push_back(CF_ANALOG);
+
+ gwSource1.domainID = domainID3;
+ gwSource1.name = "gwsource2";
+ gwSource1.sourceState = SS_ON;
+ gwSource1.sourceID = 0;
+ gwSource1.sourceClassID = 5;
+ gwSource1.listConnectionFormats.push_back(CF_MONO);
+
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(source,sourceID));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(gwSource,gwSourceID));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(gwSource1,gwSourceID1));
+
+ am_Sink_s sink, gwSink, gwSink1;
+ am_sinkID_t sinkID, gwSinkID, gwSinkID1;
+
+ sink.domainID = domainID3;
+ sink.name = "sink1";
+ sink.sinkID = 0;
+ sink.sinkClassID = 5;
+ sink.muteState = MS_MUTED;
+ sink.listConnectionFormats.push_back(CF_MONO);
+
+ gwSink.domainID = domainID1;
+ gwSink.name = "gwSink";
+ gwSink.sinkID = 0;
+ gwSink.sinkClassID = 5;
+ gwSink.muteState = MS_MUTED;
+ gwSink.listConnectionFormats.push_back(CF_STEREO);
+ gwSink.listConnectionFormats.push_back(CF_MONO);
+
+ gwSink1.domainID = domainID2;
+ gwSink1.name = "gwSink1";
+ gwSink1.sinkID = 0;
+ gwSink1.sinkClassID = 5;
+ gwSink1.muteState = MS_MUTED;
+ gwSink1.listConnectionFormats.push_back(CF_ANALOG);
+
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(sink,sinkID));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(gwSink,gwSinkID));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(gwSink1,gwSinkID1));
+
+ am_Gateway_s gateway, gateway1;
+ am_gatewayID_t gatewayID, gatewayID1;
+
+ gateway.controlDomainID = domainID1;
+ gateway.gatewayID = 0;
+ gateway.sinkID = gwSinkID;
+ gateway.sourceID = gwSourceID;
+ gateway.domainSourceID = domainID2;
+ gateway.domainSinkID = domainID1;
+ gateway.listSinkFormats = gwSink.listConnectionFormats;
+ gateway.listSourceFormats = gwSource.listConnectionFormats;
+ gateway.convertionMatrix.push_back(false);
+ gateway.convertionMatrix.push_back(false);
+ gateway.convertionMatrix.push_back(false);
+ gateway.convertionMatrix.push_back(false);
+ gateway.convertionMatrix.push_back(true);
+ gateway.convertionMatrix.push_back(false);
+ gateway.name = "gateway";
+
+ gateway1.controlDomainID = domainID2;
+ gateway1.gatewayID = 0;
+ gateway1.sinkID = gwSinkID1;
+ gateway1.sourceID = gwSourceID1;
+ gateway1.domainSourceID = domainID3;
+ gateway1.domainSinkID = domainID2;
+ gateway1.listSinkFormats = gwSink1.listConnectionFormats;
+ gateway1.listSourceFormats = gwSource1.listConnectionFormats;
+ gateway1.convertionMatrix.push_back(true);
+ gateway1.name = "gateway";
+
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterGatewayDB(gateway,gatewayID));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterGatewayDB(gateway1,gatewayID1));
+
+ std::vector<am_Route_s> listRoutes;
+ std::vector<am_RoutingElement_s> listRoutingElements;
+ am_RoutingElement_s hopp1;
+ am_RoutingElement_s hopp2;
+ am_RoutingElement_s hopp3;
+
+ hopp1.sourceID = sourceID;
+ hopp1.sinkID = gwSinkID;
+ hopp1.domainID = domainID1;
+ hopp1.connectionFormat = source.listConnectionFormats[0];
+
+ hopp2.sourceID = gwSourceID;
+ hopp2.sinkID = gwSinkID1;
+ hopp2.domainID = domainID2;
+ hopp2.connectionFormat = gwSink1.listConnectionFormats[0];
+
+ hopp3.sourceID = gwSourceID1;
+ hopp3.sinkID = sinkID;
+ hopp3.domainID = domainID3;
+ hopp3.connectionFormat = sink.listConnectionFormats[0];
+
+ listRoutingElements.push_back(hopp1);
+ listRoutingElements.push_back(hopp2);
+ listRoutingElements.push_back(hopp3);
+
+ am_Route_s compareRoute;
+ compareRoute.route = listRoutingElements;
+ compareRoute.sinkID = sinkID;
+ compareRoute.sourceID = sourceID;
+
+ ASSERT_EQ(E_OK, pRouter.getRoute(false,sourceID,sinkID,listRoutes));
+ ASSERT_EQ(1, listRoutes.size());
+ ASSERT_TRUE(pCF.compareRoute(compareRoute,listRoutes[0]));
+}
+
+
+//test that checks 3 domains, one sink one source, longer lists of connectionformats.
+TEST_F(routingTest,simpleRoute3DomainsListConnectionFormats)
+{
+ EXPECT_CALL(pMockInterface,cbNumberOfSourcesChanged()).Times(3);
+ EXPECT_CALL(pMockInterface,cbNumberOfSinksChanged()).Times(3);
+ EXPECT_CALL(pMockControlInterface,getConnectionFormatChoice(_,_,_,_)).WillRepeatedly(DoAll(returnConnectionFormat(), Return(E_OK)));
+
+ //initialize 2 domains
+ am_Domain_s domain1, domain2, domain3;
+ am_domainID_t domainID1, domainID2, domainID3;
+
+ domain1.domainID = 0;
+ domain1.name = "domain1";
+ domain1.busname = "domain1bus";
+ domain1.state = DS_CONTROLLED;
+ domain2.domainID = 0;
+ domain2.name = "domain2";
+ domain2.busname = "domain2bus";
+ domain2.state = DS_CONTROLLED;
+ domain3.domainID = 0;
+ domain3.name = "domain3";
+ domain3.busname = "domain3bus";
+ domain3.state = DS_CONTROLLED;
+
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterDomainDB(domain1,domainID1));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterDomainDB(domain2,domainID2));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterDomainDB(domain3,domainID3));
+
+ am_Source_s source, gwSource, gwSource1;
+ am_sourceID_t sourceID, gwSourceID, gwSourceID1;
+
+ source.domainID = domainID1;
+ source.name = "source1";
+ source.sourceState = SS_ON;
+ source.sourceID = 0;
+ source.sourceClassID = 5;
+ source.listConnectionFormats.push_back(CF_STEREO);
+ source.listConnectionFormats.push_back(CF_MONO);
+
+ gwSource.domainID = domainID2;
+ gwSource.name = "gwsource1";
+ gwSource.sourceState = SS_ON;
+ gwSource.sourceID = 0;
+ gwSource.sourceClassID = 5;
+ gwSource.listConnectionFormats.push_back(CF_ANALOG);
+
+ gwSource1.domainID = domainID3;
+ gwSource1.name = "gwsource2";
+ gwSource1.sourceState = SS_ON;
+ gwSource1.sourceID = 0;
+ gwSource1.sourceClassID = 5;
+ gwSource1.listConnectionFormats.push_back(CF_MONO);
+
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(source,sourceID));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(gwSource,gwSourceID));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(gwSource1,gwSourceID1));
+
+ am_Sink_s sink, gwSink, gwSink1;
+ am_sinkID_t sinkID, gwSinkID, gwSinkID1;
+
+ sink.domainID = domainID3;
+ sink.name = "sink1";
+ sink.sinkID = 0;
+ sink.sinkClassID = 5;
+ sink.muteState = MS_MUTED;
+ sink.listConnectionFormats.push_back(CF_MONO);
+
+ gwSink.domainID = domainID1;
+ gwSink.name = "gwSink";
+ gwSink.sinkID = 0;
+ gwSink.sinkClassID = 5;
+ gwSink.muteState = MS_MUTED;
+ gwSink.listConnectionFormats.push_back(CF_STEREO);
+ gwSink.listConnectionFormats.push_back(CF_MONO);
+
+ gwSink1.domainID = domainID2;
+ gwSink1.name = "gwSink1";
+ gwSink1.sinkID = 0;
+ gwSink1.sinkClassID = 5;
+ gwSink1.muteState = MS_MUTED;
+ gwSink1.listConnectionFormats.push_back(CF_ANALOG);
+
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(sink,sinkID));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(gwSink,gwSinkID));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(gwSink1,gwSinkID1));
+
+ am_Gateway_s gateway, gateway1;
+ am_gatewayID_t gatewayID, gatewayID1;
+
+ gateway.controlDomainID = domainID1;
+ gateway.gatewayID = 0;
+ gateway.sinkID = gwSinkID;
+ gateway.sourceID = gwSourceID;
+ gateway.domainSourceID = domainID2;
+ gateway.domainSinkID = domainID1;
+ gateway.listSinkFormats = gwSink.listConnectionFormats;
+ gateway.listSourceFormats = gwSource.listConnectionFormats;
+ gateway.convertionMatrix.push_back(false);
+ gateway.convertionMatrix.push_back(true);
+ gateway.name = "gateway";
+
+ gateway1.controlDomainID = domainID2;
+ gateway1.gatewayID = 0;
+ gateway1.sinkID = gwSinkID1;
+ gateway1.sourceID = gwSourceID1;
+ gateway1.domainSourceID = domainID3;
+ gateway1.domainSinkID = domainID2;
+ gateway1.listSinkFormats = gwSink1.listConnectionFormats;
+ gateway1.listSourceFormats = gwSource1.listConnectionFormats;
+ gateway1.convertionMatrix.push_back(true);
+ gateway1.name = "gateway";
+
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterGatewayDB(gateway,gatewayID));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterGatewayDB(gateway1,gatewayID1));
+
+ std::vector<am_Route_s> listRoutes;
+ std::vector<am_RoutingElement_s> listRoutingElements;
+ am_RoutingElement_s hopp1;
+ am_RoutingElement_s hopp2;
+ am_RoutingElement_s hopp3;
+
+ hopp1.sourceID = sourceID;
+ hopp1.sinkID = gwSinkID;
+ hopp1.domainID = domainID1;
+ hopp1.connectionFormat = source.listConnectionFormats[1];
+
+ hopp2.sourceID = gwSourceID;
+ hopp2.sinkID = gwSinkID1;
+ hopp2.domainID = domainID2;
+ hopp2.connectionFormat = gwSink1.listConnectionFormats[0];
+
+ hopp3.sourceID = gwSourceID1;
+ hopp3.sinkID = sinkID;
+ hopp3.domainID = domainID3;
+ hopp3.connectionFormat = sink.listConnectionFormats[0];
+
+ listRoutingElements.push_back(hopp1);
+ listRoutingElements.push_back(hopp2);
+ listRoutingElements.push_back(hopp3);
+
+ am_Route_s compareRoute;
+ compareRoute.route = listRoutingElements;
+ compareRoute.sinkID = sinkID;
+ compareRoute.sourceID = sourceID;
+
+ ASSERT_EQ(E_OK, pRouter.getRoute(false,sourceID,sinkID,listRoutes));
+ ASSERT_EQ(1, listRoutes.size());
+ ASSERT_TRUE(pCF.compareRoute(compareRoute,listRoutes[0]));
+}
+
+
+//test that checks 4 domains, one sink and one source but there are 2 routes because there are 2 gateways
+TEST_F(routingTest,simpleRoute4Domains2Routes)
{
- arg3=arg2;
+ EXPECT_CALL(pMockInterface,cbNumberOfSourcesChanged()).Times(5);
+ EXPECT_CALL(pMockInterface,cbNumberOfSinksChanged()).Times(5);
+ EXPECT_CALL(pMockControlInterface,getConnectionFormatChoice(_,_,_,_)).WillRepeatedly(DoAll(returnConnectionFormat(), Return(E_OK)));
+
+ //initialize 2 domains
+ am_Domain_s domain1, domain2, domain3, domain4;
+ am_domainID_t domainID1, domainID2, domainID3, domainID4;
+
+ domain1.domainID = 0;
+ domain1.name = "domain1";
+ domain1.busname = "domain1bus";
+ domain1.state = DS_CONTROLLED;
+ domain2.domainID = 0;
+ domain2.name = "domain2";
+ domain2.busname = "domain2bus";
+ domain2.state = DS_CONTROLLED;
+ domain3.domainID = 0;
+ domain3.name = "domain3";
+ domain3.busname = "domain3bus";
+ domain3.state = DS_CONTROLLED;
+ domain4.domainID = 0;
+ domain4.name = "domain4";
+ domain4.busname = "domain4bus";
+ domain4.state = DS_CONTROLLED;
+
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterDomainDB(domain1,domainID1));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterDomainDB(domain2,domainID2));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterDomainDB(domain3,domainID3));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterDomainDB(domain4,domainID4));
+
+ am_Source_s source, gwSource, gwSource1, gwSource2, gwSource3;
+ am_sourceID_t sourceID, gwSourceID, gwSourceID1, gwSourceID2, gwSourceID3;
+
+ source.domainID = domainID1;
+ source.name = "source1";
+ source.sourceState = SS_ON;
+ source.sourceID = 0;
+ source.sourceClassID = 5;
+ source.listConnectionFormats.push_back(CF_MONO);
+
+ gwSource.domainID = domainID2;
+ gwSource.name = "gwsource1";
+ gwSource.sourceState = SS_ON;
+ gwSource.sourceID = 0;
+ gwSource.sourceClassID = 5;
+ gwSource.listConnectionFormats.push_back(CF_ANALOG);
+
+ gwSource1.domainID = domainID3;
+ gwSource1.name = "gwsource2";
+ gwSource1.sourceState = SS_ON;
+ gwSource1.sourceID = 0;
+ gwSource1.sourceClassID = 5;
+ gwSource1.listConnectionFormats.push_back(CF_MONO);
+
+ gwSource2.domainID = domainID4;
+ gwSource2.name = "gwsource3";
+ gwSource2.sourceState = SS_OFF;
+ gwSource2.sourceID = 0;
+ gwSource2.sourceClassID = 5;
+ gwSource2.listConnectionFormats.push_back(CF_STEREO);
+
+ gwSource3.domainID = domainID3;
+ gwSource3.name = "gwsource4";
+ gwSource3.sourceState = SS_OFF;
+ gwSource3.sourceID = 0;
+ gwSource3.sourceClassID = 5;
+ gwSource3.listConnectionFormats.push_back(CF_MONO);
+
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(source,sourceID));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(gwSource,gwSourceID));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(gwSource1,gwSourceID1));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(gwSource2,gwSourceID2));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(gwSource3,gwSourceID3));
+
+ am_Sink_s sink, gwSink, gwSink1, gwSink2, gwSink3;
+ am_sinkID_t sinkID, gwSinkID, gwSinkID1, gwSinkID2, gwSinkID3;
+
+ gwSink.domainID = domainID1;
+ gwSink.name = "gwSink";
+ gwSink.sinkID = 0;
+ gwSink.sinkClassID = 5;
+ gwSink.muteState = MS_MUTED;
+ gwSink.listConnectionFormats.push_back(CF_MONO);
+
+ gwSink1.domainID = domainID2;
+ gwSink1.name = "gwSink1";
+ gwSink1.sinkID = 0;
+ gwSink1.sinkClassID = 5;
+ gwSink1.muteState = MS_MUTED;
+ gwSink1.listConnectionFormats.push_back(CF_ANALOG);
+
+ gwSink2.domainID = domainID3;
+ gwSink2.name = "gwSink2";
+ gwSink2.sinkID = 0;
+ gwSink2.sinkClassID = 5;
+ gwSink2.muteState = MS_MUTED;
+ gwSink2.listConnectionFormats.push_back(CF_MONO);
+
+ gwSink3.domainID = domainID2;
+ gwSink3.name = "gwSink3";
+ gwSink3.sinkID = 0;
+ gwSink3.sinkClassID = 5;
+ gwSink3.muteState = MS_MUTED;
+ gwSink3.listConnectionFormats.push_back(CF_ANALOG);
+
+ sink.domainID = domainID4;
+ sink.name = "sink1";
+ sink.sinkID = 0;
+ sink.sinkClassID = 5;
+ sink.muteState = MS_MUTED;
+ sink.listConnectionFormats.push_back(CF_STEREO);
+
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(sink,sinkID));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(gwSink,gwSinkID));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(gwSink1,gwSinkID1));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(gwSink2,gwSinkID2));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(gwSink3,gwSinkID3));
+
+ am_Gateway_s gateway, gateway1, gateway2, gateway3;
+ am_gatewayID_t gatewayID, gatewayID1, gatewayID2, gatewayID3;
+
+ gateway.controlDomainID = domainID1;
+ gateway.gatewayID = 0;
+ gateway.sinkID = gwSinkID;
+ gateway.sourceID = gwSourceID;
+ gateway.domainSourceID = domainID2;
+ gateway.domainSinkID = domainID1;
+ gateway.listSinkFormats = gwSink.listConnectionFormats;
+ gateway.listSourceFormats = gwSource.listConnectionFormats;
+ gateway.convertionMatrix.push_back(true);
+ gateway.name = "gateway";
+
+ gateway1.controlDomainID = domainID2;
+ gateway1.gatewayID = 0;
+ gateway1.sinkID = gwSinkID1;
+ gateway1.sourceID = gwSourceID1;
+ gateway1.domainSourceID = domainID3;
+ gateway1.domainSinkID = domainID2;
+ gateway1.listSinkFormats = gwSink1.listConnectionFormats;
+ gateway1.listSourceFormats = gwSource1.listConnectionFormats;
+ gateway1.convertionMatrix.push_back(true);
+ gateway1.name = "gateway1";
+
+ gateway2.controlDomainID = domainID3;
+ gateway2.gatewayID = 0;
+ gateway2.sinkID = gwSinkID2;
+ gateway2.sourceID = gwSourceID2;
+ gateway2.domainSourceID = domainID4;
+ gateway2.domainSinkID = domainID3;
+ gateway2.listSinkFormats = gwSink2.listConnectionFormats;
+ gateway2.listSourceFormats = gwSource2.listConnectionFormats;
+ gateway2.convertionMatrix.push_back(true);
+ gateway2.name = "gateway2";
+
+ gateway3.controlDomainID = domainID2;
+ gateway3.gatewayID = 0;
+ gateway3.sinkID = gwSinkID3;
+ gateway3.sourceID = gwSourceID3;
+ gateway3.domainSourceID = domainID3;
+ gateway3.domainSinkID = domainID2;
+ gateway3.listSinkFormats = gwSink3.listConnectionFormats;
+ gateway3.listSourceFormats = gwSource3.listConnectionFormats;
+ gateway3.convertionMatrix.push_back(true);
+ gateway3.name = "gateway3";
+
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterGatewayDB(gateway,gatewayID));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterGatewayDB(gateway1,gatewayID1));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterGatewayDB(gateway2,gatewayID2));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterGatewayDB(gateway3,gatewayID3));
+
+ std::vector<am_Route_s> listRoutes;
+ std::vector<am_RoutingElement_s> listRoutingElements, listRoutingElements1;
+ am_RoutingElement_s hopp1;
+ am_RoutingElement_s hopp2;
+ am_RoutingElement_s hopp3;
+ am_RoutingElement_s hopp4;
+ am_RoutingElement_s hopp2alt;
+ am_RoutingElement_s hopp3alt;
+
+ hopp1.sourceID = sourceID;
+ hopp1.sinkID = gwSinkID;
+ hopp1.domainID = domainID1;
+ hopp1.connectionFormat = source.listConnectionFormats[0];
+
+ hopp2.sourceID = gwSourceID;
+ hopp2.sinkID = gwSinkID1;
+ hopp2.domainID = domainID2;
+ hopp2.connectionFormat = gwSink1.listConnectionFormats[0];
+
+ hopp3.sourceID = gwSourceID1;
+ hopp3.sinkID = gwSinkID2;
+ hopp3.domainID = domainID3;
+ hopp3.connectionFormat = gwSink2.listConnectionFormats[0];
+
+ hopp4.sourceID = gwSourceID2;
+ hopp4.sinkID = sinkID;
+ hopp4.domainID = domainID4;
+ hopp4.connectionFormat = sink.listConnectionFormats[0];
+
+ hopp2alt.sourceID = gwSourceID;
+ hopp2alt.sinkID = gwSinkID3;
+ hopp2alt.domainID = domainID2;
+ hopp2alt.connectionFormat = gwSink3.listConnectionFormats[0];
+
+ hopp3alt.sourceID = gwSourceID3;
+ hopp3alt.sinkID = gwSinkID2;
+ hopp3alt.domainID = domainID3;
+ hopp3alt.connectionFormat = gwSink2.listConnectionFormats[0];
+
+ listRoutingElements.push_back(hopp1);
+ listRoutingElements.push_back(hopp2);
+ listRoutingElements.push_back(hopp3);
+ listRoutingElements.push_back(hopp4);
+ listRoutingElements1.push_back(hopp1);
+ listRoutingElements1.push_back(hopp2alt);
+ listRoutingElements1.push_back(hopp3alt);
+ listRoutingElements1.push_back(hopp4);
+
+ am_Route_s compareRoute, compareRoute1;
+ compareRoute.route = listRoutingElements;
+ compareRoute.sinkID = sinkID;
+ compareRoute.sourceID = sourceID;
+
+ compareRoute1.route = listRoutingElements1;
+ compareRoute1.sinkID = sinkID;
+ compareRoute1.sourceID = sourceID;
+
+ ASSERT_EQ(E_OK, pRouter.getRoute(false,sourceID,sinkID,listRoutes));
+ ASSERT_EQ(2, listRoutes.size());
+ ASSERT_TRUE(pCF.compareRoute(compareRoute,listRoutes[0]));
+ ASSERT_TRUE(pCF.compareRoute(compareRoute1,listRoutes[1]));
}
//test that checks 3 domains, one sink one source but the connectionformat of third domains do not fit.
@@ -87,7 +787,7 @@ TEST_F(routingTest,simpleRoute3DomainsNoConnection)
{
EXPECT_CALL(pMockInterface,cbNumberOfSourcesChanged()).Times(3);
EXPECT_CALL(pMockInterface,cbNumberOfSinksChanged()).Times(3);
- EXPECT_CALL(pMockControlInterface,getConnectionFormatChoice(_,_,_,_)).WillRepeatedly(DoAll(returnConnectionFormat(),Return(E_OK)));
+ EXPECT_CALL(pMockControlInterface,getConnectionFormatChoice(_,_,_,_)).WillRepeatedly(DoAll(returnConnectionFormat(), Return(E_OK)));
//initialize 2 domains
am_Domain_s domain1, domain2, domain3;
@@ -232,7 +932,7 @@ TEST_F(routingTest,simpleRoute2Domains)
{
EXPECT_CALL(pMockInterface,cbNumberOfSourcesChanged()).Times(2);
EXPECT_CALL(pMockInterface,cbNumberOfSinksChanged()).Times(2);
- EXPECT_CALL(pMockControlInterface,getConnectionFormatChoice(_,_,_,_)).WillRepeatedly(DoAll(returnConnectionFormat(),Return(E_OK)));
+ EXPECT_CALL(pMockControlInterface,getConnectionFormatChoice(_,_,_,_)).WillRepeatedly(DoAll(returnConnectionFormat(), Return(E_OK)));
//initialize 2 domains
am_Domain_s domain1, domain2;
@@ -340,7 +1040,7 @@ TEST_F(routingTest,simpleRoute2DomainsNoMatchConnectionFormats)
{
EXPECT_CALL(pMockInterface,cbNumberOfSourcesChanged()).Times(2);
EXPECT_CALL(pMockInterface,cbNumberOfSinksChanged()).Times(2);
- EXPECT_CALL(pMockControlInterface,getConnectionFormatChoice(_,_,_,_)).WillRepeatedly(DoAll(returnConnectionFormat(),Return(E_OK)));
+ EXPECT_CALL(pMockControlInterface,getConnectionFormatChoice(_,_,_,_)).WillRepeatedly(DoAll(returnConnectionFormat(), Return(E_OK)));
//initialize 2 domains
am_Domain_s domain1, domain2;
@@ -446,7 +1146,7 @@ TEST_F(routingTest,simpleRoute3Domains)
{
EXPECT_CALL(pMockInterface,cbNumberOfSourcesChanged()).Times(3);
EXPECT_CALL(pMockInterface,cbNumberOfSinksChanged()).Times(3);
- EXPECT_CALL(pMockControlInterface,getConnectionFormatChoice(_,_,_,_)).WillRepeatedly(DoAll(returnConnectionFormat(),Return(E_OK)));
+ EXPECT_CALL(pMockControlInterface,getConnectionFormatChoice(_,_,_,_)).WillRepeatedly(DoAll(returnConnectionFormat(), Return(E_OK)));
//initialize 2 domains
am_Domain_s domain1, domain2, domain3;
@@ -588,6 +1288,193 @@ TEST_F(routingTest,simpleRoute3Domains)
ASSERT_TRUE(pCF.compareRoute(compareRoute,listRoutes[0]));
}
+//test that checks 4 domains, one sink and one source.
+TEST_F(routingTest,simpleRoute4Domains)
+{
+ EXPECT_CALL(pMockInterface,cbNumberOfSourcesChanged()).Times(4);
+ EXPECT_CALL(pMockInterface,cbNumberOfSinksChanged()).Times(4);
+ EXPECT_CALL(pMockControlInterface,getConnectionFormatChoice(_,_,_,_)).WillRepeatedly(DoAll(returnConnectionFormat(), Return(E_OK)));
+
+ //initialize 2 domains
+ am_Domain_s domain1, domain2, domain3, domain4;
+ am_domainID_t domainID1, domainID2, domainID3, domainID4;
+
+ domain1.domainID = 0;
+ domain1.name = "domain1";
+ domain1.busname = "domain1bus";
+ domain1.state = DS_CONTROLLED;
+ domain2.domainID = 0;
+ domain2.name = "domain2";
+ domain2.busname = "domain2bus";
+ domain2.state = DS_CONTROLLED;
+ domain3.domainID = 0;
+ domain3.name = "domain3";
+ domain3.busname = "domain3bus";
+ domain3.state = DS_CONTROLLED;
+ domain4.domainID = 0;
+ domain4.name = "domain4";
+ domain4.busname = "domain4bus";
+ domain4.state = DS_CONTROLLED;
+
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterDomainDB(domain1,domainID1));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterDomainDB(domain2,domainID2));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterDomainDB(domain3,domainID3));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterDomainDB(domain4,domainID4));
+
+ am_Source_s source, gwSource, gwSource1, gwSource2;
+ am_sourceID_t sourceID, gwSourceID, gwSourceID1, gwSourceID2;
+
+ source.domainID = domainID1;
+ source.name = "source1";
+ source.sourceState = SS_ON;
+ source.sourceID = 0;
+ source.sourceClassID = 5;
+ source.listConnectionFormats.push_back(CF_MONO);
+
+ gwSource.domainID = domainID2;
+ gwSource.name = "gwsource1";
+ gwSource.sourceState = SS_ON;
+ gwSource.sourceID = 0;
+ gwSource.sourceClassID = 5;
+ gwSource.listConnectionFormats.push_back(CF_ANALOG);
+
+ gwSource1.domainID = domainID3;
+ gwSource1.name = "gwsource2";
+ gwSource1.sourceState = SS_ON;
+ gwSource1.sourceID = 0;
+ gwSource1.sourceClassID = 5;
+ gwSource1.listConnectionFormats.push_back(CF_MONO);
+
+ gwSource2.domainID = domainID4;
+ gwSource2.name = "gwsource3";
+ gwSource2.sourceState = SS_OFF;
+ gwSource2.sourceID = 0;
+ gwSource2.sourceClassID = 5;
+ gwSource2.listConnectionFormats.push_back(CF_STEREO);
+
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(source,sourceID));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(gwSource,gwSourceID));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(gwSource1,gwSourceID1));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(gwSource2,gwSourceID2));
+
+ am_Sink_s sink, gwSink, gwSink1, gwSink2;
+ am_sinkID_t sinkID, gwSinkID, gwSinkID1, gwSinkID2;
+
+ gwSink.domainID = domainID1;
+ gwSink.name = "gwSink";
+ gwSink.sinkID = 0;
+ gwSink.sinkClassID = 5;
+ gwSink.muteState = MS_MUTED;
+ gwSink.listConnectionFormats.push_back(CF_MONO);
+
+ gwSink1.domainID = domainID2;
+ gwSink1.name = "gwSink1";
+ gwSink1.sinkID = 0;
+ gwSink1.sinkClassID = 5;
+ gwSink1.muteState = MS_MUTED;
+ gwSink1.listConnectionFormats.push_back(CF_ANALOG);
+
+ gwSink2.domainID = domainID3;
+ gwSink2.name = "gwSink2";
+ gwSink2.sinkID = 0;
+ gwSink2.sinkClassID = 5;
+ gwSink2.muteState = MS_MUTED;
+ gwSink2.listConnectionFormats.push_back(CF_MONO);
+
+ sink.domainID = domainID4;
+ sink.name = "sink1";
+ sink.sinkID = 0;
+ sink.sinkClassID = 5;
+ sink.muteState = MS_MUTED;
+ sink.listConnectionFormats.push_back(CF_STEREO);
+
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(sink,sinkID));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(gwSink,gwSinkID));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(gwSink1,gwSinkID1));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(gwSink2,gwSinkID2));
+
+ am_Gateway_s gateway, gateway1, gateway2;
+ am_gatewayID_t gatewayID, gatewayID1, gatewayID2;
+
+ gateway.controlDomainID = domainID1;
+ gateway.gatewayID = 0;
+ gateway.sinkID = gwSinkID;
+ gateway.sourceID = gwSourceID;
+ gateway.domainSourceID = domainID2;
+ gateway.domainSinkID = domainID1;
+ gateway.listSinkFormats = gwSink.listConnectionFormats;
+ gateway.listSourceFormats = gwSource.listConnectionFormats;
+ gateway.convertionMatrix.push_back(true);
+ gateway.name = "gateway";
+
+ gateway1.controlDomainID = domainID2;
+ gateway1.gatewayID = 0;
+ gateway1.sinkID = gwSinkID1;
+ gateway1.sourceID = gwSourceID1;
+ gateway1.domainSourceID = domainID3;
+ gateway1.domainSinkID = domainID2;
+ gateway1.listSinkFormats = gwSink1.listConnectionFormats;
+ gateway1.listSourceFormats = gwSource1.listConnectionFormats;
+ gateway1.convertionMatrix.push_back(true);
+ gateway1.name = "gateway1";
+
+ gateway2.controlDomainID = domainID3;
+ gateway2.gatewayID = 0;
+ gateway2.sinkID = gwSinkID2;
+ gateway2.sourceID = gwSourceID2;
+ gateway2.domainSourceID = domainID4;
+ gateway2.domainSinkID = domainID3;
+ gateway2.listSinkFormats = gwSink2.listConnectionFormats;
+ gateway2.listSourceFormats = gwSource2.listConnectionFormats;
+ gateway2.convertionMatrix.push_back(true);
+ gateway2.name = "gateway2";
+
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterGatewayDB(gateway,gatewayID));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterGatewayDB(gateway1,gatewayID1));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterGatewayDB(gateway2,gatewayID2));
+
+ std::vector<am_Route_s> listRoutes;
+ std::vector<am_RoutingElement_s> listRoutingElements;
+ am_RoutingElement_s hopp1;
+ am_RoutingElement_s hopp2;
+ am_RoutingElement_s hopp3;
+ am_RoutingElement_s hopp4;
+
+ hopp1.sourceID = sourceID;
+ hopp1.sinkID = gwSinkID;
+ hopp1.domainID = domainID1;
+ hopp1.connectionFormat = source.listConnectionFormats[0];
+
+ hopp2.sourceID = gwSourceID;
+ hopp2.sinkID = gwSinkID1;
+ hopp2.domainID = domainID2;
+ hopp2.connectionFormat = gwSink1.listConnectionFormats[0];
+
+ hopp3.sourceID = gwSourceID1;
+ hopp3.sinkID = gwSinkID2;
+ hopp3.domainID = domainID3;
+ hopp3.connectionFormat = gwSink2.listConnectionFormats[0];
+
+ hopp4.sourceID = gwSourceID2;
+ hopp4.sinkID = sinkID;
+ hopp4.domainID = domainID4;
+ hopp4.connectionFormat = sink.listConnectionFormats[0];
+
+ listRoutingElements.push_back(hopp1);
+ listRoutingElements.push_back(hopp2);
+ listRoutingElements.push_back(hopp3);
+ listRoutingElements.push_back(hopp4);
+
+ am_Route_s compareRoute;
+ compareRoute.route = listRoutingElements;
+ compareRoute.sinkID = sinkID;
+ compareRoute.sourceID = sourceID;
+
+ ASSERT_EQ(E_OK, pRouter.getRoute(false,sourceID,sinkID,listRoutes));
+ ASSERT_EQ(1, listRoutes.size());
+ ASSERT_TRUE(pCF.compareRoute(compareRoute,listRoutes[0]));
+}
+
int main(int argc, char **argv)
{
::testing::InitGoogleTest(&argc, argv);
diff --git a/AudioManagerDaemon/test/routing/routingTest.h b/AudioManagerDaemon/test/routing/routingTest.h
index 4b6b16b..915c239 100644
--- a/AudioManagerDaemon/test/routing/routingTest.h
+++ b/AudioManagerDaemon/test/routing/routingTest.h
@@ -30,7 +30,6 @@
#include <gtest/gtest.h>
#include <gmock/gmock.h>
-#include <dlt/dlt.h>
#include <algorithm>
#include <string>
#include <vector>
diff --git a/AudioManagerDaemon/test/routingInterface/CMakeLists.txt b/AudioManagerDaemon/test/routingInterface/CMakeLists.txt
index 8d232f6..5b5da3c 100644
--- a/AudioManagerDaemon/test/routingInterface/CMakeLists.txt
+++ b/AudioManagerDaemon/test/routingInterface/CMakeLists.txt
@@ -53,6 +53,7 @@ file(GLOB ROUTING_INTERFACE_SRCS_CXX
"../../src/Router.cpp"
"../../src/ControlSender.cpp"
"../CommonFunctions.cpp"
+ "../../src/DLTWrapper.cpp"
"*.cpp"
)
diff --git a/AudioManagerDaemon/test/routingInterface/routingInterfaceTest.cpp b/AudioManagerDaemon/test/routingInterface/routingInterfaceTest.cpp
index 5adb863..61ca296 100644
--- a/AudioManagerDaemon/test/routingInterface/routingInterfaceTest.cpp
+++ b/AudioManagerDaemon/test/routingInterface/routingInterfaceTest.cpp
@@ -24,12 +24,11 @@
*/
#include "routingInterfaceTest.h"
+#include "DLTWrapper.h"
using namespace am;
using namespace testing;
-DLT_DECLARE_CONTEXT(DLT_CONTEXT)
-
routingInterfaceTest::routingInterfaceTest() :
plistRoutingPluginDirs(), //
plistCommandPluginDirs(), //
@@ -56,15 +55,12 @@ routingInterfaceTest::~routingInterfaceTest()
void routingInterfaceTest::SetUp()
{
- DLT_REGISTER_APP("Rtest", "RoutingInterfacetest");
- DLT_REGISTER_CONTEXT(DLT_CONTEXT, "Main", "Main Context");
- DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("RoutingSendInterface Test started "));
+ logInfo("RoutingSendInterface Test started ");
}
void routingInterfaceTest::TearDown()
{
- DLT_UNREGISTER_CONTEXT(DLT_CONTEXT);
}
TEST_F(routingInterfaceTest,abort)
diff --git a/AudioManagerDaemon/test/routingInterface/routingInterfaceTest.h b/AudioManagerDaemon/test/routingInterface/routingInterfaceTest.h
index 8ad77eb..0608eb4 100644
--- a/AudioManagerDaemon/test/routingInterface/routingInterfaceTest.h
+++ b/AudioManagerDaemon/test/routingInterface/routingInterfaceTest.h
@@ -28,7 +28,6 @@
#include <gtest/gtest.h>
#include <gmock/gmock.h>
-#include <dlt/dlt.h>
#include <algorithm>
#include <string>
#include <vector>
diff --git a/AudioManagerDaemon/test/sockethandler/CMakeLists.txt b/AudioManagerDaemon/test/sockethandler/CMakeLists.txt
index ba1eb80..8858e5a 100644
--- a/AudioManagerDaemon/test/sockethandler/CMakeLists.txt
+++ b/AudioManagerDaemon/test/sockethandler/CMakeLists.txt
@@ -52,6 +52,7 @@ INCLUDE_DIRECTORIES(
file(GLOB Socket_SRCS_CXX
"../../src/SocketHandler.cpp"
+ "../../src/DLTWrapper.cpp"
"*.cpp"
)
diff --git a/AudioManagerDaemon/test/sockethandler/sockethandlerTest.cpp b/AudioManagerDaemon/test/sockethandler/sockethandlerTest.cpp
index 0ac36fa..9165fa2 100644
--- a/AudioManagerDaemon/test/sockethandler/sockethandlerTest.cpp
+++ b/AudioManagerDaemon/test/sockethandler/sockethandlerTest.cpp
@@ -14,15 +14,12 @@
#include <netdb.h>
#include <fcntl.h>
#include <sys/un.h>
-#include <dlt/dlt.h>
#define SOCK_PATH "/tmp/mysock"
using namespace testing;
using namespace am;
-DLT_DECLARE_CONTEXT(AudioManager)
-
sockethandlerTest::sockethandlerTest()
{
}
diff --git a/CHANGELOG b/CHANGELOG
index 5631de8..8f9d952 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,9 +1,18 @@
-commit 002295bee9b1a4b4b97060458be4ab8d4cb43eda
+commit bef6b6f38de4f6b201a1b6ce24855c8894031602
+Author: christian mueller <christian.ei.mueller@bmw.de>
+
+ * fixed non reference in routing interface peeksourceclassID and peeksinkclassID
+ * fixed bug in complexer usage of routing algorithm
+ * added more router tests
+
+commit 58d62c4af578c10375bf9baa946e33f340c42a1f
Author: christian mueller <christian.ei.mueller@bmw.de>
* regenerated EA code based on Conti Feedback.
* changed paths of audiomanagertypes include in generated files
* changed order of parameters in asyncSetSinkSoundProperty / asyncSetSourceSoundProperty / cbTimingInformationChanged to have common style over all interfaces.
+ * changed default include paths for Controller etc...
+ * cleanup of warnings
commit 93c6b1973d59ce225e9cb5d2bcaea7d01c5fda52
Author: christian mueller <christian.ei.mueller@bmw.de>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 275e536..cafcf7a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -123,8 +123,8 @@ IF(WITH_DOCUMENTATION)
ENDIF(WITH_DOCUMENTATION)
##global build flags set(CPACK_RPM_COMPONENT_INSTALL ON)
-#set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -Wextra -std=c++98 -D_GNU_SOURCE -pedantic -Wno-variadic-macros")
-set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -Wextra -std=c++98 -D_GNU_SOURCE")
+set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -Wextra -std=c++98 -D_GNU_SOURCE -pedantic -Wno-variadic-macros")
+#set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -Wextra -std=c++98 -D_GNU_SOURCE")
if(WITH_PLUGIN_COMMAND)
add_subdirectory (PluginCommandInterfaceDbus)
diff --git a/PluginCommandInterfaceDbus/CMakeLists.txt b/PluginCommandInterfaceDbus/CMakeLists.txt
index 33e22fd..372def5 100644
--- a/PluginCommandInterfaceDbus/CMakeLists.txt
+++ b/PluginCommandInterfaceDbus/CMakeLists.txt
@@ -2,8 +2,6 @@ cmake_minimum_required(VERSION 2.6)
PROJECT(PluginCommandInterfaceDbus)
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -DDLT_CONTEXT=CommandPluginDbus")
-
set(LIBRARY_OUTPUT_PATH ${PLUGINS_OUTPUT_PATH}/command)
set(DOC_OUTPUT_PATH ${DOC_OUTPUT_PATH}/CommandDBusPlugin)
set(INCLUDES_FOLDER "include")
@@ -34,7 +32,6 @@ SET_TARGET_PROPERTIES(PluginCommandInterfaceDbus PROPERTIES
SOVERSION "${LIB_INTERFACE_VERSION}"
)
-
TARGET_LINK_LIBRARIES(PluginCommandInterfaceDbus
${DLT_LIBRARIES}
${DBUS_LIBRARY}
diff --git a/PluginCommandInterfaceDbus/include/CommandReceiverShadow.h b/PluginCommandInterfaceDbus/include/CommandReceiverShadow.h
index ab09bf1..d2c63cb 100644
--- a/PluginCommandInterfaceDbus/include/CommandReceiverShadow.h
+++ b/PluginCommandInterfaceDbus/include/CommandReceiverShadow.h
@@ -30,7 +30,6 @@
#include <command/CommandReceiveInterface.h>
#include <dbus/DBusWrapper.h>
#include <dbus/dbus.h>
-#include <dlt/dlt.h>
#include <map>
#include "DBusMessageHandler.h"
diff --git a/PluginCommandInterfaceDbus/include/DBusCommandSender.h b/PluginCommandInterfaceDbus/include/DBusCommandSender.h
index 215a9e9..05952f5 100644
--- a/PluginCommandInterfaceDbus/include/DBusCommandSender.h
+++ b/PluginCommandInterfaceDbus/include/DBusCommandSender.h
@@ -79,6 +79,7 @@ private:
DBusWrapper* mDBusWrapper;
CommandReceiveInterface* mCommandReceiveInterface;
+
/**
* list of sinks, needed to send out only deltas
*/
diff --git a/PluginCommandInterfaceDbus/include/DBusMessageHandler.h b/PluginCommandInterfaceDbus/include/DBusMessageHandler.h
index 73989bb..71a4078 100644
--- a/PluginCommandInterfaceDbus/include/DBusMessageHandler.h
+++ b/PluginCommandInterfaceDbus/include/DBusMessageHandler.h
@@ -28,7 +28,6 @@
#include <audiomanagertypes.h>
#include <dbus/dbus.h>
-#include <dlt/dlt.h>
#include <vector>
#include <sstream>
#include <string>
diff --git a/PluginCommandInterfaceDbus/src/CommandReceiverShadow.cpp b/PluginCommandInterfaceDbus/src/CommandReceiverShadow.cpp
index 5336626..b1da840 100644
--- a/PluginCommandInterfaceDbus/src/CommandReceiverShadow.cpp
+++ b/PluginCommandInterfaceDbus/src/CommandReceiverShadow.cpp
@@ -29,10 +29,11 @@
#include <assert.h>
#include "CommandReceiverShadow.h"
#include "DBusCommandSender.h"
+#include "DLTWrapper.h"
using namespace am;
-DLT_IMPORT_CONTEXT(DLT_CONTEXT)
+DLT_IMPORT_CONTEXT(commandDbus)
/**
* static ObjectPathTable is needed for DBus Callback handling
@@ -45,17 +46,17 @@ CommandReceiverShadow::CommandReceiverShadow() :
mFunctionMap(createMap()), //
mDBUSMessageHandler()
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("CommandReceiverShadow constructed"));
+ log(&commandDbus,DLT_LOG_INFO,"CommandReceiverShadow constructed");
}
CommandReceiverShadow::~CommandReceiverShadow()
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("CommandReceiverShadow destructed"));
+ log(&commandDbus,DLT_LOG_INFO,"CommandReceiverShadow destructed");
}
void CommandReceiverShadow::connect(DBusConnection *conn, DBusMessage *msg)
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("CommandReceiverShadow::connect called"));
+ log(&commandDbus,DLT_LOG_INFO,"CommandReceiverShadow::connect called");
(void) conn;
assert(mCommandReceiveInterface!=NULL);
@@ -73,7 +74,7 @@ void CommandReceiverShadow::connect(DBusConnection *conn, DBusMessage *msg)
void CommandReceiverShadow::disconnect(DBusConnection *conn, DBusMessage *msg)
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("CommandReceiverShadow::disconnect called"));
+ log(&commandDbus,DLT_LOG_INFO,"CommandReceiverShadow::disconnect called");
(void) conn;
assert(mCommandReceiveInterface!=NULL);
@@ -88,7 +89,7 @@ void CommandReceiverShadow::disconnect(DBusConnection *conn, DBusMessage *msg)
void CommandReceiverShadow::setVolume(DBusConnection *conn, DBusMessage *msg)
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("CommandReceiverShadow::setVolume called"));
+ log(&commandDbus,DLT_LOG_INFO,"CommandReceiverShadow::setVolume called");
(void) conn;
assert(mCommandReceiveInterface!=NULL);
@@ -104,7 +105,7 @@ void CommandReceiverShadow::setVolume(DBusConnection *conn, DBusMessage *msg)
void CommandReceiverShadow::volumeStep(DBusConnection *conn, DBusMessage *msg)
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("CommandReceiverShadow::volumeStep called"));
+ log(&commandDbus,DLT_LOG_INFO,"CommandReceiverShadow::volumeStep called");
(void) conn;
assert(mCommandReceiveInterface!=NULL);
@@ -120,7 +121,7 @@ void CommandReceiverShadow::volumeStep(DBusConnection *conn, DBusMessage *msg)
void CommandReceiverShadow::setSinkMuteState(DBusConnection *conn, DBusMessage *msg)
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("CommandReceiverShadow::setSinkMuteState called"));
+ log(&commandDbus,DLT_LOG_INFO,"CommandReceiverShadow::setSinkMuteState called");
(void) conn;
assert(mCommandReceiveInterface!=NULL);
@@ -136,7 +137,7 @@ void CommandReceiverShadow::setSinkMuteState(DBusConnection *conn, DBusMessage *
void CommandReceiverShadow::setMainSinkSoundProperty(DBusConnection *conn, DBusMessage *msg)
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("CommandReceiverShadow::setMainSinkSoundProperty called"));
+ log(&commandDbus,DLT_LOG_INFO,"CommandReceiverShadow::setMainSinkSoundProperty called");
(void) conn;
assert(mCommandReceiveInterface!=NULL);
@@ -157,7 +158,7 @@ void CommandReceiverShadow::setMainSinkSoundProperty(DBusConnection *conn, DBusM
void CommandReceiverShadow::setMainSourceSoundProperty(DBusConnection *conn, DBusMessage *msg)
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("CommandReceiverShadow::setMainSourceSoundProperty called"));
+ log(&commandDbus,DLT_LOG_INFO,"CommandReceiverShadow::setMainSourceSoundProperty called");
(void) conn;
assert(mCommandReceiveInterface!=NULL);
@@ -178,7 +179,7 @@ void CommandReceiverShadow::setMainSourceSoundProperty(DBusConnection *conn, DBu
void CommandReceiverShadow::setSystemProperty(DBusConnection *conn, DBusMessage *msg)
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("CommandReceiverShadow::setSystemProperty called"));
+ log(&commandDbus,DLT_LOG_INFO,"CommandReceiverShadow::setSystemProperty called");
(void) conn;
assert(mCommandReceiveInterface!=NULL);
@@ -198,7 +199,7 @@ void CommandReceiverShadow::setSystemProperty(DBusConnection *conn, DBusMessage
void CommandReceiverShadow::getListMainConnections(DBusConnection *conn, DBusMessage *msg)
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("CommandReceiverShadow::getListMainConnections called"));
+ log(&commandDbus,DLT_LOG_INFO,"CommandReceiverShadow::getListMainConnections called");
(void) conn;
assert(mCommandReceiveInterface!=NULL);
@@ -212,7 +213,7 @@ void CommandReceiverShadow::getListMainConnections(DBusConnection *conn, DBusMes
void CommandReceiverShadow::getListMainSinks(DBusConnection *conn, DBusMessage *msg)
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("CommandReceiverShadow::getListMainSinks called"));
+ log(&commandDbus,DLT_LOG_INFO,"CommandReceiverShadow::getListMainSinks called");
(void) conn;
assert(mCommandReceiveInterface!=NULL);
@@ -226,7 +227,7 @@ void CommandReceiverShadow::getListMainSinks(DBusConnection *conn, DBusMessage *
void CommandReceiverShadow::getListMainSources(DBusConnection *conn, DBusMessage *msg)
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("CommandReceiverShadow::getListMainSources called"));
+ log(&commandDbus,DLT_LOG_INFO,"CommandReceiverShadow::getListMainSources called");
(void) conn;
assert(mCommandReceiveInterface!=NULL);
@@ -240,7 +241,7 @@ void CommandReceiverShadow::getListMainSources(DBusConnection *conn, DBusMessage
void CommandReceiverShadow::getListMainSinkSoundProperties(DBusConnection *conn, DBusMessage *msg)
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("CommandReceiverShadow::getListMainSinkSoundProperties called"));
+ log(&commandDbus,DLT_LOG_INFO,"CommandReceiverShadow::getListMainSinkSoundProperties called");
(void) conn;
assert(mCommandReceiveInterface!=NULL);
@@ -257,7 +258,7 @@ void CommandReceiverShadow::getListMainSinkSoundProperties(DBusConnection *conn,
void CommandReceiverShadow::getListMainSourceSoundProperties(DBusConnection *conn, DBusMessage *msg)
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("CommandReceiverShadow::getListMainSourceSoundProperties called"));
+ log(&commandDbus,DLT_LOG_INFO,"CommandReceiverShadow::getListMainSourceSoundProperties called");
(void) conn;
assert(mCommandReceiveInterface!=NULL);
@@ -274,7 +275,7 @@ void CommandReceiverShadow::getListMainSourceSoundProperties(DBusConnection *con
void CommandReceiverShadow::getListSourceClasses(DBusConnection *conn, DBusMessage *msg)
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("CommandReceiverShadow::getListSourceClasses called"));
+ log(&commandDbus,DLT_LOG_INFO,"CommandReceiverShadow::getListSourceClasses called");
(void) conn;
assert(mCommandReceiveInterface!=NULL);
@@ -288,7 +289,7 @@ void CommandReceiverShadow::getListSourceClasses(DBusConnection *conn, DBusMessa
void CommandReceiverShadow::getListSinkClasses(DBusConnection *conn, DBusMessage *msg)
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("CommandReceiverShadow::getListSinkClasses called"));
+ log(&commandDbus,DLT_LOG_INFO,"CommandReceiverShadow::getListSinkClasses called");
(void) conn;
assert(mCommandReceiveInterface!=NULL);
@@ -302,7 +303,7 @@ void CommandReceiverShadow::getListSinkClasses(DBusConnection *conn, DBusMessage
void CommandReceiverShadow::getListSystemProperties(DBusConnection *conn, DBusMessage *msg)
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("CommandReceiverShadow::getListSystemProperties called"));
+ log(&commandDbus,DLT_LOG_INFO,"CommandReceiverShadow::getListSystemProperties called");
(void) conn;
assert(mCommandReceiveInterface!=NULL);
@@ -316,7 +317,7 @@ void CommandReceiverShadow::getListSystemProperties(DBusConnection *conn, DBusMe
void CommandReceiverShadow::getTimingInformation(DBusConnection *conn, DBusMessage *msg)
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("CommandReceiverShadow::getTimingInformation called"));
+ log(&commandDbus,DLT_LOG_INFO,"CommandReceiverShadow::getTimingInformation called");
(void) conn;
assert(mCommandReceiveInterface!=NULL);
diff --git a/PluginCommandInterfaceDbus/src/DBusCommandSender.cpp b/PluginCommandInterfaceDbus/src/DBusCommandSender.cpp
index 3c1afd6..53022de 100644
--- a/PluginCommandInterfaceDbus/src/DBusCommandSender.cpp
+++ b/PluginCommandInterfaceDbus/src/DBusCommandSender.cpp
@@ -27,16 +27,16 @@
#include <dbus/DBusWrapper.h>
#include "DBusCommandSender.h"
#include "DBusMessageHandler.h"
-#include <dlt/dlt.h>
+#include "DLTWrapper.h"
#include <algorithm>
#include <string>
#include <vector>
#include <assert.h>
#include <set>
-using namespace am;
+DLT_DECLARE_CONTEXT(commandDbus)
-DLT_DECLARE_CONTEXT(DLT_CONTEXT)
+using namespace am;
/**
* factory for plugin loading
@@ -60,19 +60,19 @@ DbusCommandSender::DbusCommandSender() :
mDBusWrapper(NULL), //
mCommandReceiveInterface(NULL)
{
- DLT_REGISTER_CONTEXT(DLT_CONTEXT, "DBP", "DBus Plugin");
- DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("DbusCommandSender constructed"));
+ DLTWrapper::instance()->registerContext(commandDbus, "DBP", "DBus Plugin");
+ log(&commandDbus, DLT_LOG_INFO, "DbusCommandSender constructor called");
}
DbusCommandSender::~DbusCommandSender()
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("DbusCommandSender destructed"));
- DLT_UNREGISTER_CONTEXT(DLT_CONTEXT);
+ log(&commandDbus, DLT_LOG_INFO, "DbusCommandSender destructed");
+ DLTWrapper::instance()->unregisterContext(commandDbus);
}
am_Error_e DbusCommandSender::startupInterface(CommandReceiveInterface* commandreceiveinterface)
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("startupInterface called"));
+ log(&commandDbus, DLT_LOG_INFO, "startupInterface called");
mCommandReceiveInterface = commandreceiveinterface;
mCommandReceiverShadow.setCommandReceiver(mCommandReceiveInterface);
@@ -83,7 +83,7 @@ am_Error_e DbusCommandSender::startupInterface(CommandReceiveInterface* commandr
am_Error_e DbusCommandSender::stopInterface()
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("stopInterface called"));
+ log(&commandDbus, DLT_LOG_INFO, "stopInterface called");
/**
* todo: finish DbusCommandSender::stopInterface(), what needs to be done?
*/
@@ -92,7 +92,7 @@ am_Error_e DbusCommandSender::stopInterface()
am_Error_e DbusCommandSender::cbCommunicationReady()
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("cbCommunicationReady called"));
+ log(&commandDbus, DLT_LOG_INFO, "cbCommunicationReady called");
/**
* todo: implement DbusCommandSender::cbCommunicationReady()
*/
@@ -101,7 +101,7 @@ am_Error_e DbusCommandSender::cbCommunicationReady()
am_Error_e DbusCommandSender::cbCommunicationRundown()
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("cbCommunicationRundown called"));
+ log(&commandDbus, DLT_LOG_INFO, "cbCommunicationRundown called");
/**
* todo: implement DbusCommandSender::cbCommunicationRundown()
*/
@@ -110,7 +110,7 @@ am_Error_e DbusCommandSender::cbCommunicationRundown()
void DbusCommandSender::cbNumberOfMainConnectionsChanged()
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("cbNumberOfMainConnectionsChanged called"));
+ log(&commandDbus, DLT_LOG_INFO, "cbNumberOfMainConnectionsChanged called");
mDBUSMessageHandler.initSignal(std::string(MY_NODE), std::string("NumberOfMainConnectionsChanged"));
mDBUSMessageHandler.sendMessage();
@@ -118,7 +118,7 @@ void DbusCommandSender::cbNumberOfMainConnectionsChanged()
void DbusCommandSender::cbNumberOfSinksChanged()
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("cbNumberOfSinksChanged called"));
+ log(&commandDbus, DLT_LOG_INFO, "cbNumberOfSinksChanged called");
std::vector<am_SinkType_s> newListSinks;
std::vector<am_SinkType_s> diffList;
@@ -131,14 +131,14 @@ void DbusCommandSender::cbNumberOfSinksChanged()
mDBUSMessageHandler.initSignal(std::string(MY_NODE), "SinkAdded");
mDBUSMessageHandler.append(diffList[0]);
- DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("send signal SinkAdded"));
+ log(&commandDbus, DLT_LOG_INFO, "send signal SinkAdded");
}
else
{
mDBUSMessageHandler.initSignal(std::string(MY_NODE), "SinkRemoved");
mDBUSMessageHandler.append(diffList.begin()->sinkID);
- DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("send signal SinkRemoved"));
+ log(&commandDbus, DLT_LOG_INFO, "send signal SinkRemoved");
}
mDBUSMessageHandler.sendMessage();
@@ -147,7 +147,7 @@ void DbusCommandSender::cbNumberOfSinksChanged()
void DbusCommandSender::cbNumberOfSourcesChanged()
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("cbNumberOfSourcesChanged called"));
+ log(&commandDbus, DLT_LOG_INFO, "cbNumberOfSourcesChanged called");
std::vector<am_SourceType_s> newlistSources;
std::vector<am_SourceType_s> diffList;
@@ -160,14 +160,14 @@ void DbusCommandSender::cbNumberOfSourcesChanged()
mDBUSMessageHandler.initSignal(std::string(MY_NODE), "SourceAdded");
mDBUSMessageHandler.append(diffList[0]);
- DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("send signal SourceAdded"));
+ log(&commandDbus, DLT_LOG_INFO, "send signal SourceAdded");
}
else
{
mDBUSMessageHandler.initSignal(std::string(MY_NODE), "SourceRemoved");
mDBUSMessageHandler.append((dbus_uint16_t) diffList.begin()->sourceID);
- DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("send signal SourceRemoved"));
+ log(&commandDbus, DLT_LOG_INFO, "send signal SourceRemoved");
}
mDBUSMessageHandler.sendMessage();
@@ -176,7 +176,7 @@ void DbusCommandSender::cbNumberOfSourcesChanged()
void DbusCommandSender::cbNumberOfSinkClassesChanged()
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("cbNumberOfSinkClassesChanged called"));
+ log(&commandDbus, DLT_LOG_INFO, "cbNumberOfSinkClassesChanged called");
mDBUSMessageHandler.initSignal(std::string(MY_NODE), std::string("NumberOfSinkClassesChanged"));
mDBUSMessageHandler.sendMessage();
@@ -184,7 +184,7 @@ void DbusCommandSender::cbNumberOfSinkClassesChanged()
void DbusCommandSender::cbNumberOfSourceClassesChanged()
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("cbNumberOfSourceClassesChanged called"));
+ log(&commandDbus, DLT_LOG_INFO, "cbNumberOfSourceClassesChanged called");
mDBUSMessageHandler.initSignal(std::string(MY_NODE), std::string("NumberOfSourceClassesChanged"));
mDBUSMessageHandler.sendMessage();
@@ -192,7 +192,7 @@ void DbusCommandSender::cbNumberOfSourceClassesChanged()
void DbusCommandSender::cbMainConnectionStateChanged(const am_mainConnectionID_t connectionID, const am_ConnectionState_e connectionState)
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("cbMainConnectionStateChanged called, connectionID"), DLT_INT16(connectionID), DLT_STRING("connectionState"), DLT_INT16(connectionState));
+ log(&commandDbus, DLT_LOG_INFO, "cbMainConnectionStateChanged called, connectionID=", connectionID, "connectionState=", connectionState);
mDBUSMessageHandler.initSignal(std::string(MY_NODE), std::string("MainConnectionStateChanged"));
mDBUSMessageHandler.append((dbus_uint16_t) connectionID);
@@ -202,7 +202,7 @@ void DbusCommandSender::cbMainConnectionStateChanged(const am_mainConnectionID_t
void DbusCommandSender::cbMainSinkSoundPropertyChanged(const am_sinkID_t sinkID, const am_MainSoundProperty_s SoundProperty)
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("cbMainSinkSoundPropertyChanged called, sinkID"), DLT_INT16(sinkID), DLT_STRING("SoundProperty.type"), DLT_INT16(SoundProperty.type), DLT_STRING("SoundProperty.value"), DLT_INT16(SoundProperty.value));
+ log(&commandDbus, DLT_LOG_INFO, "cbMainSinkSoundPropertyChanged called, sinkID", sinkID, "SoundProperty.type", SoundProperty.type, "SoundProperty.value", SoundProperty.value);
mDBUSMessageHandler.initSignal(std::string(MY_NODE), std::string("MainSinkSoundPropertyChanged"));
mDBUSMessageHandler.append((dbus_uint16_t) sinkID);
@@ -212,7 +212,7 @@ void DbusCommandSender::cbMainSinkSoundPropertyChanged(const am_sinkID_t sinkID,
void DbusCommandSender::cbMainSourceSoundPropertyChanged(const am_sourceID_t sourceID, const am_MainSoundProperty_s & SoundProperty)
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("cbMainSourceSoundPropertyChanged called, sourceID"), DLT_INT16(sourceID), DLT_STRING("SoundProperty.type"), DLT_INT16(SoundProperty.type), DLT_STRING("SoundProperty.value"), DLT_INT16(SoundProperty.value));
+ log(&commandDbus, DLT_LOG_INFO, "cbMainSourceSoundPropertyChanged called, sourceID", sourceID, "SoundProperty.type", SoundProperty.type, "SoundProperty.value", SoundProperty.value);
mDBUSMessageHandler.initSignal(std::string(MY_NODE), std::string("MainSourceSoundPropertyChanged"));
mDBUSMessageHandler.append((dbus_uint16_t) sourceID);
@@ -222,7 +222,7 @@ void DbusCommandSender::cbMainSourceSoundPropertyChanged(const am_sourceID_t sou
void DbusCommandSender::cbSinkAvailabilityChanged(const am_sinkID_t sinkID, const am_Availability_s & availability)
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("cbSinkAvailabilityChanged called, sinkID"), DLT_INT16(sinkID), DLT_STRING("availability.availability"), DLT_INT16(availability.availability), DLT_STRING("SoundProperty.reason"), DLT_INT16(availability.availabilityReason));
+ log(&commandDbus, DLT_LOG_INFO, "cbSinkAvailabilityChanged called, sinkID", sinkID, "availability.availability", availability.availability, "SoundProperty.reason", availability.availabilityReason);
mDBUSMessageHandler.initSignal(std::string(MY_NODE), std::string("SinkAvailabilityChanged"));
mDBUSMessageHandler.append((dbus_uint16_t) sinkID);
@@ -232,7 +232,7 @@ void DbusCommandSender::cbSinkAvailabilityChanged(const am_sinkID_t sinkID, cons
void DbusCommandSender::cbSourceAvailabilityChanged(const am_sourceID_t sourceID, const am_Availability_s & availability)
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("cbSourceAvailabilityChanged called, sourceID"), DLT_INT16(sourceID), DLT_STRING("availability.availability"), DLT_INT16(availability.availability), DLT_STRING("SoundProperty.reason"), DLT_INT16(availability.availabilityReason));
+ log(&commandDbus, DLT_LOG_INFO, "cbSourceAvailabilityChanged called, sourceID", sourceID, "availability.availability", availability.availability, "SoundProperty.reason", availability.availabilityReason);
mDBUSMessageHandler.initSignal(std::string(MY_NODE), std::string("SourceAvailabilityChanged"));
mDBUSMessageHandler.append((dbus_uint16_t) sourceID);
@@ -242,7 +242,7 @@ void DbusCommandSender::cbSourceAvailabilityChanged(const am_sourceID_t sourceID
void DbusCommandSender::cbVolumeChanged(const am_sinkID_t sinkID, const am_mainVolume_t volume)
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("cbVolumeChanged called, sinkID"), DLT_INT16(sinkID), DLT_STRING("volume"), DLT_INT16(volume));
+ log(&commandDbus, DLT_LOG_INFO, "cbVolumeChanged called, sinkID", sinkID, "volume", volume);
mDBUSMessageHandler.initSignal(std::string(MY_NODE), std::string("VolumeChanged"));
mDBUSMessageHandler.append((dbus_uint16_t) sinkID);
@@ -252,7 +252,7 @@ void DbusCommandSender::cbVolumeChanged(const am_sinkID_t sinkID, const am_mainV
void DbusCommandSender::cbSinkMuteStateChanged(const am_sinkID_t sinkID, const am_MuteState_e muteState)
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("cbSinkMuteStateChanged called, sinkID"), DLT_INT16(sinkID), DLT_STRING("muteState"), DLT_INT16(muteState));
+ log(&commandDbus, DLT_LOG_INFO, "cbSinkMuteStateChanged called, sinkID", sinkID, "muteState", muteState);
mDBUSMessageHandler.initSignal(std::string(MY_NODE), std::string("SinkMuteStateChanged"));
mDBUSMessageHandler.append((dbus_uint16_t) sinkID);
@@ -262,7 +262,7 @@ void DbusCommandSender::cbSinkMuteStateChanged(const am_sinkID_t sinkID, const a
void DbusCommandSender::cbSystemPropertyChanged(const am_SystemProperty_s & SystemProperty)
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("cbSystemPropertyChanged called, SystemProperty.type"), DLT_INT16(SystemProperty.type), DLT_STRING("SystemProperty.value"), DLT_INT16(SystemProperty.value));
+ log(&commandDbus, DLT_LOG_INFO, "cbSystemPropertyChanged called, SystemProperty.type", SystemProperty.type, "SystemProperty.value", SystemProperty.value);
mDBUSMessageHandler.initSignal(std::string(MY_NODE), std::string("SystemPropertyChanged"));
mDBUSMessageHandler.append(SystemProperty);
@@ -271,7 +271,7 @@ void DbusCommandSender::cbSystemPropertyChanged(const am_SystemProperty_s & Syst
void am::DbusCommandSender::cbTimingInformationChanged(const am_mainConnectionID_t mainConnectionID, const am_timeSync_t time)
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("cbTimingInformationChanged called, mainConnectionID"), DLT_INT16(mainConnectionID), DLT_STRING("time"), DLT_INT16(time));
+ log(&commandDbus, DLT_LOG_INFO, "cbTimingInformationChanged called, mainConnectionID=", mainConnectionID, "time=", time);
mDBUSMessageHandler.initSignal(std::string(MY_NODE), std::string("TimingInformationChanged"));
mDBUSMessageHandler.append((dbus_uint16_t) mainConnectionID);
diff --git a/PluginCommandInterfaceDbus/src/DBusMessageHandler.cpp b/PluginCommandInterfaceDbus/src/DBusMessageHandler.cpp
index d6f2ee1..66e216b 100644
--- a/PluginCommandInterfaceDbus/src/DBusMessageHandler.cpp
+++ b/PluginCommandInterfaceDbus/src/DBusMessageHandler.cpp
@@ -25,14 +25,14 @@
#include <config.h>
#include "DBusMessageHandler.h"
#include "DBusCommandSender.h"
-
+#include "DLTWrapper.h"
#include <stdlib.h>
#include <assert.h>
#include <vector>
-using namespace am;
+DLT_IMPORT_CONTEXT(commandDbus)
-DLT_IMPORT_CONTEXT(DLT_CONTEXT)
+using namespace am;
DBusMessageHandler::DBusMessageHandler() :
mDBusMessageIter(), //
@@ -44,12 +44,12 @@ DBusMessageHandler::DBusMessageHandler() :
mReveiveMessage(NULL), //
mDBusConnection(NULL)
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("DBUSMessageHandler constructed"));
+ log(&commandDbus, DLT_LOG_INFO, "DBusMessageHandler constructed");
}
DBusMessageHandler::~DBusMessageHandler()
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("DBUSMessageHandler destructed"));
+ log(&commandDbus, DLT_LOG_INFO, "DBUSMessageHandler destructed");
}
void DBusMessageHandler::initReceive(DBusMessage* msg)
@@ -58,7 +58,7 @@ void DBusMessageHandler::initReceive(DBusMessage* msg)
mReveiveMessage = msg;
if (!dbus_message_iter_init(msg, &mDBusMessageIter))
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::initReceive DBus Message has no arguments!"));
+ log(&commandDbus, DLT_LOG_INFO, "DBusMessageHandler::initReceive DBus Message has no arguments!");
mErrorName = std::string(DBUS_ERROR_INVALID_ARGS);
mErrorMsg = "DBUS Message has no arguments!";
}
@@ -70,7 +70,7 @@ void DBusMessageHandler::initReply(DBusMessage* msg)
mDbusMessage = dbus_message_new_method_return(msg);
if (mDbusMessage == NULL)
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::initReply Cannot allocate DBus message!"));
+ log(&commandDbus, DLT_LOG_ERROR, "DBusMessageHandler::initReply Cannot allocate DBus message!");
mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
mErrorMsg = "Cannot create reply!";
}
@@ -86,7 +86,7 @@ void DBusMessageHandler::initSignal(std::string path, std::string signalName)
if (mDbusMessage == NULL)
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::initSignal Cannot allocate DBus message!"));
+ log(&commandDbus, DLT_LOG_ERROR, "DBusMessageHandler::initSignal Cannot allocate DBus message!");
}
dbus_message_iter_init_append(mDbusMessage, &mDBusMessageIter);
}
@@ -108,7 +108,7 @@ void DBusMessageHandler::sendMessage()
}
if (!dbus_connection_send(mDBusConnection, mDbusMessage, &mSerial))
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::sendMessage cannot send message!"));
+ log(&commandDbus, DLT_LOG_ERROR, "DBusMessageHandler::sendMessage cannot send message!");
}
dbus_connection_flush(mDBusConnection);
dbus_message_unref(mDbusMessage);
@@ -121,7 +121,7 @@ char* DBusMessageHandler::getString()
if (DBUS_TYPE_STRING != dbus_message_iter_get_arg_type(&mDBusMessageIter))
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::getString DBUS handler argument is no String!"));
+ log(&commandDbus, DLT_LOG_ERROR, "DBusMessageHandler::getString DBUS handler argument is no String!");
mErrorName = std::string(DBUS_ERROR_INVALID_ARGS);
mErrorMsg = "DBus argument is no string";
}
@@ -139,7 +139,7 @@ dbus_bool_t DBusMessageHandler::getBool()
if (DBUS_TYPE_BOOLEAN != dbus_message_iter_get_arg_type(&mDBusMessageIter))
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::getBool DBUS handler argument is no bool!"));
+ log(&commandDbus, DLT_LOG_ERROR, "DBusMessageHandler::getBool DBUS handler argument is no bool!");
mErrorName = std::string(DBUS_ERROR_INVALID_ARGS);
mErrorMsg = "DBus argument is no bool";
}
@@ -157,7 +157,7 @@ char DBusMessageHandler::getByte()
if (DBUS_TYPE_BYTE != dbus_message_iter_get_arg_type(&mDBusMessageIter))
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::getByte DBUS handler argument is no byte!"));
+ log(&commandDbus, DLT_LOG_ERROR, "DBusMessageHandler::getByte DBUS handler argument is no byte!");
mErrorName = std::string(DBUS_ERROR_INVALID_ARGS);
mErrorMsg = "DBus argument is no byte";
}
@@ -179,7 +179,7 @@ dbus_uint16_t DBusMessageHandler::getUInt()
if (DBUS_TYPE_UINT16 != dbus_message_iter_get_arg_type(&mDBusMessageIter))
#endif
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::getUInt DBUS handler argument is no uint16_t!"));
+ log(&commandDbus, DLT_LOG_ERROR, "DBusMessageHandler::getUInt DBUS handler argument is no uint16_t!");
mErrorName = std::string(DBUS_ERROR_INVALID_ARGS);
mErrorMsg = "DBus argument is no uint16_t";
}
@@ -201,7 +201,7 @@ dbus_int16_t DBusMessageHandler::getInt()
if (DBUS_TYPE_INT16 != dbus_message_iter_get_arg_type(&mDBusMessageIter))
#endif
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::getInt DBUS handler argument is no int16_t!"));
+ log(&commandDbus, DLT_LOG_ERROR, "DBusMessageHandler::getInt DBUS handler argument is no int16_t!");
mErrorName = std::string(DBUS_ERROR_INVALID_ARGS);
mErrorMsg = "DBus argument is no int16_t";
}
@@ -218,7 +218,7 @@ double DBusMessageHandler::getDouble()
double param;
if (DBUS_TYPE_DOUBLE != dbus_message_iter_get_arg_type(&mDBusMessageIter))
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::getDouble DBUS handler argument is no double!"));
+ log(&commandDbus, DLT_LOG_ERROR, "DBusMessageHandler::getDouble DBUS handler argument is no double!");
mErrorName = std::string(DBUS_ERROR_INVALID_ARGS);
mErrorMsg = "DBus argument is no double";
}
@@ -235,7 +235,7 @@ void DBusMessageHandler::getProperty(dbus_int16_t & type, dbus_int16_t & value)
DBusMessageIter arrayIter;
if (DBUS_TYPE_STRUCT != dbus_message_iter_get_arg_type(&mDBusMessageIter))
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::getProperty DBUS handler argument is no array!"));
+ log(&commandDbus, DLT_LOG_ERROR, "DBusMessageHandler::getProperty DBUS handler argument is no array!");
mErrorName = std::string(DBUS_ERROR_INVALID_ARGS);
mErrorMsg = "DBus argument is no array";
}
@@ -254,7 +254,7 @@ void DBusMessageHandler::append(bool toAppend)
dbus_bool_t mybool = toAppend;
if (!dbus_message_iter_append_basic(&mDBusMessageIter, DBUS_TYPE_BOOLEAN, &mybool))
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::append Cannot allocate DBus message!"));
+ log(&commandDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
mErrorMsg = "Cannot create reply!";
}
@@ -264,7 +264,7 @@ void DBusMessageHandler::append(double toAppend)
{
if (!dbus_message_iter_append_basic(&mDBusMessageIter, DBUS_TYPE_DOUBLE, &toAppend))
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::append Cannot allocate DBus message!"));
+ log(&commandDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
mErrorMsg = "Cannot create reply!";
}
@@ -274,7 +274,7 @@ void DBusMessageHandler::append(char toAppend)
{
if (!dbus_message_iter_append_basic(&mDBusMessageIter, DBUS_TYPE_BYTE, &toAppend))
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::append Cannot allocate DBus message!"));
+ log(&commandDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
mErrorMsg = "Cannot create reply!";
}
@@ -284,7 +284,7 @@ void DBusMessageHandler::append(dbus_int16_t toAppend)
{
if (!dbus_message_iter_append_basic(&mDBusMessageIter, DBUS_TYPE_INT16, &toAppend))
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::append Cannot allocate DBus message!"));
+ log(&commandDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
mErrorMsg = "Cannot create reply!";
}
@@ -294,7 +294,7 @@ void DBusMessageHandler::append(dbus_uint16_t toAppend)
{
if (!dbus_message_iter_append_basic(&mDBusMessageIter, DBUS_TYPE_UINT16, &toAppend))
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::append Cannot allocate DBus message!"));
+ log(&commandDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
mErrorMsg = "Cannot create reply!";
}
@@ -327,7 +327,7 @@ void DBusMessageHandler::append(const am::am_SinkType_s& sinkType)
if (!success)
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::append Cannot allocate DBus message!"));
+ log(&commandDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
mErrorMsg = "Cannot create reply!";
}
@@ -352,7 +352,7 @@ void DBusMessageHandler::append(const am::am_SourceType_s & sourceType)
if (!success)
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::append Cannot allocate DBus message!"));
+ log(&commandDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
mErrorMsg = "Cannot create reply!";
}
@@ -369,7 +369,7 @@ void DBusMessageHandler::append(const am::am_MainSoundProperty_s mainSoundProper
if (!success)
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::append Cannot allocate DBus message!"));
+ log(&commandDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
mErrorMsg = "Cannot create reply!";
}
@@ -386,7 +386,7 @@ void DBusMessageHandler::append(const am::am_Availability_s & availability)
if (!success)
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::append Cannot allocate DBus message!"));
+ log(&commandDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
mErrorMsg = "Cannot create reply!";
}
@@ -403,7 +403,7 @@ void DBusMessageHandler::append(const am::am_SystemProperty_s & SystemProperty)
if (!success)
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::append Cannot allocate DBus message!"));
+ log(&commandDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
mErrorMsg = "Cannot create reply!";
}
@@ -431,7 +431,7 @@ void DBusMessageHandler::append(const std::vector<am::am_MainConnectionType_s>&
if (!success)
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::append Cannot allocate DBus message!"));
+ log(&commandDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
mErrorMsg = "Cannot create reply!";
}
@@ -464,7 +464,7 @@ void DBusMessageHandler::append(const std::vector<am::am_SinkType_s> & listMainS
if (!success)
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::append Cannot allocate DBus message!"));
+ log(&commandDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
mErrorMsg = "Cannot create reply!";
}
@@ -495,7 +495,7 @@ void DBusMessageHandler::append(const std::vector<am::am_SourceType_s> & listMai
if (!success)
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::append Cannot allocate DBus message!"));
+ log(&commandDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
mErrorMsg = "Cannot create reply!";
}
@@ -520,7 +520,7 @@ void DBusMessageHandler::append(const std::vector<am::am_MainSoundProperty_s> &
if (!success)
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::append Cannot allocate DBus message!"));
+ log(&commandDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
mErrorMsg = "Cannot create reply!";
}
@@ -558,7 +558,7 @@ void DBusMessageHandler::append(const std::vector<am::am_SourceClass_s> & listSo
if (!success)
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::append Cannot allocate DBus message!"));
+ log(&commandDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
mErrorMsg = "Cannot create reply!";
}
@@ -596,7 +596,7 @@ void DBusMessageHandler::append(const std::vector<am::am_SinkClass_s> & listSink
if (!success)
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::append Cannot allocate DBus message!"));
+ log(&commandDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
mErrorMsg = "Cannot create reply!";
}
@@ -621,7 +621,7 @@ void DBusMessageHandler::append(const std::vector<am::am_SystemProperty_s> & lis
if (!success)
{
- DLT_LOG(DLT_CONTEXT, DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::append Cannot allocate DBus message!"));
+ log(&commandDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!");
mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
mErrorMsg = "Cannot create reply!";
}
diff --git a/PluginCommandInterfaceDbus/test/CMakeLists.txt b/PluginCommandInterfaceDbus/test/CMakeLists.txt
index c3e136b..0c33420 100644
--- a/PluginCommandInterfaceDbus/test/CMakeLists.txt
+++ b/PluginCommandInterfaceDbus/test/CMakeLists.txt
@@ -58,6 +58,7 @@ file(GLOB DBUS_PLUGIN_INTERFACE_SRCS_CXX
"../../AudioManagerDaemon/src/DBusWrapper.cpp"
"../../AudioManagerDaemon/src/CommandSender.cpp"
"../../AudioManagerDaemon/src/SocketHandler.cpp"
+ "../../AudioManagerDaemon/src/DLTWrapper.cpp"
"../src/*.cpp"
"dbuscommandpluginInterfaceTest.cpp"
"DbusCommanInterfaceBackdoor.cpp"
@@ -67,6 +68,7 @@ file(GLOB DBUS_SIGNAL_INTERFACE_SRCS_CXX
"../../AudioManagerDaemon/src/DBusWrapper.cpp"
"../../AudioManagerDaemon/src/CommandSender.cpp"
"../../AudioManagerDaemon/src/SocketHandler.cpp"
+ "../../AudioManagerDaemon/src/DLTWrapper.cpp"
"../src/*.cpp"
"dbuscommaninterfacesignalsTest.cpp"
"DbusCommandInterfaceBackdoor.cpp"
diff --git a/PluginCommandInterfaceDbus/test/dbuscommandpluginInterfaceTest.cpp b/PluginCommandInterfaceDbus/test/dbuscommandpluginInterfaceTest.cpp
index 1ba6a30..8f7c23f 100644
--- a/PluginCommandInterfaceDbus/test/dbuscommandpluginInterfaceTest.cpp
+++ b/PluginCommandInterfaceDbus/test/dbuscommandpluginInterfaceTest.cpp
@@ -32,6 +32,7 @@
#include "../include/DBusMessageHandler.h"
#include "DbusCommandInterfaceBackdoor.h"
#include "MockInterfaces.h"
+#include "DLTWrapper.h"
using namespace am;
using namespace testing;
@@ -49,6 +50,7 @@ void* run_the_loop(void* wrapper)
dbuscommandpluginInterfaceTest::dbuscommandpluginInterfaceTest()
{
+ DLTWrapper::instance()->registerApp("dbusTest","dbusTest");
}
dbuscommandpluginInterfaceTest::~dbuscommandpluginInterfaceTest()
diff --git a/PluginCommandInterfaceDbus/test/dbuscommandpluginInterfaceTest.h b/PluginCommandInterfaceDbus/test/dbuscommandpluginInterfaceTest.h
index d9f1fca..ae2d14b 100644
--- a/PluginCommandInterfaceDbus/test/dbuscommandpluginInterfaceTest.h
+++ b/PluginCommandInterfaceDbus/test/dbuscommandpluginInterfaceTest.h
@@ -29,7 +29,6 @@
#include <gtest/gtest.h>
#include <gmock/gmock.h>
-#include <dlt/dlt.h>
#include <algorithm>
#include <string>
#include <vector>
@@ -39,6 +38,7 @@
#include "MockInterfaces.h"
#include "DbusCommandInterfaceBackdoor.h"
+
#define UNIT_TEST 1
namespace am {
diff --git a/PluginCommandInterfaceDbus/test/dbuscommaninterfacesignalsTest.cpp b/PluginCommandInterfaceDbus/test/dbuscommaninterfacesignalsTest.cpp
index 1c90d55..9b5adb9 100644
--- a/PluginCommandInterfaceDbus/test/dbuscommaninterfacesignalsTest.cpp
+++ b/PluginCommandInterfaceDbus/test/dbuscommaninterfacesignalsTest.cpp
@@ -31,23 +31,20 @@
#include "../include/DBusMessageHandler.h"
#include "DbusCommandInterfaceBackdoor.h"
#include "MockInterfaces.h"
+#include "DLTWrapper.h"
using namespace am;
using namespace testing;
-DLT_IMPORT_CONTEXT(DLT_CONTEXT)
dbuscommaninterfacesignalsTest::dbuscommaninterfacesignalsTest()
{
- DLT_REGISTER_APP("DPtest", "RoutingInterfacetest");
- DLT_REGISTER_CONTEXT(DLT_CONTEXT, "Main", "Main Context");
- DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("RoutingSendInterface Test started "));
-
+ DLTWrapper::instance()->registerApp("dbusTest","dbusTest");
+ logInfo("dbusCommandInterfaceSignalTest started");
}
dbuscommaninterfacesignalsTest::~dbuscommaninterfacesignalsTest()
{
- DLT_UNREGISTER_CONTEXT(DLT_CONTEXT);
}
void* NumberOfMainConnectionsChanged(void*)
diff --git a/PluginCommandInterfaceDbus/test/dbuscommaninterfacesignalsTest.h b/PluginCommandInterfaceDbus/test/dbuscommaninterfacesignalsTest.h
index bd99d04..0f930d6 100644
--- a/PluginCommandInterfaceDbus/test/dbuscommaninterfacesignalsTest.h
+++ b/PluginCommandInterfaceDbus/test/dbuscommaninterfacesignalsTest.h
@@ -27,7 +27,6 @@
#define DBUSCOMMANINTERFACESIGNALSTEST_H_
#include <gtest/gtest.h>
#include <gmock/gmock.h>
-#include <dlt/dlt.h>
#include <algorithm>
#include <string>
#include <vector>
diff --git a/PluginControlInterface/CMakeLists.txt b/PluginControlInterface/CMakeLists.txt
index 89725a0..d61bfdd 100644
--- a/PluginControlInterface/CMakeLists.txt
+++ b/PluginControlInterface/CMakeLists.txt
@@ -2,8 +2,6 @@ cmake_minimum_required(VERSION 2.6)
PROJECT(PluginControlInterface)
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -DDLT_CONTEXT=ControlPluginDbus")
-
set(LIBRARY_OUTPUT_PATH ${PLUGINS_OUTPUT_PATH}/control)
set(DOC_OUTPUT_PATH ${DOC_OUTPUT_PATH}/ControlPlugin)
set(INCLUDES_FOLDER "include")
diff --git a/PluginRoutingInterfaceAsync/include/DltContext.h b/PluginRoutingInterfaceAsync/include/DltContext.h
deleted file mode 100644
index 08372e4..0000000
--- a/PluginRoutingInterfaceAsync/include/DltContext.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
-* Copyright (C) 2011, BMW AG
-*
-* GeniviAudioMananger AudioManagerDaemon
-*
-* \file DltContext.h
-*
-* \date 20-Oct-2011 3:42:04 PM
-* \author Christian Mueller (christian.ei.mueller@bmw.de)
-*
-* \section License
-* GNU Lesser General Public License, version 2.1, with special exception (GENIVI clause)
-* Copyright (C) 2011, BMW AG Christian Mueller Christian.ei.mueller@bmw.de
-*
-* This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License, version 2.1, as published by the Free Software Foundation.
-* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License, version 2.1, for more details.
-* You should have received a copy of the GNU Lesser General Public License, version 2.1, along with this program; if not, see <http://www.gnu.org/licenses/lgpl-2.1.html>.
-* Note that the copyright holders assume that the GNU Lesser General Public License, version 2.1, may also be applicable to programs even in cases in which the program is not a library in the technical sense.
-* Linking AudioManager statically or dynamically with other modules is making a combined work based on AudioManager. You may license such other modules under the GNU Lesser General Public License, version 2.1. If you do not want to license your linked modules under the GNU Lesser General Public License, version 2.1, you may use the program under the following exception.
-* As a special exception, the copyright holders of AudioManager give you permission to combine AudioManager with software programs or libraries that are released under any license unless such a combination is not permitted by the license of such a software program or library. You may copy and distribute such a system following the terms of the GNU Lesser General Public License, version 2.1, including this special exception, for AudioManager and the licenses of the other code concerned.
-* Note that people who make modified versions of AudioManager are not obligated to grant this special exception for their modified versions; it is their choice whether to do so. The GNU Lesser General Public License, version 2.1, gives permission to release a modified version without this exception; this exception also makes it possible to release a modified version which carries forward this exception.
-*
-*/
-#ifndef DLTCONTEXT_H_
-#define DLTCONTEXT_H_
-
-#include <dlt/dlt.h>
-
-DLT_IMPORT_CONTEXT(PluginRoutingAsync)
-
-#endif /* DLTCONTEXT_H_ */
diff --git a/PluginRoutingInterfaceAsync/src/RoutingReceiverAsyncShadow.cpp b/PluginRoutingInterfaceAsync/src/RoutingReceiverAsyncShadow.cpp
index 26655e4..64bfc95 100644
--- a/PluginRoutingInterfaceAsync/src/RoutingReceiverAsyncShadow.cpp
+++ b/PluginRoutingInterfaceAsync/src/RoutingReceiverAsyncShadow.cpp
@@ -23,7 +23,6 @@
*/
#include "RoutingReceiverAsyncShadow.h"
-#include "DltContext.h"
#include <assert.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
@@ -32,6 +31,7 @@
#include <fcntl.h>
#include <sys/un.h>
#include <errno.h>
+#include "DLTWrapper.h"
using namespace am;
@@ -73,7 +73,7 @@ void RoutingReceiverAsyncShadow::ackConnect(const am_Handle_s handle, const am_c
//ok, fire the signal that data needs to be received !
if (write(mPipe[1], &msg.msgID, sizeof(msgID_e)) == -1)
{
- DLT_LOG(PluginRoutingAsync, DLT_LOG_ERROR, DLT_STRING("RoutingReceiverAsyncShadow::ackConnect write failed, error code:"), DLT_STRING(strerror(errno)));
+ logError("RoutingReceiverAsyncShadow::ackConnect write failed, error code:",strerror(errno));
}
}
@@ -97,7 +97,7 @@ void RoutingReceiverAsyncShadow::ackDisconnect(const am_Handle_s handle, const a
//ok, fire the signal that data needs to be received !
if (write(mPipe[1], &msg.msgID, sizeof(msgID_e)) == -1)
{
- DLT_LOG(PluginRoutingAsync, DLT_LOG_ERROR, DLT_STRING("RoutingReceiverAsyncShadow::ackDisconnect write failed, error code:"), DLT_STRING(strerror(errno)));
+ logError("RoutingReceiverAsyncShadow::ackDisconnect write failed, error code:",strerror(errno));
}
}
@@ -121,7 +121,7 @@ void RoutingReceiverAsyncShadow::ackSetSinkVolumeChange(const am_Handle_s handle
//ok, fire the signal that data needs to be received !
if (write(mPipe[1], &msg.msgID, sizeof(msgID_e)) == -1)
{
- DLT_LOG(PluginRoutingAsync, DLT_LOG_ERROR, DLT_STRING("RoutingReceiverAsyncShadow::ackSetSinkVolumeChange write failed, error code:"), DLT_STRING(strerror(errno)));
+ logError("RoutingReceiverAsyncShadow::ackSetSinkVolumeChange write failed, error code:",strerror(errno));
}
}
@@ -145,7 +145,7 @@ void RoutingReceiverAsyncShadow::ackSetSourceVolumeChange(const am_Handle_s hand
//ok, fire the signal that data needs to be received !
if (write(mPipe[1], &msg.msgID, sizeof(msgID_e)) == -1)
{
- DLT_LOG(PluginRoutingAsync, DLT_LOG_ERROR, DLT_STRING("RoutingReceiverAsyncShadow::ackSetSourceVolumeChange write failed, error code:"), DLT_STRING(strerror(errno)));
+ logError("RoutingReceiverAsyncShadow::ackSetSourceVolumeChange write failed, error code:",strerror(errno));
}
}
@@ -168,7 +168,7 @@ void RoutingReceiverAsyncShadow::ackSetSourceState(const am_Handle_s handle, con
//ok, fire the signal that data needs to be received !
if (write(mPipe[1], &msg.msgID, sizeof(msgID_e)) == -1)
{
- DLT_LOG(PluginRoutingAsync, DLT_LOG_ERROR, DLT_STRING("RoutingReceiverAsyncShadow::ackSetSourceState write failed, error code:"), DLT_STRING(strerror(errno)));
+ logError("RoutingReceiverAsyncShadow::ackSetSourceState write failed, error code:",strerror(errno));
}
}
@@ -191,7 +191,7 @@ void RoutingReceiverAsyncShadow::ackSetSinkSoundProperty(const am_Handle_s handl
//ok, fire the signal that data needs to be received !
if (write(mPipe[1], &msg.msgID, sizeof(msgID_e)) == -1)
{
- DLT_LOG(PluginRoutingAsync, DLT_LOG_ERROR, DLT_STRING("RoutingReceiverAsyncShadow::ackSetSinkSoundProperty write failed, error code:"), DLT_STRING(strerror(errno)));
+ logError("RoutingReceiverAsyncShadow::ackSetSinkSoundProperty write failed, error code:",strerror(errno));
}
}
@@ -214,7 +214,7 @@ void RoutingReceiverAsyncShadow::ackSetSourceSoundProperty(const am_Handle_s han
//ok, fire the signal that data needs to be received !
if (write(mPipe[1], &msg.msgID, sizeof(msgID_e)) == -1)
{
- DLT_LOG(PluginRoutingAsync, DLT_LOG_ERROR, DLT_STRING("RoutingReceiverAsyncShadow::ackSetSourceSoundProperty write failed, error code:"), DLT_STRING(strerror(errno)));
+ logError("RoutingReceiverAsyncShadow::ackSetSourceSoundProperty write failed, error code:",strerror(errno));
}
}
@@ -238,7 +238,7 @@ void RoutingReceiverAsyncShadow::ackCrossFading(const am_Handle_s handle, const
//ok, fire the signal that data needs to be received !
if (write(mPipe[1], &msg.msgID, sizeof(msgID_e)) == -1)
{
- DLT_LOG(PluginRoutingAsync, DLT_LOG_ERROR, DLT_STRING("RoutingReceiverAsyncShadow::ackCrossFading write failed, error code:"), DLT_STRING(strerror(errno)));
+ logError("RoutingReceiverAsyncShadow::ackCrossFading write failed, error code:",strerror(errno));
}
}
@@ -262,7 +262,7 @@ void RoutingReceiverAsyncShadow::ackSourceVolumeTick(const am_Handle_s handle, c
//ok, fire the signal that data needs to be received !
if (write(mPipe[1], &msg.msgID, sizeof(msgID_e)) == -1)
{
- DLT_LOG(PluginRoutingAsync, DLT_LOG_ERROR, DLT_STRING("RoutingReceiverAsyncShadow::ackSourceVolumeTick write failed, error code:"), DLT_STRING(strerror(errno)));
+ logError("RoutingReceiverAsyncShadow::ackSourceVolumeTick write failed, error code:",strerror(errno));
}
}
@@ -286,7 +286,7 @@ void RoutingReceiverAsyncShadow::ackSinkVolumeTick(const am_Handle_s handle, con
//ok, fire the signal that data needs to be received !
if (write(mPipe[1], &msg.msgID, sizeof(msgID_e)) == -1)
{
- DLT_LOG(PluginRoutingAsync, DLT_LOG_ERROR, DLT_STRING("RoutingReceiverAsyncShadow::ackSinkVolumeTick write failed, error code:"), DLT_STRING(strerror(errno)));
+ logError("RoutingReceiverAsyncShadow::ackSinkVolumeTick write failed, error code:",strerror(errno));
}
}
@@ -310,7 +310,7 @@ void RoutingReceiverAsyncShadow::hookInterruptStatusChange(const am_sourceID_t s
//ok, fire the signal that data needs to be received !
if (write(mPipe[1], &msg.msgID, sizeof(msgID_e)) == -1)
{
- DLT_LOG(PluginRoutingAsync, DLT_LOG_ERROR, DLT_STRING("RoutingReceiverAsyncShadow::hookInterruptStatusChange write failed, error code:"), DLT_STRING(strerror(errno)));
+ logError("RoutingReceiverAsyncShadow::hookInterruptStatusChange write failed, error code:",strerror(errno));
}
}
@@ -334,7 +334,7 @@ void RoutingReceiverAsyncShadow::hookSinkAvailablityStatusChange(const am_sinkID
//ok, fire the signal that data needs to be received !
if (write(mPipe[1], &msg.msgID, sizeof(msgID_e)) == -1)
{
- DLT_LOG(PluginRoutingAsync, DLT_LOG_ERROR, DLT_STRING("RoutingReceiverAsyncShadow::hookSinkAvailablityStatusChange write failed, error code:"), DLT_STRING(strerror(errno)));
+ logError("RoutingReceiverAsyncShadow::hookSinkAvailablityStatusChange write failed, error code:",strerror(errno));
}
}
@@ -358,7 +358,7 @@ void RoutingReceiverAsyncShadow::hookSourceAvailablityStatusChange(const am_sour
//ok, fire the signal that data needs to be received !
if (write(mPipe[1], &msg.msgID, sizeof(msgID_e)) == -1)
{
- DLT_LOG(PluginRoutingAsync, DLT_LOG_ERROR, DLT_STRING("RoutingReceiverAsyncShadow::hookSourceAvailablityStatusChange write failed, error code:"), DLT_STRING(strerror(errno)));
+ logError("RoutingReceiverAsyncShadow::hookSourceAvailablityStatusChange write failed, error code:",strerror(errno));
}
}
@@ -382,7 +382,7 @@ void RoutingReceiverAsyncShadow::hookDomainStateChange(const am_domainID_t domai
//ok, fire the signal that data needs to be received !
if (write(mPipe[1], &msg.msgID, sizeof(msgID_e)) == -1)
{
- DLT_LOG(PluginRoutingAsync, DLT_LOG_ERROR, DLT_STRING("RoutingReceiverAsyncShadow::hookDomainStateChange write failed, error code:"), DLT_STRING(strerror(errno)));
+ logError("RoutingReceiverAsyncShadow::hookDomainStateChange write failed, error code:",strerror(errno));
}
}
@@ -406,7 +406,7 @@ void RoutingReceiverAsyncShadow::hookTimingInformationChanged(const am_connectio
//ok, fire the signal that data needs to be received !
if (write(mPipe[1], &msg.msgID, sizeof(msgID_e)) == -1)
{
- DLT_LOG(PluginRoutingAsync, DLT_LOG_ERROR, DLT_STRING("RoutingReceiverAsyncShadow::hookTimingInformationChanged write failed, error code:"), DLT_STRING(strerror(errno)));
+ logError("RoutingReceiverAsyncShadow::hookTimingInformationChanged write failed, error code:",strerror(errno));
}
}
@@ -418,7 +418,7 @@ void RoutingReceiverAsyncShadow::asyncMsgReceiver(const pollfd pollfd, const sh_
char buffer[10];
if (read(pollfd.fd, buffer, 10) == -1)
{
- DLT_LOG(PluginRoutingAsync, DLT_LOG_ERROR, DLT_STRING("RoutingReceiverAsyncShadow::asyncMsgReceiver could not read!"));
+ logError("RoutingReceiverAsyncShadow::asyncMsgReceiver could not read!");
}
}
@@ -483,7 +483,7 @@ bool RoutingReceiverAsyncShadow::asyncDispatcher(const sh_pollHandle_t handle, v
mRoutingReceiveInterface->hookTimingInformationChanged(msg.parameters.timingInfoChange.connectionID, msg.parameters.timingInfoChange.delay);
break;
default:
- DLT_LOG(PluginRoutingAsync, DLT_LOG_ERROR, DLT_STRING("RoutingReceiverAsyncShadow::asyncDispatcher unknown message was received:"), DLT_INT(msg.msgID));
+ logError("RoutingReceiverAsyncShadow::asyncDispatcher unknown message was received:",msg.msgID);
break;
}
@@ -515,7 +515,7 @@ am_Error_e RoutingReceiverAsyncShadow::setRoutingInterface(RoutingReceiveInterfa
mRoutingReceiveInterface->getSocketHandler(mSocketHandler);
if (pipe(mPipe) == -1)
{
- DLT_LOG(PluginRoutingAsync, DLT_LOG_ERROR, DLT_STRING("RoutingReceiverAsyncShadow::setRoutingInterface could not create pipe!:"));
+ logError("RoutingReceiverAsyncShadow::setRoutingInterface could not create pipe!:");
return (E_UNKNOWN);
}
diff --git a/PluginRoutingInterfaceAsync/src/RoutingSenderAsync.cpp b/PluginRoutingInterfaceAsync/src/RoutingSenderAsync.cpp
index 9a39422..9d063bc 100644
--- a/PluginRoutingInterfaceAsync/src/RoutingSenderAsync.cpp
+++ b/PluginRoutingInterfaceAsync/src/RoutingSenderAsync.cpp
@@ -23,7 +23,7 @@
*/
#include "RoutingSenderAsyn.h"
-#include "DltContext.h"
+#include "DLTWrapper.h"
#include <algorithm>
#include <vector>
#include <poll.h>
@@ -237,7 +237,7 @@ pPool(pool), //
timespec temp;
if(clock_gettime(0, &temp)==-1)
{
- DLT_LOG(PluginRoutingAsync, DLT_LOG_ERROR, DLT_STRING("Worker::timedWait error on getting time"));
+ logError("Worker::timedWait error on getting time");
}
temp.tv_nsec+=timer.tv_nsec;
temp.tv_sec+=timer.tv_sec;
@@ -247,16 +247,16 @@ pPool(pool), //
//a timeout happened
if(errno == ETIMEDOUT)
{
- DLT_LOG(PluginRoutingAsync, DLT_LOG_ERROR, DLT_STRING("Worker::timedWait timeout waiting error"));
+ logError("Worker::timedWait timeout waiting error");
return (false);
}
else //failure in waiting, nevertheless, we quit the thread...
{
- DLT_LOG(PluginRoutingAsync, DLT_LOG_ERROR, DLT_STRING("Worker::timedWait semaphore waiting error"));
+ logError("Worker::timedWait semaphore waiting error");
return (true);
}
}
- DLT_LOG(PluginRoutingAsync, DLT_LOG_ERROR, DLT_STRING("Worker::timedWait semaphore waiting error"));
+ logError("Worker::timedWait semaphore waiting error");
this->cancelWork();
return (true);
}
@@ -272,8 +272,6 @@ mMapHandleWorker ( ), //
mMapConnectionIDRoute(),//
mPool(10)
{
- DLT_REGISTER_CONTEXT(PluginRoutingAsync,"ASY","Async Plugin");
- DLT_LOG(PluginRoutingAsync,DLT_LOG_INFO, DLT_STRING("AsyncRoutingSender constructed"));
}
AsyncRoutingSender::~AsyncRoutingSender()
@@ -299,7 +297,7 @@ void AsyncRoutingSender::routingInterfacesReady()
am_domainID_t domainID;
if ((eCode = mReceiveInterface->registerDomain(*domainIter, domainID)) != E_OK)
{
- DLT_LOG(PluginRoutingAsync, DLT_LOG_ERROR, DLT_STRING("AsyncRoutingSender::routingInterfacesReady error on registering domain, failed with"), DLT_INT(eCode));
+ logError("AsyncRoutingSender::routingInterfacesReady error on registering domain, failed with", eCode);
}
domainIter->domainID = domainID;
}
@@ -313,7 +311,7 @@ void AsyncRoutingSender::routingInterfacesReady()
sourceIter->domainID = mDomains[0].domainID;
if ((eCode = mReceiveInterface->registerSource(*sourceIter, sourceID)) != E_OK)
{
- DLT_LOG(PluginRoutingAsync, DLT_LOG_ERROR, DLT_STRING("AsyncRoutingSender::routingInterfacesReady error on registering source, failed with"), DLT_INT(eCode));
+ logError("AsyncRoutingSender::routingInterfacesReady error on registering source, failed with", eCode);
}
}
@@ -326,7 +324,7 @@ void AsyncRoutingSender::routingInterfacesReady()
sinkIter->domainID = mDomains[0].domainID;
if ((eCode = mReceiveInterface->registerSink(*sinkIter, sinkID)) != E_OK)
{
- DLT_LOG(PluginRoutingAsync, DLT_LOG_ERROR, DLT_STRING("AsyncRoutingSender::routingInterfacesReady error on registering sink, failed with"), DLT_INT(eCode));
+ logError("AsyncRoutingSender::routingInterfacesReady error on registering sink, failed with", eCode);
}
}
@@ -340,7 +338,7 @@ void AsyncRoutingSender::routingInterfacesReady()
// gatewayIter->controlDomainID=mDomains[0].domainID;
// if((eCode=mReceiveInterface->registerGateway(*gatewayIter,gatewayID))!=E_OK)
// {
-// DLT_LOG(PluginRoutingAsync, DLT_LOG_ERROR, DLT_STRING("AsyncRoutingSender::routingInterfacesReady error on registering gateway, failed with"), DLT_INT(eCode));
+// logError("AsyncRoutingSender::routingInterfacesReady error on registering gateway, failed with",eCode));
// }
// gatewayIter->gatewayID=gatewayID;
// }
@@ -426,7 +424,7 @@ am_Error_e AsyncRoutingSender::asyncConnect(const am_Handle_s handle, const am_c
asycConnectWorker *worker = new asycConnectWorker(this, &mPool, &mShadow, handle, connectionID, sourceID, sinkID, connectionFormat);
if ((work = mPool.startWork(worker)) == -1)
{
- DLT_LOG(PluginRoutingAsync, DLT_LOG_ERROR, DLT_STRING("AsyncRoutingSender::asyncConnect not enough threads!"));
+ logError("AsyncRoutingSender::asyncConnect not enough threads!");
delete worker;
return (E_NOT_POSSIBLE);
}
@@ -461,7 +459,7 @@ am_Error_e AsyncRoutingSender::asyncDisconnect(const am_Handle_s handle, const a
asycDisConnectWorker *worker = new asycDisConnectWorker(this, &mPool, &mShadow, handle, connectionID);
if ((work = mPool.startWork(worker)) == -1)
{
- DLT_LOG(PluginRoutingAsync, DLT_LOG_ERROR, DLT_STRING("AsyncRoutingSender::asyncDisconnect not enough threads!"));
+ logError("AsyncRoutingSender::asyncDisconnect not enough threads!");
delete worker;
return (E_NOT_POSSIBLE);
}
@@ -503,7 +501,7 @@ am_Error_e AsyncRoutingSender::asyncSetSinkVolume(const am_Handle_s handle, cons
asyncSetSinkVolumeWorker *worker = new asyncSetSinkVolumeWorker(this, &mPool, &mShadow, sinkIter->volume, handle, sinkID, volume, ramp, time);
if ((work = mPool.startWork(worker)) == -1)
{
- DLT_LOG(PluginRoutingAsync, DLT_LOG_ERROR, DLT_STRING("AsyncRoutingSender::asyncSetSinkVolume not enough threads!"));
+ logError("AsyncRoutingSender::asyncSetSinkVolume not enough threads!");
delete worker;
return (E_NOT_POSSIBLE);
}
@@ -545,7 +543,7 @@ am_Error_e AsyncRoutingSender::asyncSetSourceVolume(const am_Handle_s handle, co
asyncSetSourceVolumeWorker *worker = new asyncSetSourceVolumeWorker(this, &mPool, &mShadow, sourceIter->volume, handle, sourceID, volume, ramp, time);
if ((work = mPool.startWork(worker)) == -1)
{
- DLT_LOG(PluginRoutingAsync, DLT_LOG_ERROR, DLT_STRING("AsyncRoutingSender::asyncSetSourceVolume not enough threads!"));
+ logError("AsyncRoutingSender::asyncSetSourceVolume not enough threads!");
delete worker;
return (E_NOT_POSSIBLE);
}
@@ -587,7 +585,7 @@ am_Error_e AsyncRoutingSender::asyncSetSourceState(const am_Handle_s handle, con
asyncSetSourceStateWorker *worker = new asyncSetSourceStateWorker(this, &mPool, &mShadow, handle, sourceID, state);
if ((work = mPool.startWork(worker)) == -1)
{
- DLT_LOG(PluginRoutingAsync, DLT_LOG_ERROR, DLT_STRING("AsyncRoutingSender::asyncSetSourceState not enough threads!"));
+ logError("AsyncRoutingSender::asyncSetSourceState not enough threads!");
delete worker;
return (E_NOT_POSSIBLE);
}
@@ -629,7 +627,7 @@ am_Error_e AsyncRoutingSender::asyncSetSinkSoundProperty(const am_Handle_s handl
asyncSetSinkSoundPropertyWorker *worker = new asyncSetSinkSoundPropertyWorker(this, &mPool, &mShadow, handle, soundProperty, sinkID);
if ((work = mPool.startWork(worker)) == -1)
{
- DLT_LOG(PluginRoutingAsync, DLT_LOG_ERROR, DLT_STRING("AsyncRoutingSender::asyncSetSinkSoundProperty not enough threads!"));
+ logError("AsyncRoutingSender::asyncSetSinkSoundProperty not enough threads!");
delete worker;
return (E_NOT_POSSIBLE);
}
@@ -680,7 +678,7 @@ am_Error_e AsyncRoutingSender::setDomainState(const am_domainID_t domainID, cons
asyncDomainStateChangeWorker *worker = new asyncDomainStateChangeWorker(this, &mPool, &mShadow, domainID, domainState);
if ((work = mPool.startWork(worker)) == -1)
{
- DLT_LOG(PluginRoutingAsync, DLT_LOG_ERROR, DLT_STRING("AsyncRoutingSender::setDomainState not enough threads!"));
+ logError("AsyncRoutingSender::setDomainState not enough threads!");
delete worker;
return (E_NOT_POSSIBLE);
}
@@ -718,7 +716,7 @@ am_Error_e AsyncRoutingSender::asyncSetSourceSoundProperty(const am_Handle_s han
asyncSetSourceSoundPropertyWorker *worker = new asyncSetSourceSoundPropertyWorker(this, &mPool, &mShadow, handle, soundProperty, sourceID);
if ((work = mPool.startWork(worker)) == -1)
{
- DLT_LOG(PluginRoutingAsync, DLT_LOG_ERROR, DLT_STRING("AsyncRoutingSender::asyncSetSourceState not enough threads!"));
+ logError("AsyncRoutingSender::asyncSetSourceState not enough threads!");
delete worker;
return (E_NOT_POSSIBLE);
}
@@ -817,7 +815,7 @@ void AsyncRoutingSender::removeHandleSafe(uint16_t handle)
pthread_mutex_lock(&mMapHandleWorkerMutex);
if (mMapHandleWorker.erase(handle))
{
- DLT_LOG(PluginRoutingAsync, DLT_LOG_ERROR, DLT_STRING("AsyncRoutingSender::removeHandle could not remove handle"));
+ logError("AsyncRoutingSender::removeHandle could not remove handle");
}
pthread_mutex_unlock(&mMapHandleWorkerMutex);
}
@@ -827,7 +825,7 @@ void AsyncRoutingSender::removeConnectionSafe(am_connectionID_t connectionID)
pthread_mutex_lock(&mMapConnectionMutex);
if (mMapConnectionIDRoute.erase(connectionID))
{
- DLT_LOG(PluginRoutingAsync, DLT_LOG_ERROR, DLT_STRING("AsyncRoutingSender::removeConnectionSafe could not remove connection"));
+ logError("AsyncRoutingSender::removeConnectionSafe could not remove connection");
}
pthread_mutex_unlock(&mMapConnectionMutex);
}
@@ -984,7 +982,7 @@ asycConnectWorker::asycConnectWorker(AsyncRoutingSender * asyncSender, WorkerThr
void asycConnectWorker::start2work()
{
- DLT_LOG(PluginRoutingAsync, DLT_LOG_INFO, DLT_STRING("Start connecting"));
+ logInfo("Start connecting");
timespec t;
t.tv_nsec = 0;
t.tv_sec = 1;
@@ -1024,7 +1022,7 @@ asycDisConnectWorker::asycDisConnectWorker(AsyncRoutingSender *asyncSender, Work
void asycDisConnectWorker::start2work()
{
- DLT_LOG(PluginRoutingAsync, DLT_LOG_INFO, DLT_STRING("Start disconnecting"));
+ logInfo("Start disconnecting");
timespec t;
t.tv_nsec = 0;
t.tv_sec = 1;
@@ -1067,7 +1065,7 @@ asyncSetSinkVolumeWorker::asyncSetSinkVolumeWorker(AsyncRoutingSender *asyncSend
void asyncSetSinkVolumeWorker::start2work()
{
//todo: this implementation does not respect time and ramp....
- DLT_LOG(PluginRoutingAsync, DLT_LOG_INFO, DLT_STRING("Start setting sink volume"));
+ logInfo("Start setting sink volume");
timespec t;
t.tv_nsec = 10000000;
t.tv_sec = 0;
@@ -1116,7 +1114,7 @@ asyncSetSourceVolumeWorker::asyncSetSourceVolumeWorker(AsyncRoutingSender *async
void asyncSetSourceVolumeWorker::start2work()
{
//todo: this implementation does not respect time and ramp....
- DLT_LOG(PluginRoutingAsync, DLT_LOG_INFO, DLT_STRING("Start setting source volume"));
+ logInfo("Start setting source volume");
timespec t;
t.tv_nsec = 10000000;
t.tv_sec = 0;
@@ -1161,7 +1159,7 @@ asyncSetSourceStateWorker::asyncSetSourceStateWorker(AsyncRoutingSender *asyncSe
void asyncSetSourceStateWorker::start2work()
{
- DLT_LOG(PluginRoutingAsync, DLT_LOG_INFO, DLT_STRING("Start setting source state"));
+ logInfo("Start setting source state");
timespec t;
t.tv_nsec = 0;
t.tv_sec = 1;
@@ -1201,7 +1199,7 @@ asyncSetSinkSoundPropertyWorker::asyncSetSinkSoundPropertyWorker(AsyncRoutingSen
void asyncSetSinkSoundPropertyWorker::start2work()
{
- DLT_LOG(PluginRoutingAsync, DLT_LOG_INFO, DLT_STRING("Start setting sink sound property"));
+ logInfo("Start setting sink sound property");
timespec t;
t.tv_nsec = 0;
t.tv_sec = 1;
@@ -1241,7 +1239,7 @@ asyncSetSourceSoundPropertyWorker::asyncSetSourceSoundPropertyWorker(AsyncRoutin
void asyncSetSourceSoundPropertyWorker::start2work()
{
- DLT_LOG(PluginRoutingAsync, DLT_LOG_INFO, DLT_STRING("Start setting source sound property"));
+ logInfo("Start setting source sound property");
timespec t;
t.tv_nsec = 0;
t.tv_sec = 1;
@@ -1281,7 +1279,7 @@ asyncDomainStateChangeWorker::asyncDomainStateChangeWorker(AsyncRoutingSender *a
void asyncDomainStateChangeWorker::start2work()
{
//todo: sendchanged data must be in here !
- DLT_LOG(PluginRoutingAsync, DLT_LOG_INFO, DLT_STRING("Start setting source sound property"));
+ logInfo("Start setting source sound property");
timespec t;
t.tv_nsec = 0;
t.tv_sec = 1;
diff --git a/PluginRoutingInterfaceAsync/test/CMakeLists.txt b/PluginRoutingInterfaceAsync/test/CMakeLists.txt
index 5f61232..c060a71 100644
--- a/PluginRoutingInterfaceAsync/test/CMakeLists.txt
+++ b/PluginRoutingInterfaceAsync/test/CMakeLists.txt
@@ -52,6 +52,7 @@ INCLUDE_DIRECTORIES(
file(GLOB ASYNC_PLUGIN_INTERFACE_SRCS_CXX
"../../AudioManagerDaemon/src/SocketHandler.cpp"
"../../AudioManagerDaemon/src/RoutingSender.cpp"
+ "../../AudioManagerDaemon/src/DLTWrapper.cpp"
"../src/*.cpp"
"testRoutingInterfaceAsync.cpp"
)
@@ -59,6 +60,7 @@ file(GLOB ASYNC_PLUGIN_INTERFACE_SRCS_CXX
file(GLOB ASYNC_PLUGIN_INTERFACE_INTERRUPT_SRCS_CXX
"../../AudioManagerDaemon/src/SocketHandler.cpp"
"../../AudioManagerDaemon/src/RoutingSender.cpp"
+ "../../AudioManagerDaemon/src/DLTWrapper.cpp"
"../src/*.cpp"
"testRoutingInterfaceAsyncInterrupt.cpp"
diff --git a/PluginRoutingInterfaceAsync/test/mocklnterfaces.h b/PluginRoutingInterfaceAsync/test/mocklnterfaces.h
index 9241dc0..c3caa46 100644
--- a/PluginRoutingInterfaceAsync/test/mocklnterfaces.h
+++ b/PluginRoutingInterfaceAsync/test/mocklnterfaces.h
@@ -82,9 +82,9 @@ class MockRoutingReceiveInterface : public RoutingReceiveInterface {
MOCK_METHOD1(deregisterCrossfader,
am_Error_e(const am_crossfaderID_t crossfaderID));
MOCK_METHOD2(peekSourceClassID,
- am_Error_e(const std::string name, const am_sourceClass_t& sourceClassID));
+ am_Error_e(const std::string& name, const am_sourceClass_t& sourceClassID));
MOCK_METHOD2(peekSinkClassID,
- am_Error_e(const std::string name, const am_sinkClass_t& sinkClassID));
+ am_Error_e(const std::string& name, const am_sinkClass_t& sinkClassID));
MOCK_METHOD2(hookInterruptStatusChange,
void(const am_sourceID_t sourceID, const am_InterruptState_e interruptState));
MOCK_METHOD1(hookDomainRegistrationComplete,
diff --git a/PluginRoutingInterfaceAsync/test/testRoutingInterfaceAsync.cpp b/PluginRoutingInterfaceAsync/test/testRoutingInterfaceAsync.cpp
index fe74f42..c252e07 100644
--- a/PluginRoutingInterfaceAsync/test/testRoutingInterfaceAsync.cpp
+++ b/PluginRoutingInterfaceAsync/test/testRoutingInterfaceAsync.cpp
@@ -24,12 +24,11 @@
#include "testRoutingInterfaceAsync.h"
#include "config.h"
+#include "DLTWrapper.h"
using namespace am;
using namespace testing;
-DLT_DECLARE_CONTEXT(DLT_CONTEXT)
-
std::vector<std::string> testRoutingInterfaceAsync::pListRoutingPluginDirs = returnListPlugins();
am_domainID_t testRoutingInterfaceAsync::mDomainIDCount = 0;
RoutingSender testRoutingInterfaceAsync::pRoutingSender = RoutingSender(pListRoutingPluginDirs);
@@ -47,9 +46,7 @@ testRoutingInterfaceAsync::~testRoutingInterfaceAsync()
void testRoutingInterfaceAsync::SetUp()
{
- DLT_REGISTER_APP("DPtest", "RoutingInterfacetest");
- DLT_REGISTER_CONTEXT(DLT_CONTEXT, "Main", "Main Context");
- DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("RoutingSendInterface Test started "));
+ logInfo("RoutingSendInterface Test started ");
std::vector<int> domainIDs;
domainIDs.push_back(0);
@@ -113,7 +110,6 @@ void am::testRoutingInterfaceAsync::timerCallback(sh_timerHandle_t handle, void
void testRoutingInterfaceAsync::TearDown()
{
- DLT_UNREGISTER_CONTEXT(DLT_CONTEXT);
}
TEST_F(testRoutingInterfaceAsync,setDomainState)
diff --git a/PluginRoutingInterfaceAsync/test/testRoutingInterfaceAsync.h b/PluginRoutingInterfaceAsync/test/testRoutingInterfaceAsync.h
index ecb5bad..364100c 100644
--- a/PluginRoutingInterfaceAsync/test/testRoutingInterfaceAsync.h
+++ b/PluginRoutingInterfaceAsync/test/testRoutingInterfaceAsync.h
@@ -27,7 +27,6 @@
#include <gtest/gtest.h>
#include <gmock/gmock.h>
-#include <dlt/dlt.h>
#include "mocklnterfaces.h"
#include "SocketHandler.h"
#include "../../AudioManagerDaemon/include/RoutingSender.h"
diff --git a/PluginRoutingInterfaceAsync/test/testRoutingInterfaceAsyncInterrupt.cpp b/PluginRoutingInterfaceAsync/test/testRoutingInterfaceAsyncInterrupt.cpp
index 9f40230..f8ece51 100644
--- a/PluginRoutingInterfaceAsync/test/testRoutingInterfaceAsyncInterrupt.cpp
+++ b/PluginRoutingInterfaceAsync/test/testRoutingInterfaceAsyncInterrupt.cpp
@@ -26,12 +26,11 @@
#include "testRoutingInterfaceAsync.h"
#include "config.h"
+#include "DLTWrapper.h"
using namespace am;
using namespace testing;
-DLT_DECLARE_CONTEXT(DLT_CONTEXT)
-
std::vector<std::string> testRoutingInterfaceAsync::pListRoutingPluginDirs = returnListPlugins();
am_domainID_t testRoutingInterfaceAsync::mDomainIDCount = 0;
RoutingSender testRoutingInterfaceAsync::pRoutingSender = RoutingSender(pListRoutingPluginDirs);
@@ -49,9 +48,7 @@ testRoutingInterfaceAsync::~testRoutingInterfaceAsync()
void testRoutingInterfaceAsync::SetUp()
{
- DLT_REGISTER_APP("DPtest", "RoutingInterfacetest");
- DLT_REGISTER_CONTEXT(DLT_CONTEXT, "Main", "Main Context");
- DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("RoutingSendInterface Test started "));
+ logInfo("RoutingSendInterface Test started ");
std::vector<int> domainIDs;
domainIDs.push_back(0);
@@ -115,7 +112,6 @@ void testRoutingInterfaceAsync::timerCallback(sh_timerHandle_t handle, void *use
void testRoutingInterfaceAsync::TearDown()
{
- DLT_UNREGISTER_CONTEXT(DLT_CONTEXT);
}
std::string DBUSCOMMAND = "dbus-send --session --print-reply --dest=org.genivi.test /org/genivi/test org.genivi.test.";
diff --git a/PluginRoutingInterfaceDbus/CMakeLists.txt b/PluginRoutingInterfaceDbus/CMakeLists.txt
index 4b87e75..77a44db 100644
--- a/PluginRoutingInterfaceDbus/CMakeLists.txt
+++ b/PluginRoutingInterfaceDbus/CMakeLists.txt
@@ -2,8 +2,6 @@ cmake_minimum_required(VERSION 2.6)
PROJECT(PluginRoutingInterfaceDbus)
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -DDLT_CONTEXT=RoutingPluginDbus")
-
set(LIBRARY_OUTPUT_PATH ${PLUGINS_OUTPUT_PATH}/routing)
set(DOC_OUTPUT_PATH ${DOC_OUTPUT_PATH}/RoutingPlugin)
set(INCLUDES_FOLDER "include")
diff --git a/includes/DLTWrapper.h b/includes/DLTWrapper.h
new file mode 100644
index 0000000..dcce4ab
--- /dev/null
+++ b/includes/DLTWrapper.h
@@ -0,0 +1,457 @@
+/**
+ * Copyright (C) 2011, BMW AG
+ *
+ * GeniviAudioMananger AudioManagerDaemon
+ *
+ * \file DLTWrapper.h
+ *
+ * \date 20-Oct-2011 3:42:04 PM
+ * \author Christian Mueller (christian.ei.mueller@bmw.de)
+ *
+ * \section License
+ * GNU Lesser General Public License, version 2.1, with special exception (GENIVI clause)
+ * Copyright (C) 2011, BMW AG Christian Mueller Christian.ei.mueller@bmw.de
+ *
+ * This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License, version 2.1, as published by the Free Software Foundation.
+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License, version 2.1, for more details.
+ * You should have received a copy of the GNU Lesser General Public License, version 2.1, along with this program; if not, see <http://www.gnu.org/licenses/lgpl-2.1.html>.
+ * Note that the copyright holders assume that the GNU Lesser General Public License, version 2.1, may also be applicable to programs even in cases in which the program is not a library in the technical sense.
+ * Linking AudioManager statically or dynamically with other modules is making a combined work based on AudioManager. You may license such other modules under the GNU Lesser General Public License, version 2.1. If you do not want to license your linked modules under the GNU Lesser General Public License, version 2.1, you may use the program under the following exception.
+ * As a special exception, the copyright holders of AudioManager give you permission to combine AudioManager with software programs or libraries that are released under any license unless such a combination is not permitted by the license of such a software program or library. You may copy and distribute such a system following the terms of the GNU Lesser General Public License, version 2.1, including this special exception, for AudioManager and the licenses of the other code concerned.
+ * Note that people who make modified versions of AudioManager are not obligated to grant this special exception for their modified versions; it is their choice whether to do so. The GNU Lesser General Public License, version 2.1, gives permission to release a modified version without this exception; this exception also makes it possible to release a modified version which carries forward this exception.
+ *
+ */
+
+#ifndef DLTWRAPPER_H_
+#define DLTWRAPPER_H_
+
+#include <dlt/dlt.h>
+#include <string>
+
+class DLTWrapper
+{
+public:
+ static DLTWrapper* instance();
+ void registerApp(const char *appid, const char * description);
+ void registerContext(DltContext& handle, const char *contextid, const char * description);
+ void unregisterContext(DltContext& handle);
+ void init(DltLogLevelType loglevel, DltContext* context = NULL);
+ void send();
+ void append(const int8_t value);
+ void append(const uint8_t value);
+ void append(const int16_t value);
+ void append(const uint16_t value);
+ void append(const int32_t value);
+ void append(const uint32_t value);
+ void append(const char*& value);
+ void append(const std::string& value);
+ void append(const bool value);
+ ~DLTWrapper();
+private:
+ DLTWrapper(); //is private because of singleton pattern
+ DltContext mDltContext;
+ DltContextData mDltContextData;
+ static DLTWrapper* mDLTWrapper;
+
+};
+
+inline DLTWrapper* getWrapper()
+{
+ return DLTWrapper::instance();
+}
+
+template<typename T> void logInfo(T value)
+{
+ DLTWrapper* inst(getWrapper());
+ inst->init(DLT_LOG_INFO);
+ inst->append(value);
+ inst->send();
+}
+
+template<typename T, typename T1> void logInfo(T value, T1 value1)
+{
+ DLTWrapper* inst(getWrapper());
+ inst->init(DLT_LOG_INFO);
+ inst->append(value);
+ inst->append(value1);
+ inst->send();
+}
+
+template<typename T, typename T1, typename T2> void logInfo(T value, T1 value1, T2 value2)
+{
+ DLTWrapper* inst(getWrapper());
+ inst->init(DLT_LOG_INFO);
+ inst->append(value);
+ inst->append(value1);
+ inst->append(value2);
+ inst->send();
+}
+
+template<typename T, typename T1, typename T2, typename T3> void logInfo(T value, T1 value1, T2 value2, T3 value3)
+{
+ DLTWrapper* inst(getWrapper());
+ inst->init(DLT_LOG_INFO);
+ inst->append(value);
+ inst->append(value1);
+ inst->append(value2);
+ inst->append(value3);
+ inst->send();
+}
+
+template<typename T, typename T1, typename T2, typename T3, typename T4> void logInfo(T value, T1 value1, T2 value2, T3 value3, T4 value4)
+{
+ DLTWrapper* inst(getWrapper());
+ inst->init(DLT_LOG_INFO);
+ inst->append(value);
+ inst->append(value1);
+ inst->append(value2);
+ inst->append(value3);
+ inst->append(value4);
+ inst->send();
+}
+
+template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5> void logInfo(T value, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5)
+{
+ DLTWrapper* inst(getWrapper());
+ inst->init(DLT_LOG_INFO);
+ inst->append(value);
+ inst->append(value1);
+ inst->append(value2);
+ inst->append(value3);
+ inst->append(value4);
+ inst->append(value5);
+ inst->send();
+}
+
+template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6> void logInfo(T value, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6)
+{
+ DLTWrapper* inst(getWrapper());
+ inst->init(DLT_LOG_INFO);
+ inst->append(value);
+ inst->append(value1);
+ inst->append(value2);
+ inst->append(value3);
+ inst->append(value4);
+ inst->append(value5);
+ inst->append(value6);
+ inst->send();
+}
+
+template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7> void logInfo(T value, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7)
+{
+ DLTWrapper* inst(getWrapper());
+ inst->init(DLT_LOG_INFO);
+ inst->append(value);
+ inst->append(value1);
+ inst->append(value2);
+ inst->append(value3);
+ inst->append(value4);
+ inst->append(value5);
+ inst->append(value6);
+ inst->append(value7);
+ inst->send();
+}
+
+template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8> void logInfo(T value, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7, T8 value8)
+{
+ DLTWrapper* inst(getWrapper());
+ inst->init(DLT_LOG_INFO);
+ inst->append(value);
+ inst->append(value1);
+ inst->append(value2);
+ inst->append(value3);
+ inst->append(value4);
+ inst->append(value5);
+ inst->append(value6);
+ inst->append(value7);
+ inst->append(value8);
+ inst->send();
+}
+
+template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9> void logInfo(T value, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7, T8 value8, T9 value9)
+{
+ DLTWrapper* inst(getWrapper());
+ inst->init(DLT_LOG_ERROR);
+ inst->append(value);
+ inst->append(value1);
+ inst->append(value2);
+ inst->append(value3);
+ inst->append(value4);
+ inst->append(value5);
+ inst->append(value6);
+ inst->append(value7);
+ inst->append(value8);
+ inst->append(value9);
+ inst->send();
+}
+
+template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10> void logInfo(T value, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7, T8 value8, T9 value9, T10 value10)
+{
+ DLTWrapper* inst(getWrapper());
+ inst->init(DLT_LOG_ERROR);
+ inst->append(value);
+ inst->append(value1);
+ inst->append(value2);
+ inst->append(value3);
+ inst->append(value4);
+ inst->append(value5);
+ inst->append(value6);
+ inst->append(value7);
+ inst->append(value8);
+ inst->append(value9);
+ inst->append(value10);
+ inst->send();
+}
+
+template<typename T> void logError(T value)
+{
+ DLTWrapper* inst(getWrapper());
+ inst->init(DLT_LOG_ERROR);
+ inst->append(value);
+ inst->send();
+}
+
+template<typename T, typename T1> void logError(T value, T1 value1)
+{
+ DLTWrapper* inst(getWrapper());
+ inst->init(DLT_LOG_ERROR);
+ inst->append(value);
+ inst->append(value1);
+ inst->send();
+}
+
+template<typename T, typename T1, typename T2> void logError(T value, T1 value1, T2 value2)
+{
+ DLTWrapper* inst(getWrapper());
+ inst->init(DLT_LOG_ERROR);
+ inst->append(value);
+ inst->append(value1);
+ inst->append(value2);
+ inst->send();
+}
+
+template<typename T, typename T1, typename T2, typename T3> void logError(T value, T1 value1, T2 value2, T3 value3)
+{
+ DLTWrapper* inst(getWrapper());
+ inst->init(DLT_LOG_ERROR);
+ inst->append(value);
+ inst->append(value1);
+ inst->append(value2);
+ inst->append(value3);
+ inst->send();
+}
+
+template<typename T, typename T1, typename T2, typename T3, typename T4> void logError(T value, T1 value1, T2 value2, T3 value3, T4 value4)
+{
+ DLTWrapper* inst(getWrapper());
+ inst->init(DLT_LOG_ERROR);
+ inst->append(value);
+ inst->append(value1);
+ inst->append(value2);
+ inst->append(value3);
+ inst->append(value4);
+ inst->send();
+}
+
+template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5> void logError(T value, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5)
+{
+ DLTWrapper* inst(getWrapper());
+ inst->init(DLT_LOG_ERROR);
+ inst->append(value);
+ inst->append(value1);
+ inst->append(value2);
+ inst->append(value3);
+ inst->append(value4);
+ inst->append(value5);
+ inst->send();
+}
+
+template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6> void logError(T value, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6)
+{
+ DLTWrapper* inst(getWrapper());
+ inst->init(DLT_LOG_ERROR);
+ inst->append(value);
+ inst->append(value1);
+ inst->append(value2);
+ inst->append(value3);
+ inst->append(value4);
+ inst->append(value5);
+ inst->append(value6);
+ inst->send();
+}
+
+template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7> void logError(T value, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7)
+{
+ DLTWrapper* inst(getWrapper());
+ inst->init(DLT_LOG_ERROR);
+ inst->append(value);
+ inst->append(value1);
+ inst->append(value2);
+ inst->append(value3);
+ inst->append(value4);
+ inst->append(value5);
+ inst->append(value6);
+ inst->append(value7);
+ inst->send();
+}
+
+template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8> void logError(T value, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7, T8 value8)
+{
+ DLTWrapper* inst(getWrapper());
+ inst->init(DLT_LOG_ERROR);
+ inst->append(value);
+ inst->append(value1);
+ inst->append(value2);
+ inst->append(value3);
+ inst->append(value4);
+ inst->append(value5);
+ inst->append(value6);
+ inst->append(value7);
+ inst->append(value8);
+ inst->send();
+}
+
+template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9> void logError(T value, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7, T8 value8, T9 value9)
+{
+ DLTWrapper* inst(getWrapper());
+ inst->init(DLT_LOG_ERROR);
+ inst->append(value);
+ inst->append(value1);
+ inst->append(value2);
+ inst->append(value3);
+ inst->append(value4);
+ inst->append(value5);
+ inst->append(value6);
+ inst->append(value7);
+ inst->append(value8);
+ inst->append(value9);
+ inst->send();
+}
+
+template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10> void logError(T value, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7, T8 value8, T9 value9, T10 value10)
+{
+ DLTWrapper* inst(getWrapper());
+ inst->init(DLT_LOG_ERROR);
+ inst->append(value);
+ inst->append(value1);
+ inst->append(value2);
+ inst->append(value3);
+ inst->append(value4);
+ inst->append(value5);
+ inst->append(value6);
+ inst->append(value7);
+ inst->append(value8);
+ inst->append(value9);
+ inst->append(value10);
+ inst->send();
+}
+
+template<typename T> void log(DltContext* const context, DltLogLevelType loglevel, T value)
+{
+ DLTWrapper* inst(getWrapper());
+ inst->init(loglevel, context);
+ inst->append(value);
+ inst->send();
+}
+
+template<typename T, typename T1> void log(DltContext* const context, DltLogLevelType loglevel, T value, T1 value1)
+{
+ DLTWrapper* inst(getWrapper());
+ inst->init(loglevel, context);
+ inst->append(value);
+ inst->append(value1);
+ inst->send();
+}
+
+template<typename T, typename T1, typename T2> void log(DltContext* const context, DltLogLevelType loglevel, T value, T1 value1, T2 value2)
+{
+ DLTWrapper* inst(getWrapper());
+ inst->init(loglevel, context);
+ inst->append(value);
+ inst->append(value1);
+ inst->append(value2);
+ inst->send();
+}
+
+template<typename T, typename T1, typename T2, typename T3> void log(DltContext* const context, DltLogLevelType loglevel, T value, T1 value1, T2 value2, T3 value3)
+{
+ DLTWrapper* inst(getWrapper());
+ inst->init(loglevel, context);
+ inst->append(value);
+ inst->append(value1);
+ inst->append(value2);
+ inst->append(value3);
+ inst->send();
+}
+
+template<typename T, typename T1, typename T2, typename T3, typename T4> void log(DltContext* const context, DltLogLevelType loglevel, T value, T1 value1, T2 value2, T3 value3, T4 value4)
+{
+ DLTWrapper* inst(getWrapper());
+ inst->init(loglevel, context);
+ inst->append(value);
+ inst->append(value1);
+ inst->append(value2);
+ inst->append(value3);
+ inst->append(value4);
+ inst->send();
+}
+
+template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5> void log(DltContext* const context, DltLogLevelType loglevel, T value, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5)
+{
+ DLTWrapper* inst(getWrapper());
+ inst->init(loglevel, context);
+ inst->append(value);
+ inst->append(value1);
+ inst->append(value2);
+ inst->append(value3);
+ inst->append(value4);
+ inst->append(value5);
+ inst->send();
+}
+
+template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6> void log(DltContext* const context, DltLogLevelType loglevel, T value, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6)
+{
+ DLTWrapper* inst(getWrapper());
+ inst->init(loglevel, context);
+ inst->append(value);
+ inst->append(value1);
+ inst->append(value2);
+ inst->append(value3);
+ inst->append(value4);
+ inst->append(value5);
+ inst->append(value6);
+ inst->send();
+}
+
+template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7> void log(DltContext* const context, DltLogLevelType loglevel, T value, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7)
+{
+ DLTWrapper* inst(getWrapper());
+ inst->init(loglevel, context);
+ inst->append(value);
+ inst->append(value1);
+ inst->append(value2);
+ inst->append(value3);
+ inst->append(value4);
+ inst->append(value5);
+ inst->append(value6);
+ inst->append(value7);
+ inst->send();
+}
+
+template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8> void log(DltContext* const context, DltLogLevelType loglevel, T value, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7, T8 value8)
+{
+ DLTWrapper* inst(getWrapper());
+ inst->init(loglevel, context);
+ inst->append(value);
+ inst->append(value1);
+ inst->append(value2);
+ inst->append(value3);
+ inst->append(value4);
+ inst->append(value5);
+ inst->append(value6);
+ inst->append(value7);
+ inst->append(value8);
+ inst->send();
+}
+
+#endif /* DLTWRAPPER_H_ */
diff --git a/includes/config.h b/includes/config.h
index 920b050..a7267c1 100644
--- a/includes/config.h
+++ b/includes/config.h
@@ -1,7 +1,7 @@
#ifndef _CONFIG_H
#define _CONFIG_H
-#define DAEMONVERSION "ver-0.0.1-16-g002295b"
+#define DAEMONVERSION "ver-0.0.1-17-gbef6b6f"
#define WITH_DBUS_WRAPPER
#define WITH_SOCKETHANDLER_LOOP
diff --git a/includes/routing/RoutingReceiveInterface.h b/includes/routing/RoutingReceiveInterface.h
index ff33d61..e610f92 100644
--- a/includes/routing/RoutingReceiveInterface.h
+++ b/includes/routing/RoutingReceiveInterface.h
@@ -22,8 +22,8 @@
*
* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
*/
-#if !defined(EA_6B4A81F5_2BD8_4604_859D_4539E7E95638__INCLUDED_)
-#define EA_6B4A81F5_2BD8_4604_859D_4539E7E95638__INCLUDED_
+#if !defined(EA_6B5234F4_E3F3_46f3_9B2A_892FD2A0236E__INCLUDED_)
+#define EA_6B5234F4_E3F3_46f3_9B2A_892FD2A0236E__INCLUDED_
#include <vector>
#include <string>
@@ -41,7 +41,7 @@ namespace am {
* Routing Receive sendInterface description. This class implements everything from RoutingAdapter -> Audiomanager
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:53 PM
+ * @created 30-Jan-2012 6:29:29 PM
*/
class RoutingReceiveInterface
{
@@ -253,7 +253,7 @@ namespace am {
* @param name
* @param sourceClassID
*/
- virtual am_Error_e peekSourceClassID(const std::string name, const am_sourceClass_t& sourceClassID) =0;
+ virtual am_Error_e peekSourceClassID(const std::string& name, const am_sourceClass_t& sourceClassID) =0;
/**
* this function peeks a sourceclassID. It is used by the RoutingPlugins to determine the SinkClassIDs of a sinkClass.
* @return E_OK on succes, E_DATABASE_ERROR on error
@@ -261,7 +261,7 @@ namespace am {
* @param name
* @param sinkClassID
*/
- virtual am_Error_e peekSinkClassID(const std::string name, const am_sinkClass_t& sinkClassID) =0;
+ virtual am_Error_e peekSinkClassID(const std::string& name, const am_sinkClass_t& sinkClassID) =0;
/**
* is called when a low level interrupt changes it status.
*
@@ -332,4 +332,4 @@ namespace am {
};
}
-#endif // !defined(EA_6B4A81F5_2BD8_4604_859D_4539E7E95638__INCLUDED_)
+#endif // !defined(EA_6B5234F4_E3F3_46f3_9B2A_892FD2A0236E__INCLUDED_)