summaryrefslogtreecommitdiff
path: root/PluginRoutingInterfaceAsync
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 /PluginRoutingInterfaceAsync
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
Diffstat (limited to 'PluginRoutingInterfaceAsync')
-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
8 files changed, 54 insertions, 94 deletions
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.";