summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--AudioManagerDaemon/include/ControlReceiver.h6
-rw-r--r--AudioManagerDaemon/include/Router.h2
-rw-r--r--AudioManagerDaemon/src/ControlReceiver.cpp15
-rw-r--r--AudioManagerDaemon/src/DBusWrapper.cpp55
-rw-r--r--AudioManagerDaemon/src/DatabaseHandler.cpp4
-rw-r--r--AudioManagerDaemon/src/DatabaseObserver.cpp2
-rw-r--r--AudioManagerDaemon/src/Router.cpp52
-rw-r--r--AudioManagerDaemon/src/RoutingReceiver.cpp4
-rw-r--r--AudioManagerDaemon/src/RoutingSender.cpp8
-rw-r--r--AudioManagerDaemon/src/TelnetServer.cpp8
-rw-r--r--AudioManagerDaemon/src/main.cpp20
-rw-r--r--AudioManagerDaemon/test/controlInterface/MockInterfaces.h9
-rw-r--r--AudioManagerDaemon/test/controlInterface/controlInterfaceTest.cpp9
-rw-r--r--AudioManagerDaemon/test/controlInterface/controlInterfaceTest.h4
-rw-r--r--AudioManagerDaemon/test/database/MockInterfaces.h3
-rw-r--r--AudioManagerDaemon/test/database/databaseTest.cpp4
-rw-r--r--AudioManagerDaemon/test/database/databaseTest.h4
-rw-r--r--AudioManagerDaemon/test/routing/MockInterfaces.h2
-rw-r--r--AudioManagerDaemon/test/routing/routingTest.cpp196
-rw-r--r--AudioManagerDaemon/test/routingInterface/MockRoutingInterface.h9
-rw-r--r--AudioManagerDaemon/test/routingInterface/routingInterfaceTest.cpp12
-rw-r--r--AudioManagerDaemon/test/routingInterface/routingInterfaceTest.h3
-rw-r--r--AudioManagerDaemon/test/sockethandler/sockethandlerTest.cpp31
-rw-r--r--CHANGELOG19
-rw-r--r--CMakeLists.txt4
-rw-r--r--PluginCommandInterfaceDbus/include/DBusCommandSender.h2
-rw-r--r--PluginCommandInterfaceDbus/src/DBusCommandSender.cpp2
-rw-r--r--PluginCommandInterfaceDbus/test/dbuscommandpluginInterfaceTest.cpp1
-rw-r--r--PluginCommandInterfaceDbus/test/dbuscommaninterfacesignalsTest.cpp1625
-rw-r--r--PluginControlInterface/src/ControlSender.cpp77
-rw-r--r--PluginRoutingInterfaceAsync/include/RoutingSenderAsyn.h13
-rw-r--r--PluginRoutingInterfaceAsync/src/RoutingReceiverAsyncShadow.cpp16
-rw-r--r--PluginRoutingInterfaceAsync/src/RoutingSenderAsync.cpp271
-rw-r--r--PluginRoutingInterfaceAsync/test/testRoutingInterfaceAsync.cpp5
-rw-r--r--PluginRoutingInterfaceAsync/test/testRoutingInterfaceAsyncInterrupt.cpp4
-rw-r--r--PluginRoutingInterfaceDbus/include/RoutingSender.h8
-rw-r--r--PluginRoutingInterfaceDbus/src/RoutingSender.cpp71
-rw-r--r--includes/SocketHandler.h2
-rw-r--r--includes/audiomanagertypes.h100
-rw-r--r--includes/command/CommandReceiveInterface.h18
-rw-r--r--includes/command/CommandSendInterface.h22
-rw-r--r--includes/config.h2
-rw-r--r--includes/control/ControlReceiveInterface.h18
-rw-r--r--includes/control/ControlSendInterface.h18
-rw-r--r--includes/dbus/DBusWrapper.h6
-rw-r--r--includes/projecttypes.h20
-rw-r--r--includes/routing/RoutingReceiveInterface.h18
-rw-r--r--includes/routing/RoutingSendInterface.h34
48 files changed, 1586 insertions, 1252 deletions
diff --git a/AudioManagerDaemon/include/ControlReceiver.h b/AudioManagerDaemon/include/ControlReceiver.h
index ac2168c..a40f800 100644
--- a/AudioManagerDaemon/include/ControlReceiver.h
+++ b/AudioManagerDaemon/include/ControlReceiver.h
@@ -35,6 +35,7 @@ class SocketHandler;
class DatabaseHandler;
class RoutingSender;
class CommandSender;
+class Router;
/**
* This class is used to receive all commands from the control interface
@@ -42,8 +43,8 @@ class CommandSender;
class ControlReceiver: public ControlReceiveInterface
{
public:
- ControlReceiver(DatabaseHandler *iDatabaseHandler, RoutingSender *iRoutingSender, CommandSender *iCommandSender, SocketHandler *iSocketHandler);
- ControlReceiver(DatabaseHandler *iDatabaseHandler, RoutingSender *iRoutingSender, CommandSender *iCommandSender);
+ ControlReceiver(DatabaseHandler *iDatabaseHandler, RoutingSender *iRoutingSender, CommandSender *iCommandSender, SocketHandler *iSocketHandler, Router* iRouter);
+ ControlReceiver(DatabaseHandler *iDatabaseHandler, RoutingSender *iRoutingSender, CommandSender *iCommandSender, Router* iRouter);
virtual ~ControlReceiver();
am_Error_e getRoute(const bool onlyfree, const am_sourceID_t sourceID, const am_sinkID_t sinkID, std::vector<am_Route_s>& returnList);
am_Error_e connect(am_Handle_s& handle, am_connectionID_t& connectionID, const am_ConnectionFormat_e format, const am_sourceID_t sourceID, const am_sinkID_t sinkID);
@@ -116,6 +117,7 @@ private:
RoutingSender* mRoutingSender; //!< pointer to the routing send interface.
CommandSender* mCommandSender; //!< pointer to the command send interface
SocketHandler* mSocketHandler; //!< pointer to the socketHandler
+ Router* mRouter; //!< pointer to the Router
};
}
diff --git a/AudioManagerDaemon/include/Router.h b/AudioManagerDaemon/include/Router.h
index 68e33b6..ab7efab 100644
--- a/AudioManagerDaemon/include/Router.h
+++ b/AudioManagerDaemon/include/Router.h
@@ -41,7 +41,7 @@ public:
virtual ~Router();
private:
- am_Error_e findBestWay(std::vector<am_RoutingElement_s>& listRoute, std::vector<am_RoutingElement_s>::iterator routeIterator, std::vector<am_gatewayID_t>::iterator gatewayIterator, int choiceNumber);
+ am_Error_e findBestWay(std::vector<am_RoutingElement_s>& listRoute, std::vector<am_RoutingElement_s>::iterator routeIterator, std::vector<am_gatewayID_t>::iterator gatewayIterator);
void listPossibleConnectionFormats(const am_sourceID_t sourceID, const am_sinkID_t sinkID, std::vector<am_ConnectionFormat_e>& listFormats) const;
void listRestrictedOutputFormatsGateways(const am_gatewayID_t gatewayID, const am_ConnectionFormat_e sinkConnectionFormat, std::vector<am_ConnectionFormat_e>& listFormats) const;
DatabaseHandler* mDatabaseHandler;
diff --git a/AudioManagerDaemon/src/ControlReceiver.cpp b/AudioManagerDaemon/src/ControlReceiver.cpp
index 4900ce7..ac51be7 100644
--- a/AudioManagerDaemon/src/ControlReceiver.cpp
+++ b/AudioManagerDaemon/src/ControlReceiver.cpp
@@ -28,6 +28,7 @@
#include "DatabaseHandler.h"
#include "RoutingSender.h"
#include "CommandSender.h"
+#include "Router.h"
#include <assert.h>
#include <dlt/dlt.h>
@@ -35,26 +36,30 @@ DLT_IMPORT_CONTEXT(AudioManager)
using namespace am;
-ControlReceiver::ControlReceiver(DatabaseHandler *iDatabaseHandler, RoutingSender *iRoutingSender, CommandSender *iCommandSender, SocketHandler *iSocketHandler) :
+ControlReceiver::ControlReceiver(DatabaseHandler *iDatabaseHandler, RoutingSender *iRoutingSender, CommandSender *iCommandSender, SocketHandler *iSocketHandler, Router* iRouter) :
mDatabaseHandler(iDatabaseHandler), //
mRoutingSender(iRoutingSender), //
mCommandSender(iCommandSender), //
- mSocketHandler(iSocketHandler)
+ mSocketHandler(iSocketHandler), //
+ mRouter(iRouter)
{
assert(mDatabaseHandler!=NULL);
assert(mRoutingSender!=NULL);
assert(mCommandSender!=NULL);
assert(mSocketHandler!=NULL);
+ assert(mRouter!=NULL);
}
-ControlReceiver::ControlReceiver(DatabaseHandler *iDatabaseHandler, RoutingSender *iRoutingSender, CommandSender *iCommandSender) :
+ControlReceiver::ControlReceiver(DatabaseHandler *iDatabaseHandler, RoutingSender *iRoutingSender, CommandSender *iCommandSender, Router* iRouter) :
mDatabaseHandler(iDatabaseHandler), //
mRoutingSender(iRoutingSender), //
- mCommandSender(iCommandSender)
+ mCommandSender(iCommandSender), //
+ mRouter(iRouter)
{
assert(mDatabaseHandler!=NULL);
assert(mRoutingSender!=NULL);
assert(mCommandSender!=NULL);
+ assert(mRouter!=NULL);
}
ControlReceiver::~ControlReceiver()
@@ -63,7 +68,7 @@ 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)
{
- //todo: implement routing algorithm
+ mRouter->getRoute(onlyfree,sourceID,sinkID,returnList);
return E_NOT_USED;
}
diff --git a/AudioManagerDaemon/src/DBusWrapper.cpp b/AudioManagerDaemon/src/DBusWrapper.cpp
index 5b81792..94f0788 100644
--- a/AudioManagerDaemon/src/DBusWrapper.cpp
+++ b/AudioManagerDaemon/src/DBusWrapper.cpp
@@ -254,6 +254,7 @@ dbus_bool_t DBusWrapper::addWatch(DBusWatch *watch, void *userData)
dbus_bool_t DBusWrapper::addWatchDelegate(DBusWatch * watch, void* userData)
{
+ (void) userData;
int16_t event = 0;
sh_pollHandle_t handle = 0;
uint flags = dbus_watch_get_flags(watch);
@@ -261,8 +262,10 @@ dbus_bool_t DBusWrapper::addWatchDelegate(DBusWatch * watch, void* userData)
/* no watch flags for disabled watches */
if (dbus_watch_get_enabled(watch))
{
- if (flags & DBUS_WATCH_READABLE) event |= POLLIN;
- if (flags & DBUS_WATCH_WRITABLE) event |= POLLOUT;
+ if (flags & DBUS_WATCH_READABLE)
+ event |= POLLIN;
+ if (flags & DBUS_WATCH_WRITABLE)
+ 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));
@@ -274,6 +277,7 @@ 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"));
+ return (true);
}
void DBusWrapper::removeWatch(DBusWatch *watch, void *userData)
@@ -285,9 +289,11 @@ void DBusWrapper::removeWatch(DBusWatch *watch, void *userData)
void DBusWrapper::removeWatchDelegate(DBusWatch *watch, void *userData)
{
+ (void) userData;
std::map<DBusWatch*, sh_pollHandle_t>::iterator iterator = mMapHandleWatch.begin();
iterator = mMapHandleWatch.find(watch);
- if (iterator != mMapHandleWatch.end()) mSocketHandler->removeFDPoll(iterator->second);
+ 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));
mMapHandleWatch.erase(iterator);
}
@@ -301,18 +307,22 @@ void DBusWrapper::toogleWatch(DBusWatch *watch, void *userData)
void DBusWrapper::toogleWatchDelegate(DBusWatch *watch, void *userData)
{
+ (void) userData;
int16_t event = 0;
- int watchFD = dbus_watch_get_unix_fd(watch);
+ dbus_watch_get_unix_fd(watch);
uint flags = dbus_watch_get_flags(watch);
/* no watch flags for disabled watches */
if (dbus_watch_get_enabled(watch))
{
- if (flags & DBUS_WATCH_READABLE) event |= POLLIN;
- if (flags & DBUS_WATCH_WRITABLE) event |= POLLOUT;
+ if (flags & DBUS_WATCH_READABLE)
+ event |= POLLIN;
+ if (flags & DBUS_WATCH_WRITABLE)
+ event |= POLLOUT;
}
std::map<DBusWatch*, sh_pollHandle_t>::iterator iterator = mMapHandleWatch.begin();
iterator = mMapHandleWatch.find(watch);
- if (iterator != mMapHandleWatch.end()) mSocketHandler->updateEventFlags(iterator->second, event);
+ if (iterator != mMapHandleWatch.end())
+ mSocketHandler->updateEventFlags(iterator->second, event);
DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("DBusWrapper::toogleWatchDelegate watch was toggeled"));
}
@@ -325,7 +335,8 @@ dbus_bool_t DBusWrapper::addTimeout(DBusTimeout *timeout, void* userData)
dbus_bool_t DBusWrapper::addTimeoutDelegate(DBusTimeout *timeout, void* userData)
{
- if (!dbus_timeout_get_enabled(timeout)) return false;
+ if (!dbus_timeout_get_enabled(timeout))
+ return false;
//calculate the timeout in timeval
timespec pollTimeout;
@@ -359,6 +370,7 @@ void DBusWrapper::removeTimeout(DBusTimeout *timeout, void* userData)
void DBusWrapper::removeTimeoutDelegate(DBusTimeout *timeout, void* userData)
{
+ (void) userData;
//get the pointer to the handle and remove the timer
sh_timerHandle_t* handle = (sh_timerHandle_t*) dbus_timeout_get_data(timeout);
mSocketHandler->removeTimer(*handle);
@@ -386,9 +398,12 @@ void DBusWrapper::toggleTimeout(DBusTimeout *timeout, void* userData)
bool am::DBusWrapper::dbusDispatchCallback(const sh_pollHandle_t handle, void *userData)
{
+ (void) handle;
+ (void) userData;
bool returnVal = true;
dbus_connection_ref(mDbusConnection);
- if (dbus_connection_dispatch(mDbusConnection) == DBUS_DISPATCH_COMPLETE) returnVal = false;
+ 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"));
return returnVal;
@@ -396,9 +411,12 @@ bool am::DBusWrapper::dbusDispatchCallback(const sh_pollHandle_t handle, void *u
bool am::DBusWrapper::dbusCheckCallback(const sh_pollHandle_t handle, void *userData)
{
+ (void) handle;
+ (void) userData;
bool returnVal = false;
dbus_connection_ref(mDbusConnection);
- if (dbus_connection_get_dispatch_status(mDbusConnection) == DBUS_DISPATCH_DATA_REMAINS) returnVal = true;
+ 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"));
return returnVal;
@@ -406,24 +424,31 @@ bool am::DBusWrapper::dbusCheckCallback(const sh_pollHandle_t handle, void *user
void am::DBusWrapper::dbusFireCallback(const pollfd pollfd, const sh_pollHandle_t handle, void *userData)
{
+ (void) handle;
+ (void) userData;
assert(userData!=NULL);
uint flags = 0;
- if (pollfd.revents & POLLIN) flags |= DBUS_WATCH_READABLE;
- if (pollfd.revents & POLLOUT) flags |= DBUS_WATCH_WRITABLE;
- if (pollfd.revents & POLLHUP) flags |= DBUS_WATCH_HANGUP;
- if (pollfd.revents & POLLERR) flags |= DBUS_WATCH_ERROR;
+ if (pollfd.revents & POLLIN)
+ flags |= DBUS_WATCH_READABLE;
+ if (pollfd.revents & POLLOUT)
+ flags |= DBUS_WATCH_WRITABLE;
+ if (pollfd.revents & POLLHUP)
+ flags |= DBUS_WATCH_HANGUP;
+ if (pollfd.revents & POLLERR)
+ flags |= DBUS_WATCH_ERROR;
DBusWatch *watch = (DBusWatch*) userData;
dbus_connection_ref(mDbusConnection);
- bool ok = dbus_watch_handle(watch, flags);
+ dbus_watch_handle(watch, flags);
dbus_connection_unref(mDbusConnection);
DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("DBusWrapper::dbusFireCallback was called"));
}
void DBusWrapper::toggleTimeoutDelegate(DBusTimeout *timeout, void* userData)
{
+ (void) userData;
//get the pointer to the handle and remove the timer
sh_timerHandle_t* handle = (sh_timerHandle_t*) dbus_timeout_get_data(timeout);
diff --git a/AudioManagerDaemon/src/DatabaseHandler.cpp b/AudioManagerDaemon/src/DatabaseHandler.cpp
index 5c834ee..fb1e5c6 100644
--- a/AudioManagerDaemon/src/DatabaseHandler.cpp
+++ b/AudioManagerDaemon/src/DatabaseHandler.cpp
@@ -2465,7 +2465,7 @@ am_Error_e am::DatabaseHandler::getListSinkConnectionFormats(const am_sinkID_t s
am_Error_e am::DatabaseHandler::getListSourceConnectionFormats(const am_sourceID_t sourceID, std::vector<am_ConnectionFormat_e> & listConnectionFormats) const
{
listConnectionFormats.clear();
- sqlite3_stmt* query = NULL, *qConnectionFormat = NULL, *qSoundProperty = NULL, *qMAinSoundProperty = NULL;
+ sqlite3_stmt* qConnectionFormat = NULL;
int eCode = 0;
am_ConnectionFormat_e tempConnectionFormat;
@@ -3109,8 +3109,6 @@ am_Error_e DatabaseHandler::changeConnectionTimingInformation(const am_connectio
}
//now we need to find all mainConnections that use the changed connection and update their timing
- am_timeSync_t tempDelay = 0;
- am_Error_e error;
int tempMainConnectionID;
//first get all route tables for all mainconnections
diff --git a/AudioManagerDaemon/src/DatabaseObserver.cpp b/AudioManagerDaemon/src/DatabaseObserver.cpp
index b09aee8..19e3ea2 100644
--- a/AudioManagerDaemon/src/DatabaseObserver.cpp
+++ b/AudioManagerDaemon/src/DatabaseObserver.cpp
@@ -72,6 +72,7 @@ void DatabaseObserver::newDomain(am_Domain_s domain)
void DatabaseObserver::newGateway(am_Gateway_s gateway)
{
+ (void) gateway;
//todo: implement something
}
@@ -99,6 +100,7 @@ void DatabaseObserver::removeDomain(am_domainID_t domainID)
void DatabaseObserver::removeGateway(am_gatewayID_t gatewayID)
{
+ (void) gatewayID;
//todo: implement something
}
diff --git a/AudioManagerDaemon/src/Router.cpp b/AudioManagerDaemon/src/Router.cpp
index aec487c..30d7f5f 100644
--- a/AudioManagerDaemon/src/Router.cpp
+++ b/AudioManagerDaemon/src/Router.cpp
@@ -113,8 +113,10 @@ am_Error_e Router::getRoute(const bool onlyfree, const am_sourceID_t sourceID, c
//Step through the routes and try to use always the best connectionFormat
std::vector<am_RoutingElement_s>::iterator routingInterator = actualRoutingElement.begin();
gatewayIterator = listGatewayID.begin();
- if (findBestWay(actualRoutingElement, routingInterator, gatewayIterator, 0) != E_OK)
+ if (findBestWay(actualRoutingElement, routingInterator, gatewayIterator) != E_OK)
+ {
continue;
+ }
//add the route to the list of routes...
actualRoute.sourceID = sourceID;
@@ -136,47 +138,61 @@ void Router::listPossibleConnectionFormats(const am_sourceID_t sourceID, const a
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, int choiceNumber)
+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)
{
+ am_Error_e returnError = E_NOT_POSSIBLE;
std::vector<am_ConnectionFormat_e> listConnectionFormats;
+ std::vector<am_ConnectionFormat_e> listMergeConnectionFormats;
std::vector<am_ConnectionFormat_e> listPriorityConnectionFormats;
- //get best connection format for the first connection, now
+ std::vector<am_RoutingElement_s>::iterator nextIterator = routeIterator + 1;
+ //get best connection format
listPossibleConnectionFormats(routeIterator->sourceID, routeIterator->sinkID, listConnectionFormats);
- //if we get to the point that no choice makes sense, return ...
- if (choiceNumber >= (int) listConnectionFormats.size())
- return (E_NOT_POSSIBLE);
-
//if we have not just started, we need to take care about the gateways...
if (routeIterator != listRoute.begin())
{
//since we have to deal with Gateways, there are restrictions what connectionFormat we can take. So we need to take the subset of connections that are restricted:
std::vector<am_ConnectionFormat_e> listRestrictedConnectionFormats;
- std::insert_iterator<std::vector<am_ConnectionFormat_e> > inserter(listConnectionFormats, listConnectionFormats.begin());
+ std::insert_iterator<std::vector<am_ConnectionFormat_e> > inserter(listMergeConnectionFormats, listMergeConnectionFormats.begin());
std::vector<am_RoutingElement_s>::iterator tempIterator(routeIterator);
tempIterator--;
listRestrictedOutputFormatsGateways(*gatewayIterator, (tempIterator)->connectionFormat, listRestrictedConnectionFormats);
set_intersection(listConnectionFormats.begin(), listConnectionFormats.end(), listRestrictedConnectionFormats.begin(), listRestrictedConnectionFormats.end(), inserter);
gatewayIterator++;
}
+ else
+ {
+ listMergeConnectionFormats = listConnectionFormats;
+ }
//let the controller decide:
- mControlSender->getConnectionFormatChoice(routeIterator->sourceID, routeIterator->sinkID, listConnectionFormats, listPriorityConnectionFormats);
+ mControlSender->getConnectionFormatChoice(routeIterator->sourceID, routeIterator->sinkID, listMergeConnectionFormats, listPriorityConnectionFormats);
+
+ //we have the list sorted after prios - now we try one after the other with the next part of the route
+ std::vector<am_ConnectionFormat_e>::iterator connectionFormatIterator = listPriorityConnectionFormats.begin();
- //go back one step, if we cannot find a format and take the next best!
- if (listPriorityConnectionFormats.empty())
+ //here we need to check if we are at the end and stop
+ if (nextIterator == listRoute.end())
{
- findBestWay(listRoute, --routeIterator, --gatewayIterator, ++choiceNumber);
+ if (!listPriorityConnectionFormats.empty())
+ {
+ routeIterator->connectionFormat = listPriorityConnectionFormats.front();
+ return E_OK;
+ }
+ else
+ return E_NOT_POSSIBLE;
}
- routeIterator->connectionFormat = listPriorityConnectionFormats.at(choiceNumber);
-
- //ok, we are through and found a way, if not, take the next part of the route and start with toplevel
- if (routeIterator < listRoute.end())
+ for (; connectionFormatIterator != listPriorityConnectionFormats.end(); ++connectionFormatIterator)
{
- findBestWay(listRoute, ++routeIterator, gatewayIterator, 0);
+ routeIterator->connectionFormat = *connectionFormatIterator;
+ if ((returnError = findBestWay(listRoute, nextIterator, gatewayIterator)) == E_OK)
+ {
+ break;
+ }
}
- return (E_OK);
+
+ return (returnError);
}
void Router::listRestrictedOutputFormatsGateways(const am_gatewayID_t gatewayID, const am_ConnectionFormat_e sinkConnectionFormat, std::vector<am_ConnectionFormat_e> & listFormats) const
diff --git a/AudioManagerDaemon/src/RoutingReceiver.cpp b/AudioManagerDaemon/src/RoutingReceiver.cpp
index 9a7263d..a6f35e7 100644
--- a/AudioManagerDaemon/src/RoutingReceiver.cpp
+++ b/AudioManagerDaemon/src/RoutingReceiver.cpp
@@ -319,12 +319,16 @@ am_Error_e RoutingReceiver::sendChangedData(const std::vector<am_EarlyData_s> &
am_Error_e RoutingReceiver::peekSinkClassID(const std::string name, const am_sinkClass_t& sinkClassID)
{
+ (void) name;
+ (void) sinkClassID;
//todo: implement
return E_NOT_USED;
}
am_Error_e RoutingReceiver::peekSourceClassID(const std::string name, const am_sourceClass_t& sourceClassID)
{
+ (void) name;
+ (void) sourceClassID;
//todo: implement
return E_NOT_USED;
}
diff --git a/AudioManagerDaemon/src/RoutingSender.cpp b/AudioManagerDaemon/src/RoutingSender.cpp
index acdb32f..ac99fb7 100644
--- a/AudioManagerDaemon/src/RoutingSender.cpp
+++ b/AudioManagerDaemon/src/RoutingSender.cpp
@@ -268,7 +268,7 @@ am_Error_e RoutingSender::asyncSetSinkSoundProperty(am_Handle_s& handle, const a
handleData.soundPropery = soundProperty;
handle = createHandle(handleData, H_SETSINKSOUNDPROPERTY);
mMapHandleInterface.insert(std::make_pair(handle.handle, iter->second));
- return iter->second->asyncSetSinkSoundProperty(handle, soundProperty, sinkID);
+ return iter->second->asyncSetSinkSoundProperty(handle, sinkID, soundProperty);
return (E_NON_EXISTENT);
}
@@ -282,7 +282,7 @@ am_Error_e RoutingSender::asyncSetSourceSoundProperty(am_Handle_s& handle, const
handleData.soundPropery = soundProperty;
handle = createHandle(handleData, H_SETSOURCESOUNDPROPERTY);
mMapHandleInterface.insert(std::make_pair(handle.handle, iter->second));
- return iter->second->asyncSetSourceSoundProperty(handle, soundProperty, sourceID);
+ return iter->second->asyncSetSourceSoundProperty(handle, sourceID, soundProperty);
return (E_NON_EXISTENT);
}
@@ -296,7 +296,7 @@ am_Error_e am::RoutingSender::asyncSetSourceSoundProperties(am_Handle_s& handle,
handleData.soundProperties = new std::vector<am_SoundProperty_s>(listSoundProperties);
handle = createHandle(handleData, H_SETSOURCESOUNDPROPERTIES);
mMapHandleInterface.insert(std::make_pair(handle.handle, iter->second));
- return iter->second->asyncSetSourceSoundProperties(handle, listSoundProperties, sourceID);
+ return iter->second->asyncSetSourceSoundProperties(handle, sourceID, listSoundProperties);
return (E_NON_EXISTENT);
}
@@ -310,7 +310,7 @@ am_Error_e am::RoutingSender::asyncSetSinkSoundProperties(am_Handle_s& handle, c
handleData.soundProperties = new std::vector<am_SoundProperty_s>(listSoundProperties);
handle = createHandle(handleData, H_SETSINKSOUNDPROPERTIES);
mMapHandleInterface.insert(std::make_pair(handle.handle, iter->second));
- return iter->second->asyncSetSinkSoundProperties(handle, listSoundProperties, sinkID);
+ return iter->second->asyncSetSinkSoundProperties(handle, sinkID, listSoundProperties);
return (E_NON_EXISTENT);
}
diff --git a/AudioManagerDaemon/src/TelnetServer.cpp b/AudioManagerDaemon/src/TelnetServer.cpp
index 36eac28..43fcc46 100644
--- a/AudioManagerDaemon/src/TelnetServer.cpp
+++ b/AudioManagerDaemon/src/TelnetServer.cpp
@@ -113,6 +113,8 @@ TelnetServer::~TelnetServer()
void TelnetServer::connectSocket(const pollfd pfd, const sh_pollHandle_t handle, void *userData)
{
+ (void) handle;
+ (void) userData;
//first, accept the connection, create a new filedescriptor
struct sockaddr answer;
socklen_t len = sizeof(answer);
@@ -131,6 +133,8 @@ void TelnetServer::connectSocket(const pollfd pfd, const sh_pollHandle_t handle,
void TelnetServer::receiveData(const pollfd pollfd, const sh_pollHandle_t handle, void *userData)
{
+ (void)handle;
+ (void)userData;
//initialize buffer
char buffer[100];
//read until buffer is full or no more data is there
@@ -145,6 +149,8 @@ void TelnetServer::receiveData(const pollfd pollfd, const sh_pollHandle_t handle
bool TelnetServer::dispatchData(const sh_pollHandle_t handle, void *userData)
{
+ (void)handle;
+ (void)userData;
std::vector<connection_s>::iterator iterator = mListConnections.begin();
for (; iterator != mListConnections.end(); ++iterator)
{
@@ -173,6 +179,8 @@ bool TelnetServer::dispatchData(const sh_pollHandle_t handle, void *userData)
bool TelnetServer::check(const sh_pollHandle_t handle, void *userData)
{
+ (void)handle;
+ (void)userData;
if (msgList.size() != 0) return true;
return false;
}
diff --git a/AudioManagerDaemon/src/main.cpp b/AudioManagerDaemon/src/main.cpp
index ab51cee..48b00a7 100644
--- a/AudioManagerDaemon/src/main.cpp
+++ b/AudioManagerDaemon/src/main.cpp
@@ -34,6 +34,7 @@
//todo: there is a bug in the visible flags of sinks and sources. fix it.
//todo: make sure that iterators have a fixed end to prevent crashed while adding vectors while iterating on critical vectors
//todo: make sure all configurations are tested
+//todo: clean up startup sequences controller, command and routing interfaces----
#include <config.h>
#include <SocketHandler.h>
#ifdef WITH_DBUS_WRAPPER
@@ -87,6 +88,7 @@ std::vector<std::string> listRoutingPluginDirs;
std::string databasePath = std::string(":memory:");
unsigned int telnetport = DEFAULT_TELNETPORT;
unsigned int maxConnections = MAX_TELNETCONNECTIONS;
+int fd0, fd1, fd2;
void daemonize()
{
@@ -126,9 +128,9 @@ void daemonize()
close(i);
}
- int fd0 = open("/dev/null", O_RDONLY);
- int fd1 = open("/dev/null", O_WRONLY | O_CREAT | O_APPEND, S_IRUSR | S_IWUSR);
- int fd2 = open("/dev/null", O_WRONLY | O_CREAT | O_APPEND, S_IRUSR | S_IWUSR);
+ fd0 = open("/dev/null", O_RDONLY);
+ fd1 = open("/dev/null", O_WRONLY | O_CREAT | O_APPEND, S_IRUSR | S_IWUSR);
+ fd2 = open("/dev/null", O_WRONLY | O_CREAT | O_APPEND, S_IRUSR | S_IWUSR);
if (fd0 != STDIN_FILENO || fd1 != STDOUT_FILENO || fd2 != STDERR_FILENO)
{
@@ -259,24 +261,25 @@ int main(int argc, char *argv[])
RoutingSender iRoutingSender(listRoutingPluginDirs);
CommandSender iCommandSender(listCommandPluginDirs);
ControlSender iControlSender(controllerPlugin);
+ Router iRouter(&iDatabaseHandler, &iControlSender);
#ifdef WITH_DBUS_WRAPPER
#ifdef WITH_SOCKETHANDLER_LOOP
CommandReceiver iCommandReceiver(&iDatabaseHandler, &iControlSender, &iSocketHandler, &iDBusWrapper);
RoutingReceiver iRoutingReceiver(&iDatabaseHandler, &iRoutingSender, &iControlSender, &iSocketHandler, &iDBusWrapper);
- ControlReceiver iControlReceiver(&iDatabaseHandler, &iRoutingSender, &iCommandSender, &iSocketHandler);
+ ControlReceiver iControlReceiver(&iDatabaseHandler, &iRoutingSender, &iCommandSender, &iSocketHandler, &iRouter);
#ifdef WITH_TELNET
TelnetServer iTelnetServer(&iSocketHandler,&iCommandSender,&iCommandReceiver,&iRoutingSender,&iRoutingReceiver,&iControlSender,&iControlReceiver,&iDatabaseHandler,telnetport,maxConnections);
#endif
#else /*WITH_SOCKETHANDLER_LOOP */
CommandReceiver iCommandReceiver(&iDatabaseHandler,&iControlSender,&iDBusWrapper);
RoutingReceiver iRoutingReceiver(&iDatabaseHandler,&iRoutingSender,&iControlSender,&iDBusWrapper);
- ControlReceiver iControlReceiver(&iDatabaseHandler,&iRoutingSender,&iCommandSender);
+ ControlReceiver iControlReceiver(&iDatabaseHandler,&iRoutingSender,&iCommandSender, &iRouter);
#endif /*WITH_SOCKETHANDLER_LOOP*/
#else /*WITH_DBUS_WRAPPER*/
CommandReceiver iCommandReceiver(&iDatabaseHandler,&iControlSender,&iSocketHandler);
RoutingReceiver iRoutingReceiver(&iDatabaseHandler,&iRoutingSender,&iControlSender,&iSocketHandler);
- ControlReceiver iControlReceiver(&iDatabaseHandler,&iRoutingSender,&iCommandSender,&iSocketHandler);
+ ControlReceiver iControlReceiver(&iDatabaseHandler,&iRoutingSender,&iCommandSender,&iSocketHandler, &iRouter);
#ifdef WITH_TELNET
TelnetServer iTelnetServer(&iSocketHandler,telnetport,maxConnections);
#endif
@@ -288,8 +291,6 @@ int main(int argc, char *argv[])
DatabaseObserver iObserver(&iCommandSender, &iRoutingSender);
#endif
- Router iRouter(&iDatabaseHandler,&iControlSender);
-
//since the plugins have been loaded by the *Senders before, we can tell the Controller this:
iControlSender.hookAllPluginsLoaded();
@@ -308,6 +309,9 @@ int main(int argc, char *argv[])
#endif/*WITH_SIMPLEDBUS_LOOP*/
#endif /*WITH_DBUS_WRAPPER*/
+ close(fd0);
+ close(fd1);
+ close(fd2);
exit(0);
}
diff --git a/AudioManagerDaemon/test/controlInterface/MockInterfaces.h b/AudioManagerDaemon/test/controlInterface/MockInterfaces.h
index 9ac325f..746d70e 100644
--- a/AudioManagerDaemon/test/controlInterface/MockInterfaces.h
+++ b/AudioManagerDaemon/test/controlInterface/MockInterfaces.h
@@ -53,13 +53,13 @@ class MockRoutingSendInterface : public RoutingSendInterface {
MOCK_METHOD3(asyncSetSourceState,
am_Error_e(const am_Handle_s handle, const am_sourceID_t sourceID, const am_SourceState_e state));
MOCK_METHOD3(asyncSetSinkSoundProperties,
- am_Error_e(const am_Handle_s handle, const std::vector<am_SoundProperty_s>& listSoundProperties, const am_sinkID_t sinkID));
+ am_Error_e(const am_Handle_s handle, const am_sinkID_t sinkID, const std::vector<am_SoundProperty_s>& listSoundProperties));
MOCK_METHOD3(asyncSetSinkSoundProperty,
- am_Error_e(const am_Handle_s handle, const am_SoundProperty_s& soundProperty, const am_sinkID_t sinkID));
+ am_Error_e(const am_Handle_s handle, const am_sinkID_t sinkID, const am_SoundProperty_s& soundProperty));
MOCK_METHOD3(asyncSetSourceSoundProperties,
- am_Error_e(const am_Handle_s handle, const std::vector<am_SoundProperty_s>& listSoundProperties, const am_sourceID_t sourceID));
+ am_Error_e(const am_Handle_s handle, const am_sourceID_t sourceID, const std::vector<am_SoundProperty_s>& listSoundProperties));
MOCK_METHOD3(asyncSetSourceSoundProperty,
- am_Error_e(const am_Handle_s handle, const am_SoundProperty_s& soundProperty, const am_sourceID_t sourceID));
+ am_Error_e(const am_Handle_s handle, const am_sourceID_t sourceID, const am_SoundProperty_s& soundProperty));
MOCK_METHOD5(asyncCrossFade,
am_Error_e(const am_Handle_s handle, const am_crossfaderID_t crossfaderID, const am_HotSink_e hotSink, const am_RampType_e rampType, const am_time_t time));
MOCK_METHOD2(setDomainState,
@@ -71,6 +71,7 @@ class MockRoutingSendInterface : public RoutingSendInterface {
};
+
class MockControlSendInterface : public ControlSendInterface {
public:
MOCK_METHOD1(startupController,
diff --git a/AudioManagerDaemon/test/controlInterface/controlInterfaceTest.cpp b/AudioManagerDaemon/test/controlInterface/controlInterfaceTest.cpp
index 5d3a4f1..c22f175 100644
--- a/AudioManagerDaemon/test/controlInterface/controlInterfaceTest.cpp
+++ b/AudioManagerDaemon/test/controlInterface/controlInterfaceTest.cpp
@@ -42,12 +42,13 @@ controlInterfaceTest::controlInterfaceTest() :
pCommandSender(plistCommandPluginDirs), //
pMockControlInterface(), //
pMockRoutingInterface(), //
- pControlSender(std::string("")), //
pRoutingInterfaceBackdoor(), //
pCommandInterfaceBackdoor(), //
pControlInterfaceBackdoor(), //
+ pControlSender(std::string("")), //
+ pRouter(&pDatabaseHandler,&pControlSender), //
pDatabaseObserver(&pCommandSender, &pRoutingSender), //
- pControlReceiver(&pDatabaseHandler, &pRoutingSender, &pCommandSender), //
+ pControlReceiver(&pDatabaseHandler, &pRoutingSender, &pCommandSender,&pRouter), //
pRoutingReceiver(&pDatabaseHandler, &pRoutingSender, &pControlSender, pDBusWrapper)
{
pDatabaseHandler.registerObserver(&pDatabaseObserver);
@@ -440,7 +441,7 @@ TEST_F(controlInterfaceTest,ackSetSinkSoundProperty)
ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(sink,sinkID));
//change the soundproperty, expect a call on the routinginterface
- EXPECT_CALL(pMockRoutingInterface,asyncSetSinkSoundProperty(_,_,2)).WillOnce(Return(E_OK));
+ EXPECT_CALL(pMockRoutingInterface,asyncSetSinkSoundProperty(_,2,_)).WillOnce(Return(E_OK));
ASSERT_EQ(E_OK, pControlReceiver.setSinkSoundProperty(handle,sink.sinkID,soundProperty));
//check the list of handles. The handle must be in there and have the right type
@@ -492,7 +493,7 @@ TEST_F(controlInterfaceTest,ackSetSourceSoundProperty)
ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(source,sourceID));
//we trigger the change and wait for a call on the routinginterface
- EXPECT_CALL(pMockRoutingInterface,asyncSetSourceSoundProperty(_,_,2)).WillOnce(Return(E_OK));
+ EXPECT_CALL(pMockRoutingInterface,asyncSetSourceSoundProperty(_,2,_)).WillOnce(Return(E_OK));
ASSERT_EQ(E_OK, pControlReceiver.setSourceSoundProperty(handle,source.sourceID,soundProperty));
//check the list of handles. The handle must be in there and have the right type
diff --git a/AudioManagerDaemon/test/controlInterface/controlInterfaceTest.h b/AudioManagerDaemon/test/controlInterface/controlInterfaceTest.h
index 1bc3ce8..0029d73 100644
--- a/AudioManagerDaemon/test/controlInterface/controlInterfaceTest.h
+++ b/AudioManagerDaemon/test/controlInterface/controlInterfaceTest.h
@@ -36,6 +36,7 @@
#include "DatabaseObserver.h"
#include "ControlSender.h"
#include "RoutingSender.h"
+#include "Router.h"
#include "../RoutingInterfaceBackdoor.h"
#include "../CommandInterfaceBackdoor.h"
#include "../ControlInterfaceBackdoor.h"
@@ -57,10 +58,11 @@ public:
CommandSender pCommandSender;
MockControlSendInterface pMockControlInterface;
MockRoutingSendInterface pMockRoutingInterface;
- ControlSender pControlSender;
RoutingInterfaceBackdoor pRoutingInterfaceBackdoor;
CommandInterfaceBackdoor pCommandInterfaceBackdoor;
ControlInterfaceBackdoor pControlInterfaceBackdoor;
+ ControlSender pControlSender;
+ Router pRouter;
DatabaseObserver pDatabaseObserver;
ControlReceiver pControlReceiver;
RoutingReceiver pRoutingReceiver;
diff --git a/AudioManagerDaemon/test/database/MockInterfaces.h b/AudioManagerDaemon/test/database/MockInterfaces.h
index 514c7cf..b48c8e8 100644
--- a/AudioManagerDaemon/test/database/MockInterfaces.h
+++ b/AudioManagerDaemon/test/database/MockInterfaces.h
@@ -70,10 +70,9 @@ class MockCommandSendInterface : public CommandSendInterface {
MOCK_METHOD1(cbSystemPropertyChanged,
void(const am_SystemProperty_s& systemProperty));
MOCK_METHOD2(cbTimingInformationChanged,
- void (const am_timeSync_t time, const am_mainConnectionID_t mainConnectionID));
+ void(const am_mainConnectionID_t mainConnectionID, const am_timeSync_t time));
MOCK_CONST_METHOD0(getInterfaceVersion,
uint16_t());
-
};
diff --git a/AudioManagerDaemon/test/database/databaseTest.cpp b/AudioManagerDaemon/test/database/databaseTest.cpp
index 9913011..064cc05 100644
--- a/AudioManagerDaemon/test/database/databaseTest.cpp
+++ b/AudioManagerDaemon/test/database/databaseTest.cpp
@@ -54,7 +54,9 @@ routingTest::routingTest() :
pMockInterface(), //
pRoutingInterfaceBackdoor(), //
pCommandInterfaceBackdoor(), //
- pControlReceiver(&pDatabaseHandler, &pRoutingSender, &pCommandSender), //
+ pControlSender(""),//
+ pRouter(&pDatabaseHandler,&pControlSender), //
+ pControlReceiver(&pDatabaseHandler, &pRoutingSender, &pCommandSender, &pRouter), //
pObserver(&pCommandSender, &pRoutingSender)
{
pDatabaseHandler.registerObserver(&pObserver);
diff --git a/AudioManagerDaemon/test/database/databaseTest.h b/AudioManagerDaemon/test/database/databaseTest.h
index 0d46b68..466567b 100644
--- a/AudioManagerDaemon/test/database/databaseTest.h
+++ b/AudioManagerDaemon/test/database/databaseTest.h
@@ -41,6 +41,8 @@
#include "ControlSender.h"
#include "DatabaseObserver.h"
#include "RoutingSender.h"
+#include "Router.h"
+#include "ControlSender.h"
#include "../ControlInterfaceBackdoor.h"
#include "../CommandInterfaceBackdoor.h"
#include "../CommonFunctions.h"
@@ -61,6 +63,8 @@ public:
MockCommandSendInterface pMockInterface;
RoutingInterfaceBackdoor pRoutingInterfaceBackdoor;
CommandInterfaceBackdoor pCommandInterfaceBackdoor;
+ ControlSender pControlSender;
+ Router pRouter;
ControlReceiver pControlReceiver;
DatabaseObserver pObserver;
CommonFunctions pCF;
diff --git a/AudioManagerDaemon/test/routing/MockInterfaces.h b/AudioManagerDaemon/test/routing/MockInterfaces.h
index 9ece31c..ac7b839 100644
--- a/AudioManagerDaemon/test/routing/MockInterfaces.h
+++ b/AudioManagerDaemon/test/routing/MockInterfaces.h
@@ -71,7 +71,7 @@ class MockCommandSendInterface : public CommandSendInterface {
MOCK_METHOD1(cbSystemPropertyChanged,
void(const am_SystemProperty_s& systemProperty));
MOCK_METHOD2(cbTimingInformationChanged,
- void(const am_timeSync_t time, const am_mainConnectionID_t mainConnectionID));
+ void(const am_mainConnectionID_t mainConnectionID, const am_timeSync_t time));
MOCK_CONST_METHOD0(getInterfaceVersion,
uint16_t());
};
diff --git a/AudioManagerDaemon/test/routing/routingTest.cpp b/AudioManagerDaemon/test/routing/routingTest.cpp
index 2950255..2ed2c9b 100644
--- a/AudioManagerDaemon/test/routing/routingTest.cpp
+++ b/AudioManagerDaemon/test/routing/routingTest.cpp
@@ -29,6 +29,7 @@
#include "ControlReceiver.h"
#include "ControlSender.h"
#include "DatabaseObserver.h"
+#include "Router.h"
#include "../ControlInterfaceBackdoor.h"
#include "../CommandInterfaceBackdoor.h"
#include "../CommonFunctions.h"
@@ -39,13 +40,6 @@ 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);
-extern bool equalRoutingElement(const am_RoutingElement_s a, const am_RoutingElement_s b);
-extern bool equalClassProperties(const am_ClassProperty_s a, const am_ClassProperty_s b);
-extern std::string int2string(int i);
-
routingTest::routingTest() :
plistRoutingPluginDirs(), //
plistCommandPluginDirs(), //
@@ -59,7 +53,7 @@ routingTest::routingTest() :
pRoutingInterfaceBackdoor(), //
pCommandInterfaceBackdoor(), //
pControlInterfaceBackdoor(), //
- pControlReceiver(&pDatabaseHandler, &pRoutingSender, &pCommandSender), //
+ pControlReceiver(&pDatabaseHandler, &pRoutingSender, &pCommandSender, &pRouter), //
pObserver(&pCommandSender, &pRoutingSender)
{
pDatabaseHandler.registerObserver(&pObserver);
@@ -88,18 +82,16 @@ ACTION(returnConnectionFormat)
arg3=arg2;
}
-
-
-//test that checks just 2 domains, one sink one source with only one connection format each
-TEST_F(routingTest,simpleRoute2Domains)
+//test that checks 3 domains, one sink one source but the connectionformat of third domains do not fit.
+TEST_F(routingTest,simpleRoute3DomainsNoConnection)
{
- EXPECT_CALL(pMockInterface,cbNumberOfSourcesChanged()).Times(2);
- EXPECT_CALL(pMockInterface,cbNumberOfSinksChanged()).Times(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;
- am_domainID_t domainID1, domainID2;
+ am_Domain_s domain1, domain2, domain3;
+ am_domainID_t domainID1, domainID2, domainID3;
domain1.domainID = 0;
domain1.name = "domain1";
@@ -109,52 +101,73 @@ TEST_F(routingTest,simpleRoute2Domains)
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;
- am_sourceID_t sourceID, gwSourceID;
+ 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_ANALOG);
+ 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_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;
- am_sinkID_t sinkID, gwSinkID;
+ am_Sink_s sink, gwSink, gwSink1;
+ am_sinkID_t sinkID, gwSinkID, gwSinkID1;
- sink.domainID = domainID2;
+ sink.domainID = domainID3;
sink.name = "sink1";
sink.sinkID = 0;
sink.sinkClassID = 5;
sink.muteState = MS_MUTED;
- sink.listConnectionFormats.push_back(CF_MONO);
+ sink.listConnectionFormats.push_back(CF_STEREO);
gwSink.domainID = domainID1;
gwSink.name = "gwSink";
gwSink.sinkID = 0;
gwSink.sinkClassID = 5;
gwSink.muteState = MS_MUTED;
- gwSink.listConnectionFormats.push_back(CF_ANALOG);
+ 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;
- am_gatewayID_t gatewayID;
+ am_Gateway_s gateway, gateway1;
+ am_gatewayID_t gatewayID, gatewayID1;
gateway.controlDomainID = domainID1;
gateway.gatewayID = 0;
@@ -167,25 +180,44 @@ TEST_F(routingTest,simpleRoute2Domains)
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.sinkID = gwSinkID;
hopp1.sourceID = sourceID;
+ hopp1.sinkID = gwSinkID;
hopp1.domainID = domainID1;
hopp1.connectionFormat = source.listConnectionFormats[0];
- hopp2.sinkID = sinkID;
hopp2.sourceID = gwSourceID;
+ hopp2.sinkID = gwSinkID1;
hopp2.domainID = domainID2;
- hopp2.connectionFormat = sink.listConnectionFormats[0];
+ 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;
@@ -193,13 +225,10 @@ TEST_F(routingTest,simpleRoute2Domains)
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]));
-
+ ASSERT_EQ(0, listRoutes.size());
}
-
-//test that checks just 2 domains, one sink one source but the connectionformat of source
-TEST_F(routingTest,simpleRoute2DomainsNoMatchConnectionFormats)
+//test that checks just 2 domains, one sink one source with only one connection format each
+TEST_F(routingTest,simpleRoute2Domains)
{
EXPECT_CALL(pMockInterface,cbNumberOfSourcesChanged()).Times(2);
EXPECT_CALL(pMockInterface,cbNumberOfSinksChanged()).Times(2);
@@ -229,7 +258,7 @@ TEST_F(routingTest,simpleRoute2DomainsNoMatchConnectionFormats)
source.sourceState = SS_ON;
source.sourceID = 0;
source.sourceClassID = 5;
- source.listConnectionFormats.push_back(CF_STEREO);
+ source.listConnectionFormats.push_back(CF_ANALOG);
gwSource.domainID = domainID2;
gwSource.name = "gwsource1";
@@ -301,19 +330,21 @@ TEST_F(routingTest,simpleRoute2DomainsNoMatchConnectionFormats)
compareRoute.sourceID = sourceID;
ASSERT_EQ(E_OK, pRouter.getRoute(false,sourceID,sinkID,listRoutes));
- ASSERT_EQ(0, listRoutes.size());
+ ASSERT_EQ(1, listRoutes.size());
+ ASSERT_TRUE(pCF.compareRoute(compareRoute,listRoutes[0]));
+
}
-//test that checks 3 domains, one sink one source.
-TEST_F(routingTest,simpleRoute3Domains)
+//test that checks just 2 domains, one sink one source but the connectionformat of source
+TEST_F(routingTest,simpleRoute2DomainsNoMatchConnectionFormats)
{
- EXPECT_CALL(pMockInterface,cbNumberOfSourcesChanged()).Times(3);
- EXPECT_CALL(pMockInterface,cbNumberOfSinksChanged()).Times(3);
+ EXPECT_CALL(pMockInterface,cbNumberOfSourcesChanged()).Times(2);
+ EXPECT_CALL(pMockInterface,cbNumberOfSinksChanged()).Times(2);
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;
+ am_Domain_s domain1, domain2;
+ am_domainID_t domainID1, domainID2;
domain1.domainID = 0;
domain1.name = "domain1";
@@ -323,47 +354,34 @@ TEST_F(routingTest,simpleRoute3Domains)
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;
+ am_Source_s source, gwSource;
+ am_sourceID_t sourceID, gwSourceID;
source.domainID = domainID1;
source.name = "source1";
source.sourceState = SS_ON;
source.sourceID = 0;
source.sourceClassID = 5;
- source.listConnectionFormats.push_back(CF_MONO);
+ source.listConnectionFormats.push_back(CF_STEREO);
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);
+ gwSource.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;
+ am_Sink_s sink, gwSink;
+ am_sinkID_t sinkID, gwSinkID;
- sink.domainID = domainID3;
+ sink.domainID = domainID2;
sink.name = "sink1";
sink.sinkID = 0;
sink.sinkClassID = 5;
@@ -375,21 +393,13 @@ TEST_F(routingTest,simpleRoute3Domains)
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);
+ gwSink.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;
+ am_Gateway_s gateway;
+ am_gatewayID_t gatewayID;
gateway.controlDomainID = domainID1;
gateway.gatewayID = 0;
@@ -402,44 +412,25 @@ TEST_F(routingTest,simpleRoute3Domains)
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.sourceID = sourceID;
hopp1.domainID = domainID1;
hopp1.connectionFormat = source.listConnectionFormats[0];
+ hopp2.sinkID = sinkID;
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];
+ hopp2.connectionFormat = sink.listConnectionFormats[0];
listRoutingElements.push_back(hopp1);
listRoutingElements.push_back(hopp2);
- listRoutingElements.push_back(hopp3);
am_Route_s compareRoute;
compareRoute.route = listRoutingElements;
@@ -447,12 +438,11 @@ TEST_F(routingTest,simpleRoute3Domains)
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]));
+ ASSERT_EQ(0, listRoutes.size());
}
-//test that checks 3 domains, one sink one source but the connectionformat of third domains do not fit.
-TEST_F(routingTest,simpleRoute3DomainsNoConnection)
+//test that checks 3 domains, one sink one source.
+TEST_F(routingTest,simpleRoute3Domains)
{
EXPECT_CALL(pMockInterface,cbNumberOfSourcesChanged()).Times(3);
EXPECT_CALL(pMockInterface,cbNumberOfSinksChanged()).Times(3);
@@ -515,7 +505,7 @@ TEST_F(routingTest,simpleRoute3DomainsNoConnection)
sink.sinkID = 0;
sink.sinkClassID = 5;
sink.muteState = MS_MUTED;
- sink.listConnectionFormats.push_back(CF_STEREO);
+ sink.listConnectionFormats.push_back(CF_MONO);
gwSink.domainID = domainID1;
gwSink.name = "gwSink";
@@ -594,7 +584,7 @@ TEST_F(routingTest,simpleRoute3DomainsNoConnection)
compareRoute.sourceID = sourceID;
ASSERT_EQ(E_OK, pRouter.getRoute(false,sourceID,sinkID,listRoutes));
- ASSERT_EQ(0, listRoutes.size());
+ ASSERT_EQ(1, listRoutes.size());
ASSERT_TRUE(pCF.compareRoute(compareRoute,listRoutes[0]));
}
diff --git a/AudioManagerDaemon/test/routingInterface/MockRoutingInterface.h b/AudioManagerDaemon/test/routingInterface/MockRoutingInterface.h
index 850d90c..6c93507 100644
--- a/AudioManagerDaemon/test/routingInterface/MockRoutingInterface.h
+++ b/AudioManagerDaemon/test/routingInterface/MockRoutingInterface.h
@@ -53,13 +53,13 @@ class MockRoutingSendInterface : public RoutingSendInterface {
MOCK_METHOD3(asyncSetSourceState,
am_Error_e(const am_Handle_s handle, const am_sourceID_t sourceID, const am_SourceState_e state));
MOCK_METHOD3(asyncSetSinkSoundProperties,
- am_Error_e(const am_Handle_s handle, const std::vector<am_SoundProperty_s>& listSoundProperties, const am_sinkID_t sinkID));
+ am_Error_e(const am_Handle_s handle, const am_sinkID_t sinkID, const std::vector<am_SoundProperty_s>& listSoundProperties));
MOCK_METHOD3(asyncSetSinkSoundProperty,
- am_Error_e(const am_Handle_s handle, const am_SoundProperty_s& soundProperty, const am_sinkID_t sinkID));
+ am_Error_e(const am_Handle_s handle, const am_sinkID_t sinkID, const am_SoundProperty_s& soundProperty));
MOCK_METHOD3(asyncSetSourceSoundProperties,
- am_Error_e(const am_Handle_s handle, const std::vector<am_SoundProperty_s>& listSoundProperties, const am_sourceID_t sourceID));
+ am_Error_e(const am_Handle_s handle, const am_sourceID_t sourceID, const std::vector<am_SoundProperty_s>& listSoundProperties));
MOCK_METHOD3(asyncSetSourceSoundProperty,
- am_Error_e(const am_Handle_s handle, const am_SoundProperty_s& soundProperty, const am_sourceID_t sourceID));
+ am_Error_e(const am_Handle_s handle, const am_sourceID_t sourceID, const am_SoundProperty_s& soundProperty));
MOCK_METHOD5(asyncCrossFade,
am_Error_e(const am_Handle_s handle, const am_crossfaderID_t crossfaderID, const am_HotSink_e hotSink, const am_RampType_e rampType, const am_time_t time));
MOCK_METHOD2(setDomainState,
@@ -69,7 +69,6 @@ class MockRoutingSendInterface : public RoutingSendInterface {
MOCK_CONST_METHOD0(getInterfaceVersion,
uint16_t());
};
-
} // namespace am
diff --git a/AudioManagerDaemon/test/routingInterface/routingInterfaceTest.cpp b/AudioManagerDaemon/test/routingInterface/routingInterfaceTest.cpp
index 6ebd99d..5adb863 100644
--- a/AudioManagerDaemon/test/routingInterface/routingInterfaceTest.cpp
+++ b/AudioManagerDaemon/test/routingInterface/routingInterfaceTest.cpp
@@ -28,7 +28,7 @@
using namespace am;
using namespace testing;
-DLT_DECLARE_CONTEXT(DLT_CONTEXT);
+DLT_DECLARE_CONTEXT(DLT_CONTEXT)
routingInterfaceTest::routingInterfaceTest() :
plistRoutingPluginDirs(), //
@@ -36,10 +36,12 @@ routingInterfaceTest::routingInterfaceTest() :
pDatabaseHandler(std::string(":memory:")), //
pRoutingSender(plistRoutingPluginDirs), //
pCommandSender(plistCommandPluginDirs), //
+ pControlSender(""), //
+ pRouter(&pDatabaseHandler, &pControlSender), //
pMockInterface(), //
pRoutingInterfaceBackdoor(), //
pCommandInterfaceBackdoor(), //
- pControlReceiver(&pDatabaseHandler, &pRoutingSender, &pCommandSender), //
+ pControlReceiver(&pDatabaseHandler, &pRoutingSender, &pCommandSender, &pRouter), //
pObserver(&pCommandSender, &pRoutingSender)
{
pDatabaseHandler.registerObserver(&pObserver);
@@ -160,7 +162,7 @@ TEST_F(routingInterfaceTest,setSinkSoundPropertyNoChange)
sink.listSoundProperties.push_back(soundProperty);
ASSERT_EQ(E_OK, pDatabaseHandler.enterDomainDB(domain,domainID));
ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(sink,sinkID));
- EXPECT_CALL(pMockInterface,asyncSetSinkSoundProperty(_,_,sinkID)).Times(0);
+ EXPECT_CALL(pMockInterface,asyncSetSinkSoundProperty(_,sinkID,_)).Times(0);
ASSERT_EQ(E_NO_CHANGE, pControlReceiver.setSinkSoundProperty(handle,sinkID,soundProperty));
}
@@ -203,7 +205,7 @@ TEST_F(routingInterfaceTest,setSourceSoundProperty)
source.domainID = 1;
ASSERT_EQ(E_OK, pDatabaseHandler.enterDomainDB(domain,domainID));
ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(source,sourceID));
- EXPECT_CALL(pMockInterface,asyncSetSourceSoundProperty(_,_,sourceID)).WillOnce(Return(E_OK));
+ EXPECT_CALL(pMockInterface,asyncSetSourceSoundProperty(_,sourceID,_)).WillOnce(Return(E_OK));
ASSERT_EQ(E_OK, pControlReceiver.setSourceSoundProperty(handle,sourceID,soundProperty));
ASSERT_NE(handle.handle, 0);
ASSERT_EQ(handle.handleType, H_SETSOURCESOUNDPROPERTY);
@@ -229,7 +231,7 @@ TEST_F(routingInterfaceTest,setSinkSoundProperty)
sink.domainID = 1;
ASSERT_EQ(E_OK, pDatabaseHandler.enterDomainDB(domain,domainID));
ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(sink,sinkID));
- EXPECT_CALL(pMockInterface,asyncSetSinkSoundProperty(_,_,sinkID)).WillOnce(Return(E_OK));
+ EXPECT_CALL(pMockInterface,asyncSetSinkSoundProperty(_,sinkID,_)).WillOnce(Return(E_OK));
ASSERT_EQ(E_OK, pControlReceiver.setSinkSoundProperty(handle,sinkID,soundProperty));
ASSERT_NE(handle.handle, 0);
ASSERT_EQ(handle.handleType, H_SETSINKSOUNDPROPERTY);
diff --git a/AudioManagerDaemon/test/routingInterface/routingInterfaceTest.h b/AudioManagerDaemon/test/routingInterface/routingInterfaceTest.h
index 4da9643..8ad77eb 100644
--- a/AudioManagerDaemon/test/routingInterface/routingInterfaceTest.h
+++ b/AudioManagerDaemon/test/routingInterface/routingInterfaceTest.h
@@ -38,6 +38,7 @@
#include "ControlReceiver.h"
#include "ControlSender.h"
#include "DatabaseObserver.h"
+#include "Router.h"
#include "../RoutingInterfaceBackdoor.h"
#include "../CommandInterfaceBackdoor.h"
#include "../CommonFunctions.h"
@@ -55,6 +56,8 @@ public:
DatabaseHandler pDatabaseHandler;
RoutingSender pRoutingSender;
CommandSender pCommandSender;
+ ControlSender pControlSender;
+ Router pRouter;
MockRoutingSendInterface pMockInterface;
RoutingInterfaceBackdoor pRoutingInterfaceBackdoor;
CommandInterfaceBackdoor pCommandInterfaceBackdoor;
diff --git a/AudioManagerDaemon/test/sockethandler/sockethandlerTest.cpp b/AudioManagerDaemon/test/sockethandler/sockethandlerTest.cpp
index 5c23789..0ac36fa 100644
--- a/AudioManagerDaemon/test/sockethandler/sockethandlerTest.cpp
+++ b/AudioManagerDaemon/test/sockethandler/sockethandlerTest.cpp
@@ -23,8 +23,6 @@ using namespace am;
DLT_DECLARE_CONTEXT(AudioManager)
-static volatile sig_atomic_t gDispatch = 1; //this global is used to stop the mainloop
-
sockethandlerTest::sockethandlerTest()
{
}
@@ -49,6 +47,8 @@ am::timerCallBack::~timerCallBack()
void am::timerCallBack::timer1Callback(sh_timerHandle_t handle, void* userData)
{
+ (void) handle;
+ (void) userData;
std::cout << "callback1 called" << std::endl;
timespec timeout;
timeout.tv_nsec = 0;
@@ -60,6 +60,8 @@ void am::timerCallBack::timer1Callback(sh_timerHandle_t handle, void* userData)
void am::timerCallBack::timer2Callback(sh_timerHandle_t handle, void* userData)
{
+ (void) handle;
+ (void) userData;
std::cout << "callback2 called" << std::endl;
timespec timeout;
timeout.tv_nsec = 0;
@@ -71,35 +73,40 @@ void am::timerCallBack::timer2Callback(sh_timerHandle_t handle, void* userData)
void am::timerCallBack::timer3Callback(sh_timerHandle_t, void* userData)
{
+ (void) userData;
std::cout << "callback3 called" << std::endl;
}
void am::timerCallBack::timer4Callback(sh_timerHandle_t, void* userData)
{
+ (void) userData;
std::cout << "callback4 called" << std::endl;
mSocketHandler->stop_listening();
}
void* playWithSocketServer(void* data)
{
+ (void) data;
SocketHandler myHandler;
SamplePlugin::sockType_e type = SamplePlugin::INET;
SamplePlugin myplugin(&myHandler, type);
myHandler.start_listenting();
+ return (NULL);
}
void* playWithUnixSocketServer(void* data)
{
+ (void) data;
SocketHandler myHandler;
SamplePlugin::sockType_e type = SamplePlugin::UNIX;
SamplePlugin myplugin(&myHandler, type);
myHandler.start_listenting();
+ return (NULL);
}
TEST(sockethandlerTest,playWithUNIXSockets)
{
pthread_t serverThread;
- char buffer[3000];
struct sockaddr_un servAddr;
int socket_;
@@ -135,7 +142,6 @@ TEST(sockethandlerTest,playWithUNIXSockets)
TEST(sockethandlerTest,playWithSockets)
{
pthread_t serverThread;
- char buffer[3000];
struct sockaddr_in servAddr;
unsigned short servPort = 6060;
struct hostent *host;
@@ -154,7 +160,7 @@ TEST(sockethandlerTest,playWithSockets)
if ((host = (struct hostent*) gethostbyname("localhost")) == 0)
{
std::cout << "ERROR: gethostbyname() failed\n" << std::endl;
-
+ exit(1);
}
memset(&servAddr, 0, sizeof(servAddr));
@@ -229,7 +235,6 @@ am::SamplePlugin::SamplePlugin(SocketHandler *mySocketHandler, sockType_e socket
mReceiveHandle(), //
msgList()
{
- int ret;
int yes = 1;
int socketHandle;
@@ -276,6 +281,8 @@ am::SamplePlugin::SamplePlugin(SocketHandler *mySocketHandler, sockType_e socket
void am::SamplePlugin::connectSocket(const pollfd pollfd1, const sh_pollHandle_t handle, void *userData)
{
+ (void) handle;
+ (void) userData;
//first, accept the connection, create a new filedescriptor
std::cout << "Got a connection request !" << std::endl;
struct sockaddr answer;
@@ -293,6 +300,8 @@ void am::SamplePlugin::connectSocket(const pollfd pollfd1, const sh_pollHandle_t
void am::SamplePlugin::receiveData(const pollfd pollfd, const sh_pollHandle_t handle, void *userData)
{
+ (void) handle;
+ (void) userData;
//initialize buffer
char buffer[10];
//read until buffer is full or no more data is there
@@ -308,6 +317,8 @@ void am::SamplePlugin::receiveData(const pollfd pollfd, const sh_pollHandle_t ha
bool am::SamplePlugin::dispatchData(const sh_pollHandle_t handle, void *userData)
{
+ (void) handle;
+ (void) userData;
//read data from the queue
std::cout << "Data:" << msgList.front() << std::endl;
@@ -318,15 +329,19 @@ bool am::SamplePlugin::dispatchData(const sh_pollHandle_t handle, void *userData
}
//remove the message from the queue and return false if there is no more message to read.
msgList.pop();
- if (msgList.size() != 0) return true;
+ if (msgList.size() != 0)
+ return true;
return false;
}
bool am::SamplePlugin::check(const sh_pollHandle_t handle, void *userData)
{
+ (void) handle;
+ (void) userData;
//checks if there is data to dispatch
std::cout << "check!:" << std::endl;
- if (msgList.size() != 0) return true;
+ if (msgList.size() != 0)
+ return true;
return false;
}
diff --git a/CHANGELOG b/CHANGELOG
index 088864e..5631de8 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,22 @@
+commit 002295bee9b1a4b4b97060458be4ab8d4cb43eda
+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.
+
+commit 93c6b1973d59ce225e9cb5d2bcaea7d01c5fda52
+Author: christian mueller <christian.ei.mueller@bmw.de>
+
+ * routing algorithm improvements
+ * routing algorithms first tests
+
+commit af0ba5b505b361679c07899187b7043d867742c3
+Author: christian mueller <christian.ei.mueller@bmw.de>
+
+ * finalized Router implementation
+ * added new generated ControlSendInterface with router support
+
commit 4fe50302a695c625d5161b538da771b2c36bd33e
Author: christian mueller <christian.ei.mueller@bmw.de>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2bb1046..275e536 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -50,9 +50,6 @@ OPTION( WITH_PLUGIN_CONTROL
OPTION( WITH_PLUGIN_ROUTING
"Build routing pluings" ON)
-OPTION( USE_BUILD_LIBS
- "Sets the default path to the libs that are compiled with the AudioManager together. If turned off, the default location will be the one of the install path" OFF)
-
OPTION( WITH_MAIN
"Build with daemon" ON)
@@ -126,6 +123,7 @@ 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")
if(WITH_PLUGIN_COMMAND)
diff --git a/PluginCommandInterfaceDbus/include/DBusCommandSender.h b/PluginCommandInterfaceDbus/include/DBusCommandSender.h
index 3a01c14..215a9e9 100644
--- a/PluginCommandInterfaceDbus/include/DBusCommandSender.h
+++ b/PluginCommandInterfaceDbus/include/DBusCommandSender.h
@@ -67,7 +67,7 @@ public:
void cbVolumeChanged(const am_sinkID_t sinkID, const am_mainVolume_t volume);
void cbSinkMuteStateChanged(const am_sinkID_t sinkID, const am_MuteState_e muteState);
void cbSystemPropertyChanged(const am_SystemProperty_s& SystemProperty);
- void cbTimingInformationChanged(const am_timeSync_t time, const am_mainConnectionID_t mainConnectionID);
+ void cbTimingInformationChanged(const am_mainConnectionID_t mainConnectionID, const am_timeSync_t time);
uint16_t getInterfaceVersion() const;
#ifdef UNIT_TEST
diff --git a/PluginCommandInterfaceDbus/src/DBusCommandSender.cpp b/PluginCommandInterfaceDbus/src/DBusCommandSender.cpp
index bbc2778..3c1afd6 100644
--- a/PluginCommandInterfaceDbus/src/DBusCommandSender.cpp
+++ b/PluginCommandInterfaceDbus/src/DBusCommandSender.cpp
@@ -269,7 +269,7 @@ void DbusCommandSender::cbSystemPropertyChanged(const am_SystemProperty_s & Syst
mDBUSMessageHandler.sendMessage();
}
-void am::DbusCommandSender::cbTimingInformationChanged(const am_timeSync_t time, const am_mainConnectionID_t mainConnectionID)
+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));
diff --git a/PluginCommandInterfaceDbus/test/dbuscommandpluginInterfaceTest.cpp b/PluginCommandInterfaceDbus/test/dbuscommandpluginInterfaceTest.cpp
index d1faced..1ba6a30 100644
--- a/PluginCommandInterfaceDbus/test/dbuscommandpluginInterfaceTest.cpp
+++ b/PluginCommandInterfaceDbus/test/dbuscommandpluginInterfaceTest.cpp
@@ -44,6 +44,7 @@ void* run_the_loop(void* wrapper)
{
DBusWrapper* wrap=(DBusWrapper*)wrapper;
wrap->dbusMainLoop();
+ return (NULL);
}
dbuscommandpluginInterfaceTest::dbuscommandpluginInterfaceTest()
diff --git a/PluginCommandInterfaceDbus/test/dbuscommaninterfacesignalsTest.cpp b/PluginCommandInterfaceDbus/test/dbuscommaninterfacesignalsTest.cpp
index a46a59e..1c90d55 100644
--- a/PluginCommandInterfaceDbus/test/dbuscommaninterfacesignalsTest.cpp
+++ b/PluginCommandInterfaceDbus/test/dbuscommaninterfacesignalsTest.cpp
@@ -1,33 +1,32 @@
/**
-* Copyright (C) 2011, BMW AG
-*
-* GeniviAudioMananger AudioManagerDaemon
-*
-* \file dbuscommandinterfacesignalsTest.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.
-*
-* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
-*/
-
+ * Copyright (C) 2011, BMW AG
+ *
+ * GeniviAudioMananger AudioManagerDaemon
+ *
+ * \file dbuscommandinterfacesignalsTest.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.
+ *
+ * THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
+ */
#include "dbuscommaninterfacesignalsTest.h"
#include <iostream>
#include <fstream>
-#include <Python.h>
+#include <python2.6/Python.h>
#include "../include/DBusCommandSender.h"
#include "../include/DBusMessageHandler.h"
#include "DbusCommandInterfaceBackdoor.h"
@@ -40,889 +39,871 @@ 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 "));
+ 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 "));
}
dbuscommaninterfacesignalsTest::~dbuscommaninterfacesignalsTest()
{
- DLT_UNREGISTER_CONTEXT(DLT_CONTEXT);
+ DLT_UNREGISTER_CONTEXT(DLT_CONTEXT);
}
void* NumberOfMainConnectionsChanged(void*)
{
- sleep(1);
- DbusCommandSender sender;
- MockCommandReceiveInterface receiver;
- DbusCommandInterfaceBackdoor backdoor;
- backdoor.setReceiveInterface(&sender,&receiver);
- DBusError error;
- dbus_error_init(&error);
- DBusConnection* co=dbus_bus_get(DBUS_BUS_SESSION, &error);
- backdoor.setDbusConnection(&sender,co);
- sender.cbNumberOfMainConnectionsChanged();
+ sleep(1);
+ DbusCommandSender sender;
+ MockCommandReceiveInterface receiver;
+ DbusCommandInterfaceBackdoor backdoor;
+ backdoor.setReceiveInterface(&sender, &receiver);
+ DBusError error;
+ dbus_error_init(&error);
+ DBusConnection* co = dbus_bus_get(DBUS_BUS_SESSION, &error);
+ backdoor.setDbusConnection(&sender, co);
+ sender.cbNumberOfMainConnectionsChanged();
+ return (NULL);
}
void* cbSinkAdded(void*)
{
- sleep(1);
- std::vector<am_SinkType_s> list;
- am_SinkType_s mysink;
- mysink.name="MySink";
- mysink.sinkID=23;
- mysink.availability.availability=A_MAX;
- mysink.availability.availabilityReason=AR_MIN;
- mysink.muteState=MS_MIN;
- mysink.sinkClassID=3;
- mysink.volume=234;
- list.push_back(mysink);
- DbusCommandSender sender;
- MockCommandReceiveInterface receiver;
- EXPECT_CALL(receiver,getListMainSinks(_)).WillOnce(DoAll(SetArgReferee<0>(list),Return(E_OK)));
- DbusCommandInterfaceBackdoor backdoor;
- backdoor.setReceiveInterface(&sender,&receiver);
- DBusError error;
- dbus_error_init(&error);
- DBusConnection* co=dbus_bus_get(DBUS_BUS_SESSION, &error);
- backdoor.setDbusConnection(&sender,co);
- sender.cbNumberOfSinksChanged();
+ sleep(1);
+ std::vector<am_SinkType_s> list;
+ am_SinkType_s mysink;
+ mysink.name = "MySink";
+ mysink.sinkID = 23;
+ mysink.availability.availability = A_MAX;
+ mysink.availability.availabilityReason = AR_MIN;
+ mysink.muteState = MS_MIN;
+ mysink.sinkClassID = 3;
+ mysink.volume = 234;
+ list.push_back(mysink);
+ DbusCommandSender sender;
+ MockCommandReceiveInterface receiver;
+ EXPECT_CALL(receiver,getListMainSinks(_)).WillOnce(DoAll(SetArgReferee<0>(list), Return(E_OK)));
+ DbusCommandInterfaceBackdoor backdoor;
+ backdoor.setReceiveInterface(&sender, &receiver);
+ DBusError error;
+ dbus_error_init(&error);
+ DBusConnection* co = dbus_bus_get(DBUS_BUS_SESSION, &error);
+ backdoor.setDbusConnection(&sender, co);
+ sender.cbNumberOfSinksChanged();
+ return (NULL);
}
void* cbSourceAdded(void*)
{
- sleep(1);
- std::vector<am_SourceType_s> list;
- am_SourceType_s myource;
- myource.name="MySink";
- myource.sourceID=42;
- myource.availability.availability=A_MAX;
- myource.availability.availabilityReason=AR_MIN;
- myource.sourceClassID=15;
- list.push_back(myource);
- DbusCommandSender sender;
- MockCommandReceiveInterface receiver;
- DbusCommandInterfaceBackdoor backdoor;
- backdoor.setReceiveInterface(&sender,&receiver);
- DBusError error;
- dbus_error_init(&error);
- DBusConnection* co=dbus_bus_get(DBUS_BUS_SESSION, &error);
- backdoor.setDbusConnection(&sender,co);
- EXPECT_CALL(receiver,getListMainSources(_)).WillOnce(DoAll(SetArgReferee<0>(list),Return(E_OK)));
- sender.cbNumberOfSourcesChanged();
+ sleep(1);
+ std::vector<am_SourceType_s> list;
+ am_SourceType_s myource;
+ myource.name = "MySink";
+ myource.sourceID = 42;
+ myource.availability.availability = A_MAX;
+ myource.availability.availabilityReason = AR_MIN;
+ myource.sourceClassID = 15;
+ list.push_back(myource);
+ DbusCommandSender sender;
+ MockCommandReceiveInterface receiver;
+ DbusCommandInterfaceBackdoor backdoor;
+ backdoor.setReceiveInterface(&sender, &receiver);
+ DBusError error;
+ dbus_error_init(&error);
+ DBusConnection* co = dbus_bus_get(DBUS_BUS_SESSION, &error);
+ backdoor.setDbusConnection(&sender, co);
+ EXPECT_CALL(receiver,getListMainSources(_)).WillOnce(DoAll(SetArgReferee<0>(list), Return(E_OK)));
+ sender.cbNumberOfSourcesChanged();
+ return (NULL);
}
void* cbSourceRemoved(void*)
{
- sleep(1);
- std::vector<am_SourceType_s> list;
- am_SourceType_s myource;
- myource.name="MySink";
- myource.sourceID=42;
- myource.availability.availability=A_MAX;
- myource.availability.availabilityReason=AR_MIN;
- myource.sourceClassID=15;
- list.push_back(myource);
- DbusCommandSender sender;
- MockCommandReceiveInterface receiver;
- DbusCommandInterfaceBackdoor backdoor;
- backdoor.setReceiveInterface(&sender,&receiver);
- backdoor.setListSources(&sender,list);
- DBusError error;
- dbus_error_init(&error);
- list.clear();
- EXPECT_CALL(receiver,getListMainSources(_)).WillOnce(DoAll(SetArgReferee<0>(list),Return(E_OK)));
- DBusConnection* co=dbus_bus_get(DBUS_BUS_SESSION, &error);
- backdoor.setDbusConnection(&sender,co);
- sender.cbNumberOfSourcesChanged();
+ sleep(1);
+ std::vector<am_SourceType_s> list;
+ am_SourceType_s myource;
+ myource.name = "MySink";
+ myource.sourceID = 42;
+ myource.availability.availability = A_MAX;
+ myource.availability.availabilityReason = AR_MIN;
+ myource.sourceClassID = 15;
+ list.push_back(myource);
+ DbusCommandSender sender;
+ MockCommandReceiveInterface receiver;
+ DbusCommandInterfaceBackdoor backdoor;
+ backdoor.setReceiveInterface(&sender, &receiver);
+ backdoor.setListSources(&sender, list);
+ DBusError error;
+ dbus_error_init(&error);
+ list.clear();
+ EXPECT_CALL(receiver,getListMainSources(_)).WillOnce(DoAll(SetArgReferee<0>(list), Return(E_OK)));
+ DBusConnection* co = dbus_bus_get(DBUS_BUS_SESSION, &error);
+ backdoor.setDbusConnection(&sender, co);
+ sender.cbNumberOfSourcesChanged();
+ return (NULL);
}
void* cbSinkRemoved(void*)
{
- sleep(1);
- std::vector<am_SinkType_s> list;
- am_SinkType_s mysink;
- mysink.name="MySink";
- mysink.sinkID=23;
- mysink.availability.availability=A_MAX;
- mysink.availability.availabilityReason=AR_MIN;
- mysink.muteState=MS_MIN;
- mysink.sinkClassID=3;
- mysink.volume=234;
- list.push_back(mysink);
- DbusCommandSender sender;
- MockCommandReceiveInterface receiver;
- DbusCommandInterfaceBackdoor backdoor;
- backdoor.setReceiveInterface(&sender,&receiver);
- backdoor.setListSinks(&sender,list);
- DBusError error;
- dbus_error_init(&error);
- list.clear();
- EXPECT_CALL(receiver,getListMainSinks(_)).WillOnce(DoAll(SetArgReferee<0>(list),Return(E_OK)));
- DBusConnection* co=dbus_bus_get(DBUS_BUS_SESSION, &error);
- backdoor.setDbusConnection(&sender,co);
- sender.cbNumberOfSinksChanged();
+ sleep(1);
+ std::vector<am_SinkType_s> list;
+ am_SinkType_s mysink;
+ mysink.name = "MySink";
+ mysink.sinkID = 23;
+ mysink.availability.availability = A_MAX;
+ mysink.availability.availabilityReason = AR_MIN;
+ mysink.muteState = MS_MIN;
+ mysink.sinkClassID = 3;
+ mysink.volume = 234;
+ list.push_back(mysink);
+ DbusCommandSender sender;
+ MockCommandReceiveInterface receiver;
+ DbusCommandInterfaceBackdoor backdoor;
+ backdoor.setReceiveInterface(&sender, &receiver);
+ backdoor.setListSinks(&sender, list);
+ DBusError error;
+ dbus_error_init(&error);
+ list.clear();
+ EXPECT_CALL(receiver,getListMainSinks(_)).WillOnce(DoAll(SetArgReferee<0>(list), Return(E_OK)));
+ DBusConnection* co = dbus_bus_get(DBUS_BUS_SESSION, &error);
+ backdoor.setDbusConnection(&sender, co);
+ sender.cbNumberOfSinksChanged();
+ return (NULL);
}
void* NumberOfSinkClassesChanged(void*)
{
- sleep(1);
- DbusCommandSender sender;
- MockCommandReceiveInterface receiver;
- DbusCommandInterfaceBackdoor backdoor;
- backdoor.setReceiveInterface(&sender,&receiver);
- DBusError error;
- dbus_error_init(&error);
- DBusConnection* co=dbus_bus_get(DBUS_BUS_SESSION, &error);
- backdoor.setDbusConnection(&sender,co);
- sender.cbNumberOfSinkClassesChanged();
+ sleep(1);
+ DbusCommandSender sender;
+ MockCommandReceiveInterface receiver;
+ DbusCommandInterfaceBackdoor backdoor;
+ backdoor.setReceiveInterface(&sender, &receiver);
+ DBusError error;
+ dbus_error_init(&error);
+ DBusConnection* co = dbus_bus_get(DBUS_BUS_SESSION, &error);
+ backdoor.setDbusConnection(&sender, co);
+ sender.cbNumberOfSinkClassesChanged();
+ return (NULL);
}
void* NumberOfSourceClassesChanged(void*)
{
- sleep(1);
- DbusCommandSender sender;
- MockCommandReceiveInterface receiver;
- DbusCommandInterfaceBackdoor backdoor;
- backdoor.setReceiveInterface(&sender,&receiver);
- DBusError error;
- dbus_error_init(&error);
- DBusConnection* co=dbus_bus_get(DBUS_BUS_SESSION, &error);
- backdoor.setDbusConnection(&sender,co);
- sender.cbNumberOfSourceClassesChanged();
+ sleep(1);
+ DbusCommandSender sender;
+ MockCommandReceiveInterface receiver;
+ DbusCommandInterfaceBackdoor backdoor;
+ backdoor.setReceiveInterface(&sender, &receiver);
+ DBusError error;
+ dbus_error_init(&error);
+ DBusConnection* co = dbus_bus_get(DBUS_BUS_SESSION, &error);
+ backdoor.setDbusConnection(&sender, co);
+ sender.cbNumberOfSourceClassesChanged();
+ return (NULL);
}
-
void* MainConnectionStateChanged(void*)
{
- sleep(1);
- DbusCommandSender sender;
- MockCommandReceiveInterface receiver;
- DbusCommandInterfaceBackdoor backdoor;
- backdoor.setReceiveInterface(&sender,&receiver);
- DBusError error;
- dbus_error_init(&error);
- DBusConnection* co=dbus_bus_get(DBUS_BUS_SESSION, &error);
- backdoor.setDbusConnection(&sender,co);
- am_connectionID_t id=4;
- am_ConnectionState_e state=CS_CONNECTING;
- sender.cbMainConnectionStateChanged(id,state);
+ sleep(1);
+ DbusCommandSender sender;
+ MockCommandReceiveInterface receiver;
+ DbusCommandInterfaceBackdoor backdoor;
+ backdoor.setReceiveInterface(&sender, &receiver);
+ DBusError error;
+ dbus_error_init(&error);
+ DBusConnection* co = dbus_bus_get(DBUS_BUS_SESSION, &error);
+ backdoor.setDbusConnection(&sender, co);
+ am_connectionID_t id = 4;
+ am_ConnectionState_e state = CS_CONNECTING;
+ sender.cbMainConnectionStateChanged(id, state);
+ return (NULL);
}
void* MainSinkSoundPropertyChanged(void*)
{
- sleep(1);
- DbusCommandSender sender;
- MockCommandReceiveInterface receiver;
- DbusCommandInterfaceBackdoor backdoor;
- backdoor.setReceiveInterface(&sender,&receiver);
- DBusError error;
- dbus_error_init(&error);
- DBusConnection* co=dbus_bus_get(DBUS_BUS_SESSION, &error);
- backdoor.setDbusConnection(&sender,co);
- am_sinkID_t sinkID=3;
- am_MainSoundProperty_s soundProperty;
- soundProperty.type=MSP_TEST;
- soundProperty.value=23;
- sender.cbMainSinkSoundPropertyChanged(sinkID,soundProperty);
+ sleep(1);
+ DbusCommandSender sender;
+ MockCommandReceiveInterface receiver;
+ DbusCommandInterfaceBackdoor backdoor;
+ backdoor.setReceiveInterface(&sender, &receiver);
+ DBusError error;
+ dbus_error_init(&error);
+ DBusConnection* co = dbus_bus_get(DBUS_BUS_SESSION, &error);
+ backdoor.setDbusConnection(&sender, co);
+ am_sinkID_t sinkID = 3;
+ am_MainSoundProperty_s soundProperty;
+ soundProperty.type = MSP_TEST;
+ soundProperty.value = 23;
+ sender.cbMainSinkSoundPropertyChanged(sinkID, soundProperty);
+ return (NULL);
}
void* MainSourceSoundPropertyChanged(void*)
{
- sleep(1);
- DbusCommandSender sender;
- MockCommandReceiveInterface receiver;
- DbusCommandInterfaceBackdoor backdoor;
- backdoor.setReceiveInterface(&sender,&receiver);
- DBusError error;
- dbus_error_init(&error);
- DBusConnection* co=dbus_bus_get(DBUS_BUS_SESSION, &error);
- backdoor.setDbusConnection(&sender,co);
- am_sourceID_t sourceID=35;
- am_MainSoundProperty_s soundProperty;
- soundProperty.type=MSP_TEST;
- soundProperty.value=233;
- sender.cbMainSourceSoundPropertyChanged(sourceID,soundProperty);
+ sleep(1);
+ DbusCommandSender sender;
+ MockCommandReceiveInterface receiver;
+ DbusCommandInterfaceBackdoor backdoor;
+ backdoor.setReceiveInterface(&sender, &receiver);
+ DBusError error;
+ dbus_error_init(&error);
+ DBusConnection* co = dbus_bus_get(DBUS_BUS_SESSION, &error);
+ backdoor.setDbusConnection(&sender, co);
+ am_sourceID_t sourceID = 35;
+ am_MainSoundProperty_s soundProperty;
+ soundProperty.type = MSP_TEST;
+ soundProperty.value = 233;
+ sender.cbMainSourceSoundPropertyChanged(sourceID, soundProperty);
+ return (NULL);
}
void* cbSinkAvailabilityChangedLoop(void*)
{
- sleep(1);
- DbusCommandSender sender;
- MockCommandReceiveInterface receiver;
- DbusCommandInterfaceBackdoor backdoor;
- backdoor.setReceiveInterface(&sender,&receiver);
- DBusError error;
- dbus_error_init(&error);
- DBusConnection* co=dbus_bus_get(DBUS_BUS_SESSION, &error);
- backdoor.setDbusConnection(&sender,co);
- am_Availability_s av;
- av.availability=A_AVAILABLE;
- av.availabilityReason=AR_UNKNOWN;
- sender.cbSinkAvailabilityChanged(4,av);
+ sleep(1);
+ DbusCommandSender sender;
+ MockCommandReceiveInterface receiver;
+ DbusCommandInterfaceBackdoor backdoor;
+ backdoor.setReceiveInterface(&sender, &receiver);
+ DBusError error;
+ dbus_error_init(&error);
+ DBusConnection* co = dbus_bus_get(DBUS_BUS_SESSION, &error);
+ backdoor.setDbusConnection(&sender, co);
+ am_Availability_s av;
+ av.availability = A_AVAILABLE;
+ av.availabilityReason = AR_UNKNOWN;
+ sender.cbSinkAvailabilityChanged(4, av);
+ return (NULL);
}
void* VolumeChanged(void*)
{
- sleep(1);
- DbusCommandSender sender;
- MockCommandReceiveInterface receiver;
- DbusCommandInterfaceBackdoor backdoor;
- backdoor.setReceiveInterface(&sender,&receiver);
- DBusError error;
- dbus_error_init(&error);
- DBusConnection* co=dbus_bus_get(DBUS_BUS_SESSION, &error);
- backdoor.setDbusConnection(&sender,co);
- am_volume_t volume=344;
- sender.cbVolumeChanged(23,volume);
+ sleep(1);
+ DbusCommandSender sender;
+ MockCommandReceiveInterface receiver;
+ DbusCommandInterfaceBackdoor backdoor;
+ backdoor.setReceiveInterface(&sender, &receiver);
+ DBusError error;
+ dbus_error_init(&error);
+ DBusConnection* co = dbus_bus_get(DBUS_BUS_SESSION, &error);
+ backdoor.setDbusConnection(&sender, co);
+ am_volume_t volume = 344;
+ sender.cbVolumeChanged(23, volume);
+ return (NULL);
}
void* cbSourceAvailabilityChangedLoop(void*)
{
- sleep(1);
- DbusCommandSender sender;
- MockCommandReceiveInterface receiver;
- DbusCommandInterfaceBackdoor backdoor;
- backdoor.setReceiveInterface(&sender,&receiver);
- DBusError error;
- dbus_error_init(&error);
- DBusConnection* co=dbus_bus_get(DBUS_BUS_SESSION, &error);
- backdoor.setDbusConnection(&sender,co);
- am_Availability_s av;
- av.availability=A_AVAILABLE;
- av.availabilityReason=AR_UNKNOWN;
- sender.cbSourceAvailabilityChanged(2,av);
+ sleep(1);
+ DbusCommandSender sender;
+ MockCommandReceiveInterface receiver;
+ DbusCommandInterfaceBackdoor backdoor;
+ backdoor.setReceiveInterface(&sender, &receiver);
+ DBusError error;
+ dbus_error_init(&error);
+ DBusConnection* co = dbus_bus_get(DBUS_BUS_SESSION, &error);
+ backdoor.setDbusConnection(&sender, co);
+ am_Availability_s av;
+ av.availability = A_AVAILABLE;
+ av.availabilityReason = AR_UNKNOWN;
+ sender.cbSourceAvailabilityChanged(2, av);
+ return (NULL);
}
void* SinkMuteStateChanged(void*)
{
- sleep(1);
- DbusCommandSender sender;
- MockCommandReceiveInterface receiver;
- DbusCommandInterfaceBackdoor backdoor;
- backdoor.setReceiveInterface(&sender,&receiver);
- DBusError error;
- dbus_error_init(&error);
- DBusConnection* co=dbus_bus_get(DBUS_BUS_SESSION, &error);
- backdoor.setDbusConnection(&sender,co);
- sender.cbSinkMuteStateChanged(42,MS_MUTED);
+ sleep(1);
+ DbusCommandSender sender;
+ MockCommandReceiveInterface receiver;
+ DbusCommandInterfaceBackdoor backdoor;
+ backdoor.setReceiveInterface(&sender, &receiver);
+ DBusError error;
+ dbus_error_init(&error);
+ DBusConnection* co = dbus_bus_get(DBUS_BUS_SESSION, &error);
+ backdoor.setDbusConnection(&sender, co);
+ sender.cbSinkMuteStateChanged(42, MS_MUTED);
+ return (NULL);
}
void* SystemPropertyChanged(void*)
{
- sleep(1);
- DbusCommandSender sender;
- MockCommandReceiveInterface receiver;
- DbusCommandInterfaceBackdoor backdoor;
- backdoor.setReceiveInterface(&sender,&receiver);
- DBusError error;
- dbus_error_init(&error);
- DBusConnection* co=dbus_bus_get(DBUS_BUS_SESSION, &error);
- backdoor.setDbusConnection(&sender,co);
- am_SystemProperty_s property;
- property.type=SYP_TEST;
- property.value=355;
- sender.cbSystemPropertyChanged(property);
+ sleep(1);
+ DbusCommandSender sender;
+ MockCommandReceiveInterface receiver;
+ DbusCommandInterfaceBackdoor backdoor;
+ backdoor.setReceiveInterface(&sender, &receiver);
+ DBusError error;
+ dbus_error_init(&error);
+ DBusConnection* co = dbus_bus_get(DBUS_BUS_SESSION, &error);
+ backdoor.setDbusConnection(&sender, co);
+ am_SystemProperty_s property;
+ property.type = SYP_TEST;
+ property.value = 355;
+ sender.cbSystemPropertyChanged(property);
+ return (NULL);
}
void* TimingInformationChanged(void*)
{
- sleep(1);
- DbusCommandSender sender;
- MockCommandReceiveInterface receiver;
- DbusCommandInterfaceBackdoor backdoor;
- backdoor.setReceiveInterface(&sender,&receiver);
- DBusError error;
- dbus_error_init(&error);
- DBusConnection* co=dbus_bus_get(DBUS_BUS_SESSION, &error);
- backdoor.setDbusConnection(&sender,co);
- sender.cbTimingInformationChanged(42,233);
+ sleep(1);
+ DbusCommandSender sender;
+ MockCommandReceiveInterface receiver;
+ DbusCommandInterfaceBackdoor backdoor;
+ backdoor.setReceiveInterface(&sender, &receiver);
+ DBusError error;
+ dbus_error_init(&error);
+ DBusConnection* co = dbus_bus_get(DBUS_BUS_SESSION, &error);
+ backdoor.setDbusConnection(&sender, co);
+ sender.cbTimingInformationChanged(42, 233);
+ return (NULL);
}
TEST_F(dbuscommaninterfacesignalsTest,cbSourceAvailabilityChanged)
{
- //ok, now we want to test the signals. It did not work out that the python receiver worked in an own thread (as originally intended)
- //so it is running in the main context and the signals are send from threads...
- pthread_t pythonloop;
- pthread_create(&pythonloop,NULL,NumberOfMainConnectionsChanged,(void*)NULL);
- PyRun_SimpleStringFlags(
- "import sys\n"
- "import traceback\n"
- "import gobject\n"
- "import dbus\n"
- "import dbus.mainloop.glib\n"
- "loop = gobject.MainLoop()\n"
- "def catchsignal(*arg, **kwarg):\n"
- " print ('Caught NumberOfMainConnectionsChanged') \n"
- " loop.quit()\n"
- "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n"
- "bus = dbus.SessionBus()\n"
- "bus.add_signal_receiver(catchsignal, signal_name='NumberOfMainConnectionsChanged', dbus_interface = 'org.genivi.audiomanager', message_keyword='dbus_message')\n"
- "loop.run()\n",NULL);
- pthread_join(pythonloop,NULL);
-
- pthread_create(&pythonloop,NULL,cbSinkAdded,(void*)NULL);
- PyRun_SimpleStringFlags(
- "import sys\n"
- "import traceback\n"
- "import gobject\n"
- "import dbus\n"
- "import dbus.mainloop.glib\n"
- "loop = gobject.MainLoop()\n"
- "def catchSinkAdded(*arg, **karg):\n"
- " print ('Caught signal (in SinkAdded handler) ') \n"
- " print (arg[0])\n"
- " f = open('/tmp/result.txt','w')\n"
- " f.write(str(arg[0]));\n"
- " f.close()\n"
- " loop.quit()\n"
- "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n"
- "bus = dbus.SessionBus()\n"
- "bus.add_signal_receiver(catchSinkAdded, signal_name='SinkAdded', dbus_interface = 'org.genivi.audiomanager', message_keyword='dbus_message')\n"
- "loop.run()\n",NULL);
- pthread_join(pythonloop,NULL);
-
- std::ifstream ifs("/tmp/result.txt");
- std::string line;
- int lineCounter=0, result=0;
- while(std::getline(ifs, line))
- {
- ASSERT_EQ(line.compare("dbus.Struct((dbus.UInt16(23), dbus.String(u'MySink'), dbus.Struct((dbus.Int16(3), dbus.Int16(0)), signature=None), dbus.Int16(234), dbus.Int16(0), dbus.UInt16(3)), signature=None)"),0);
- }
- ifs.close();
-
- pthread_create(&pythonloop,NULL,cbSinkRemoved,(void*)NULL);
- PyRun_SimpleStringFlags(
- "import sys\n"
- "import traceback\n"
- "import gobject\n"
- "import dbus\n"
- "import dbus.mainloop.glib\n"
- "loop = gobject.MainLoop()\n"
- "def catchSinkRemoved(*arg, **karg):\n"
- " print ('Caught signal (in SinkRemoved handler) ') \n"
- " print (arg[0])\n"
- " f = open('/tmp/result.txt','w')\n"
- " f.write(str(arg[0]));\n"
- " f.close()\n"
- " loop.quit()\n"
- "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n"
- "bus = dbus.SessionBus()\n"
- "bus.add_signal_receiver(catchSinkRemoved, signal_name='SinkRemoved', dbus_interface = 'org.genivi.audiomanager', message_keyword='dbus_message')\n"
- "loop.run()\n",NULL);
- pthread_join(pythonloop,NULL);
-
- ifs.open("/tmp/result.txt");
- lineCounter=0;
- result=0;
- while(std::getline(ifs, line))
- {
- std::stringstream(line) >> result;
- ASSERT_EQ(result,23);
- }
- ifs.close();
-
- pthread_create(&pythonloop,NULL,cbSourceAdded,(void*)NULL);
- PyRun_SimpleStringFlags(
- "import sys\n"
- "import traceback\n"
- "import gobject\n"
- "import dbus\n"
- "import dbus.mainloop.glib\n"
- "loop = gobject.MainLoop()\n"
- "def catchSourceAdded(*arg, **karg):\n"
- " print ('Caught signal (in SourceAdded handler) ') \n"
- " print (arg[0])\n"
- " f = open('/tmp/result.txt','w')\n"
- " f.write(str(arg[0]));\n"
- " f.close()\n"
- " loop.quit()\n"
- "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n"
- "bus = dbus.SessionBus()\n"
- "bus.add_signal_receiver(catchSourceAdded, signal_name='SourceAdded', dbus_interface = 'org.genivi.audiomanager', message_keyword='dbus_message')\n"
- "loop.run()\n",NULL);
- pthread_join(pythonloop,NULL);
-
- ifs.open("/tmp/result.txt");
- lineCounter=0;
- result=0;
- while(std::getline(ifs, line))
- {
- ASSERT_EQ(line.compare("dbus.Struct((dbus.UInt16(42), dbus.String(u'MySink'), dbus.Struct((dbus.Int16(3), dbus.Int16(0)), signature=None), dbus.UInt16(15)), signature=None)"),0);
- }
- ifs.close();
-
-
- pthread_create(&pythonloop,NULL,cbSourceRemoved,(void*)NULL);
- PyRun_SimpleStringFlags(
- "import sys\n"
- "import traceback\n"
- "import gobject\n"
- "import dbus\n"
- "import dbus.mainloop.glib\n"
- "loop = gobject.MainLoop()\n"
- "def catchSourceRemoved(*arg, **karg):\n"
- " print ('Caught signal (in SinkRemoved handler) ') \n"
- " print (arg[0])\n"
- " f = open('/tmp/result.txt','w')\n"
- " f.write(str(arg[0]));\n"
- " f.close()\n"
- " loop.quit()\n"
- "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n"
- "bus = dbus.SessionBus()\n"
- "bus.add_signal_receiver(catchSourceRemoved, signal_name='SourceRemoved', dbus_interface = 'org.genivi.audiomanager', message_keyword='dbus_message')\n"
- "loop.run()\n",NULL);
- pthread_join(pythonloop,NULL);
-
- ifs.open("/tmp/result.txt");
- lineCounter=0;
- result=0;
- while(std::getline(ifs, line))
- {
- std::stringstream(line) >> result;
- ASSERT_EQ(result,42);
- }
- ifs.close();
-
-
- pthread_create(&pythonloop,NULL,NumberOfSinkClassesChanged,(void*)NULL);
- PyRun_SimpleStringFlags(
- "import sys\n"
- "import traceback\n"
- "import gobject\n"
- "import dbus\n"
- "import dbus.mainloop.glib\n"
- "loop = gobject.MainLoop()\n"
- "def catchNumberOfSinkClassesChanged(*arg, **kwarg):\n"
- " print ('Caught catchNumberOfSinkClassesChanged') \n"
- " loop.quit()\n"
- "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n"
- "bus = dbus.SessionBus()\n"
- "bus.add_signal_receiver(catchNumberOfSinkClassesChanged, signal_name='NumberOfSinkClassesChanged', dbus_interface = 'org.genivi.audiomanager', message_keyword='dbus_message')\n"
- "loop.run()\n",NULL);
- pthread_join(pythonloop,NULL);
-
- pthread_create(&pythonloop,NULL,NumberOfSourceClassesChanged,(void*)NULL);
- PyRun_SimpleStringFlags(
- "import sys\n"
- "import traceback\n"
- "import gobject\n"
- "import dbus\n"
- "import dbus.mainloop.glib\n"
- "loop = gobject.MainLoop()\n"
- "def CatchNumberOfSourceClassesChanged(*arg, **kwarg):\n"
- " print ('Caught CatchNumberOfSourceClassesChanged') \n"
- " loop.quit()\n"
- "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n"
- "bus = dbus.SessionBus()\n"
- "bus.add_signal_receiver(CatchNumberOfSourceClassesChanged, signal_name='NumberOfSourceClassesChanged', dbus_interface = 'org.genivi.audiomanager', message_keyword='dbus_message')\n"
- "loop.run()\n",NULL);
- pthread_join(pythonloop,NULL);
-
-
- //ok, now we want to test the signals. It did not work out that the python receiver worked in an own thread (as originally intended)
- //so it is running in the main context and the signals are send from threads...
- pthread_create(&pythonloop,NULL,MainConnectionStateChanged,(void*)NULL);
- PyRun_SimpleStringFlags(
- "import sys\n"
- "import traceback\n"
- "import gobject\n"
- "import dbus\n"
- "import dbus.mainloop.glib\n"
- "loop = gobject.MainLoop()\n"
- "def catchMainConnectionStateChanged(*arg, **karg):\n"
- " print ('Caught signal (in catchMainConnectionStateChanged handler) ') \n"
- " print (arg[0])\n"
- " print (arg[1])\n"
- " f = open('/tmp/result.txt','w')\n"
- " f.write(str(arg[0]) + '\\n' + str (arg[1]));\n"
- " f.close()\n"
- " loop.quit()\n"
- "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n"
- "bus = dbus.SessionBus()\n"
- "bus.add_signal_receiver(catchMainConnectionStateChanged, signal_name='MainConnectionStateChanged', dbus_interface = 'org.genivi.audiomanager', message_keyword='dbus_message')\n"
- "loop.run()\n",NULL);
- pthread_join(pythonloop,NULL);
-
- ifs.open("/tmp/result.txt");
- lineCounter=0;
- result=0;
- while(std::getline(ifs, line))
- {
- if(lineCounter==0)
- {
- std::stringstream(line) >> result;
- ASSERT_EQ(result,4);
- }
- else if (lineCounter==1)
- {
- std::stringstream(line) >> result;
- ASSERT_EQ(result,CS_CONNECTING);
- }
- lineCounter++;
- }
- ifs.close();
-
-
- //ok, now we want to test the signals. It did not work out that the python receiver worked in an own thread (as originally intended)
- //so it is running in the main context and the signals are send from threads...
- pthread_create(&pythonloop,NULL,MainSinkSoundPropertyChanged,(void*)NULL);
- PyRun_SimpleStringFlags(
- "import sys\n"
- "import traceback\n"
- "import gobject\n"
- "import dbus\n"
- "import dbus.mainloop.glib\n"
- "loop = gobject.MainLoop()\n"
- "def catchMainSinkSoundPropertyChanged(*arg, **karg):\n"
- " print ('Caught signal (in catchMainSinkSoundPropertyChanged handler) ') \n"
- " print (arg[0])\n"
- " print (arg[1])\n"
- " f = open('/tmp/result.txt','w')\n"
- " f.write(str(arg[0]) + '\\n' + str (arg[1]));\n"
- " f.close()\n"
- " loop.quit()\n"
- "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n"
- "bus = dbus.SessionBus()\n"
- "bus.add_signal_receiver(catchMainSinkSoundPropertyChanged, signal_name='MainSinkSoundPropertyChanged', dbus_interface = 'org.genivi.audiomanager', message_keyword='dbus_message')\n"
- "loop.run()\n",NULL);
- pthread_join(pythonloop,NULL);
-
- ifs.open("/tmp/result.txt");
- lineCounter=0;
- result=0;
- while(std::getline(ifs, line))
- {
- if(lineCounter==0)
- {
- std::stringstream(line) >> result;
- ASSERT_EQ(result,3);
- }
- else if (lineCounter==1)
- {
- ASSERT_EQ(line.compare("dbus.Struct((dbus.Int16(1), dbus.Int16(23)), signature=None)"),0);
- }
- lineCounter++;
- }
- ifs.close();
-
- //ok, now we want to test the signals. It did not work out that the python receiver worked in an own thread (as originally intended)
- //so it is running in the main context and the signals are send from threads...
- pthread_create(&pythonloop,NULL,MainSourceSoundPropertyChanged,(void*)NULL);
- PyRun_SimpleStringFlags(
- "import sys\n"
- "import traceback\n"
- "import gobject\n"
- "import dbus\n"
- "import dbus.mainloop.glib\n"
- "loop = gobject.MainLoop()\n"
- "def catchMainSourceSoundPropertyChanged(*arg, **karg):\n"
- " print ('Caught signal (in catchMainSourceSoundPropertyChanged handler) ') \n"
- " print (arg[0])\n"
- " print (arg[1])\n"
- " f = open('/tmp/result.txt','w')\n"
- " f.write(str(arg[0]) + '\\n' + str (arg[1]));\n"
- " f.close()\n"
- " loop.quit()\n"
- "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n"
- "bus = dbus.SessionBus()\n"
- "bus.add_signal_receiver(catchMainSourceSoundPropertyChanged, signal_name='MainSourceSoundPropertyChanged', dbus_interface = 'org.genivi.audiomanager', message_keyword='dbus_message')\n"
- "loop.run()\n",NULL);
- pthread_join(pythonloop,NULL);
-
- ifs.open("/tmp/result.txt");
- lineCounter=0;
- result=0;
- while(std::getline(ifs, line))
- {
- if(lineCounter==0)
- {
- std::stringstream(line) >> result;
- ASSERT_EQ(result,35);
- }
- else if (lineCounter==1)
- {
- ASSERT_EQ(line.compare("dbus.Struct((dbus.Int16(1), dbus.Int16(233)), signature=None)"),0);
- }
- lineCounter++;
- }
- ifs.close();
-
-
- //ok, now we want to test the signals. It did not work out that the python receiver worked in an own thread (as originally intended)
- //so it is running in the main context and the signals are send from threads...
- pthread_create(&pythonloop,NULL,cbSinkAvailabilityChangedLoop,(void*)NULL);
- PyRun_SimpleStringFlags(
- "import sys\n"
- "import traceback\n"
- "import gobject\n"
- "import dbus\n"
- "import dbus.mainloop.glib\n"
- "loop = gobject.MainLoop()\n"
- "def catchSinkAvailabilityChanged(*arg, **karg):\n"
- " print ('Caught signal (in catchSinkAvailabilityChanged handler) ') \n"
- " print (arg[0])\n"
- " print (arg[1])\n"
- " f = open('/tmp/result.txt','w')\n"
- " f.write(str(arg[0]) + '\\n' + str (arg[1]));\n"
- " f.close()\n"
- " loop.quit()\n"
- "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n"
- "bus = dbus.SessionBus()\n"
- "bus.add_signal_receiver(catchSinkAvailabilityChanged, signal_name='SinkAvailabilityChanged', dbus_interface = 'org.genivi.audiomanager', message_keyword='dbus_message')\n"
- "loop.run()\n",NULL);
- pthread_join(pythonloop,NULL);
-
- ifs.open("/tmp/result.txt");
- lineCounter=0;
- result=0;
- while(std::getline(ifs, line))
- {
- if(lineCounter==0)
- {
- std::stringstream(line) >> result;
- ASSERT_EQ(result,4);
- }
- else if (lineCounter==1)
- {
- ASSERT_EQ(line.compare("dbus.Struct((dbus.Int16(0), dbus.Int16(3)), signature=None)"),0);
- }
- lineCounter++;
- }
- ifs.close();
-
-
- //ok, now we want to test the signals. It did not work out that the python receiver worked in an own thread (as originally intended)
- //so it is running in the main context and the signals are send from threads...
- pthread_create(&pythonloop,NULL,cbSourceAvailabilityChangedLoop,(void*)NULL);
- PyRun_SimpleStringFlags(
- "import sys\n"
- "import traceback\n"
- "import gobject\n"
- "import dbus\n"
- "import dbus.mainloop.glib\n"
- "loop = gobject.MainLoop()\n"
- "def catchSourceAvailability(*arg, **karg):\n"
- " print ('Caught signal (in catchSourceAvailability handler) ') \n"
- " print (arg[0])\n"
- " print (arg[1])\n"
- " f = open('/tmp/result.txt','w')\n"
- " f.write(str(arg[0]) + '\\n' + str (arg[1]));\n"
- " f.close()\n"
- " loop.quit()\n"
- "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n"
- "bus = dbus.SessionBus()\n"
- "bus.add_signal_receiver(catchSourceAvailability, signal_name='SourceAvailabilityChanged', dbus_interface = 'org.genivi.audiomanager', message_keyword='dbus_message')\n"
- "loop.run()\n",NULL);
- pthread_join(pythonloop,NULL);
-
- ifs.open("/tmp/result.txt");
- lineCounter=0;
- result=0;
- while(std::getline(ifs, line))
- {
- if(lineCounter==0)
- {
- std::stringstream(line) >> result;
- ASSERT_EQ(result,2);
- }
- else if (lineCounter==1)
- {
- ASSERT_EQ(line.compare("dbus.Struct((dbus.Int16(0), dbus.Int16(3)), signature=None)"),0);
- }
- lineCounter++;
- }
- ifs.close();
-
-
- //ok, now we want to test the signals. It did not work out that the python receiver worked in an own thread (as originally intended)
- //so it is running in the main context and the signals are send from threads...
- pthread_create(&pythonloop,NULL,VolumeChanged,(void*)NULL);
- PyRun_SimpleStringFlags(
- "import sys\n"
- "import traceback\n"
- "import gobject\n"
- "import dbus\n"
- "import dbus.mainloop.glib\n"
- "loop = gobject.MainLoop()\n"
- "def catchVolumeChanged(*arg, **karg):\n"
- " print ('Caught signal (in catchVolumeChanged handler) ') \n"
- " print (arg[0])\n"
- " print (arg[1])\n"
- " f = open('/tmp/result.txt','w')\n"
- " f.write(str(arg[0]) + '\\n' + str (arg[1]));\n"
- " f.close()\n"
- " loop.quit()\n"
- "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n"
- "bus = dbus.SessionBus()\n"
- "bus.add_signal_receiver(catchVolumeChanged, signal_name='VolumeChanged', dbus_interface = 'org.genivi.audiomanager', message_keyword='dbus_message')\n"
- "loop.run()\n",NULL);
- pthread_join(pythonloop,NULL);
-
- ifs.open("/tmp/result.txt");
- lineCounter=0;
- result=0;
- while(std::getline(ifs, line))
- {
- if(lineCounter==0)
- {
- std::stringstream(line) >> result;
- ASSERT_EQ(result,23);
- }
- else if (lineCounter==1)
- {
- std::stringstream(line) >> result;
- ASSERT_EQ(result,344);
- }
- lineCounter++;
- }
- ifs.close();
-
-
- //ok, now we want to test the signals. It did not work out that the python receiver worked in an own thread (as originally intended)
- //so it is running in the main context and the signals are send from threads...
- pthread_create(&pythonloop,NULL,SinkMuteStateChanged,(void*)NULL);
- PyRun_SimpleStringFlags(
- "import sys\n"
- "import traceback\n"
- "import gobject\n"
- "import dbus\n"
- "import dbus.mainloop.glib\n"
- "loop = gobject.MainLoop()\n"
- "def catchSinkMuteStateChanged(*arg, **karg):\n"
- " print ('Caught signal (in catchSinkMuteStateChanged handler) ') \n"
- " print (arg[0])\n"
- " print (arg[1])\n"
- " f = open('/tmp/result.txt','w')\n"
- " f.write(str(arg[0]) + '\\n' + str (arg[1]));\n"
- " f.close()\n"
- " loop.quit()\n"
- "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n"
- "bus = dbus.SessionBus()\n"
- "bus.add_signal_receiver(catchSinkMuteStateChanged, signal_name='SinkMuteStateChanged', dbus_interface = 'org.genivi.audiomanager', message_keyword='dbus_message')\n"
- "loop.run()\n",NULL);
- pthread_join(pythonloop,NULL);
-
- ifs.open("/tmp/result.txt");
- lineCounter=0;
- result=0;
- while(std::getline(ifs, line))
- {
- if(lineCounter==0)
- {
- std::stringstream(line) >> result;
- ASSERT_EQ(result,42);
- }
- else if (lineCounter==1)
- {
- std::stringstream(line) >> result;
- ASSERT_EQ(result,MS_MUTED);
- }
- lineCounter++;
- }
- ifs.close();
-
- //ok, now we want to test the signals. It did not work out that the python receiver worked in an own thread (as originally intended)
- //so it is running in the main context and the signals are send from threads...
- pthread_create(&pythonloop,NULL,SystemPropertyChanged,(void*)NULL);
- PyRun_SimpleStringFlags(
- "import sys\n"
- "import traceback\n"
- "import gobject\n"
- "import dbus\n"
- "import dbus.mainloop.glib\n"
- "loop = gobject.MainLoop()\n"
- "def catchSystemPropertyChanged(*arg, **karg):\n"
- " print ('Caught signal (in catchSystemPropertyChanged handler) ') \n"
- " print (arg[0])\n"
- " f = open('/tmp/result.txt','w')\n"
- " f.write(str(arg[0]));\n"
- " f.close()\n"
- " loop.quit()\n"
- "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n"
- "bus = dbus.SessionBus()\n"
- "bus.add_signal_receiver(catchSystemPropertyChanged, signal_name='SystemPropertyChanged', dbus_interface = 'org.genivi.audiomanager', message_keyword='dbus_message')\n"
- "loop.run()\n",NULL);
- pthread_join(pythonloop,NULL);
-
- ifs.open("/tmp/result.txt");
- lineCounter=0;
- result=0;
- while(std::getline(ifs, line))
- {
- ASSERT_EQ(line.compare("dbus.Struct((dbus.Int16(0), dbus.Int16(355)), signature=None)"),0);
- }
- ifs.close();
-
- //ok, now we want to test the signals. It did not work out that the python receiver worked in an own thread (as originally intended)
- //so it is running in the main context and the signals are send from threads...
- pthread_create(&pythonloop,NULL,TimingInformationChanged,(void*)NULL);
- PyRun_SimpleStringFlags(
- "import sys\n"
- "import traceback\n"
- "import gobject\n"
- "import dbus\n"
- "import dbus.mainloop.glib\n"
- "loop = gobject.MainLoop()\n"
- "def catchTimingInformationChanged(*arg, **karg):\n"
- " print ('Caught signal (in catchTimingInformationChanged handler) ') \n"
- " print (arg[0])\n"
- " print (arg[1])\n"
- " f = open('/tmp/result.txt','w')\n"
- " f.write(str(arg[0]) + '\\n' + str (arg[1]));\n"
- " f.close()\n"
- " loop.quit()\n"
- "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n"
- "bus = dbus.SessionBus()\n"
- "bus.add_signal_receiver(catchTimingInformationChanged, signal_name='TimingInformationChanged', dbus_interface = 'org.genivi.audiomanager', message_keyword='dbus_message')\n"
- "loop.run()\n",NULL);
- pthread_join(pythonloop,NULL);
-
- ifs.open("/tmp/result.txt");
- lineCounter=0;
- result=0;
- while(std::getline(ifs, line))
- {
- if(lineCounter==0)
- {
- std::stringstream(line) >> result;
- ASSERT_EQ(result,42);
- }
- else if (lineCounter==1)
- {
- std::stringstream(line) >> result;
- ASSERT_EQ(result,233);
- }
- lineCounter++;
- }
- ifs.close();
+ //ok, now we want to test the signals. It did not work out that the python receiver worked in an own thread (as originally intended)
+ //so it is running in the main context and the signals are send from threads...
+ pthread_t pythonloop;
+ pthread_create(&pythonloop, NULL, NumberOfMainConnectionsChanged, (void*) NULL);
+ PyRun_SimpleStringFlags("import sys\n"
+ "import traceback\n"
+ "import gobject\n"
+ "import dbus\n"
+ "import dbus.mainloop.glib\n"
+ "loop = gobject.MainLoop()\n"
+ "def catchsignal(*arg, **kwarg):\n"
+ " print ('Caught NumberOfMainConnectionsChanged') \n"
+ " loop.quit()\n"
+ "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n"
+ "bus = dbus.SessionBus()\n"
+ "bus.add_signal_receiver(catchsignal, signal_name='NumberOfMainConnectionsChanged', dbus_interface = 'org.genivi.audiomanager', message_keyword='dbus_message')\n"
+ "loop.run()\n", NULL);
+ pthread_join(pythonloop, NULL);
+
+ pthread_create(&pythonloop, NULL, cbSinkAdded, (void*) NULL);
+ PyRun_SimpleStringFlags("import sys\n"
+ "import traceback\n"
+ "import gobject\n"
+ "import dbus\n"
+ "import dbus.mainloop.glib\n"
+ "loop = gobject.MainLoop()\n"
+ "def catchSinkAdded(*arg, **karg):\n"
+ " print ('Caught signal (in SinkAdded handler) ') \n"
+ " print (arg[0])\n"
+ " f = open('/tmp/result.txt','w')\n"
+ " f.write(str(arg[0]));\n"
+ " f.close()\n"
+ " loop.quit()\n"
+ "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n"
+ "bus = dbus.SessionBus()\n"
+ "bus.add_signal_receiver(catchSinkAdded, signal_name='SinkAdded', dbus_interface = 'org.genivi.audiomanager', message_keyword='dbus_message')\n"
+ "loop.run()\n", NULL);
+ pthread_join(pythonloop, NULL);
+
+ std::ifstream ifs("/tmp/result.txt");
+ std::string line;
+ int lineCounter = 0, result = 0;
+ while (std::getline(ifs, line))
+ {
+ ASSERT_EQ(line.compare("dbus.Struct((dbus.UInt16(23), dbus.String(u'MySink'), dbus.Struct((dbus.Int16(3), dbus.Int16(0)), signature=None), dbus.Int16(234), dbus.Int16(0), dbus.UInt16(3)), signature=None)"), 0);
+ }
+ ifs.close();
+
+ pthread_create(&pythonloop, NULL, cbSinkRemoved, (void*) NULL);
+ PyRun_SimpleStringFlags("import sys\n"
+ "import traceback\n"
+ "import gobject\n"
+ "import dbus\n"
+ "import dbus.mainloop.glib\n"
+ "loop = gobject.MainLoop()\n"
+ "def catchSinkRemoved(*arg, **karg):\n"
+ " print ('Caught signal (in SinkRemoved handler) ') \n"
+ " print (arg[0])\n"
+ " f = open('/tmp/result.txt','w')\n"
+ " f.write(str(arg[0]));\n"
+ " f.close()\n"
+ " loop.quit()\n"
+ "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n"
+ "bus = dbus.SessionBus()\n"
+ "bus.add_signal_receiver(catchSinkRemoved, signal_name='SinkRemoved', dbus_interface = 'org.genivi.audiomanager', message_keyword='dbus_message')\n"
+ "loop.run()\n", NULL);
+ pthread_join(pythonloop, NULL);
+
+ ifs.open("/tmp/result.txt");
+ lineCounter = 0;
+ result = 0;
+ while (std::getline(ifs, line))
+ {
+ std::stringstream(line) >> result;
+ ASSERT_EQ(result, 23);
+ }
+ ifs.close();
+
+ pthread_create(&pythonloop, NULL, cbSourceAdded, (void*) NULL);
+ PyRun_SimpleStringFlags("import sys\n"
+ "import traceback\n"
+ "import gobject\n"
+ "import dbus\n"
+ "import dbus.mainloop.glib\n"
+ "loop = gobject.MainLoop()\n"
+ "def catchSourceAdded(*arg, **karg):\n"
+ " print ('Caught signal (in SourceAdded handler) ') \n"
+ " print (arg[0])\n"
+ " f = open('/tmp/result.txt','w')\n"
+ " f.write(str(arg[0]));\n"
+ " f.close()\n"
+ " loop.quit()\n"
+ "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n"
+ "bus = dbus.SessionBus()\n"
+ "bus.add_signal_receiver(catchSourceAdded, signal_name='SourceAdded', dbus_interface = 'org.genivi.audiomanager', message_keyword='dbus_message')\n"
+ "loop.run()\n", NULL);
+ pthread_join(pythonloop, NULL);
+
+ ifs.open("/tmp/result.txt");
+ lineCounter = 0;
+ result = 0;
+ while (std::getline(ifs, line))
+ {
+ ASSERT_EQ(line.compare("dbus.Struct((dbus.UInt16(42), dbus.String(u'MySink'), dbus.Struct((dbus.Int16(3), dbus.Int16(0)), signature=None), dbus.UInt16(15)), signature=None)"), 0);
+ }
+ ifs.close();
+
+ pthread_create(&pythonloop, NULL, cbSourceRemoved, (void*) NULL);
+ PyRun_SimpleStringFlags("import sys\n"
+ "import traceback\n"
+ "import gobject\n"
+ "import dbus\n"
+ "import dbus.mainloop.glib\n"
+ "loop = gobject.MainLoop()\n"
+ "def catchSourceRemoved(*arg, **karg):\n"
+ " print ('Caught signal (in SinkRemoved handler) ') \n"
+ " print (arg[0])\n"
+ " f = open('/tmp/result.txt','w')\n"
+ " f.write(str(arg[0]));\n"
+ " f.close()\n"
+ " loop.quit()\n"
+ "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n"
+ "bus = dbus.SessionBus()\n"
+ "bus.add_signal_receiver(catchSourceRemoved, signal_name='SourceRemoved', dbus_interface = 'org.genivi.audiomanager', message_keyword='dbus_message')\n"
+ "loop.run()\n", NULL);
+ pthread_join(pythonloop, NULL);
+
+ ifs.open("/tmp/result.txt");
+ lineCounter = 0;
+ result = 0;
+ while (std::getline(ifs, line))
+ {
+ std::stringstream(line) >> result;
+ ASSERT_EQ(result, 42);
+ }
+ ifs.close();
+
+ pthread_create(&pythonloop, NULL, NumberOfSinkClassesChanged, (void*) NULL);
+ PyRun_SimpleStringFlags("import sys\n"
+ "import traceback\n"
+ "import gobject\n"
+ "import dbus\n"
+ "import dbus.mainloop.glib\n"
+ "loop = gobject.MainLoop()\n"
+ "def catchNumberOfSinkClassesChanged(*arg, **kwarg):\n"
+ " print ('Caught catchNumberOfSinkClassesChanged') \n"
+ " loop.quit()\n"
+ "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n"
+ "bus = dbus.SessionBus()\n"
+ "bus.add_signal_receiver(catchNumberOfSinkClassesChanged, signal_name='NumberOfSinkClassesChanged', dbus_interface = 'org.genivi.audiomanager', message_keyword='dbus_message')\n"
+ "loop.run()\n", NULL);
+ pthread_join(pythonloop, NULL);
+
+ pthread_create(&pythonloop, NULL, NumberOfSourceClassesChanged, (void*) NULL);
+ PyRun_SimpleStringFlags("import sys\n"
+ "import traceback\n"
+ "import gobject\n"
+ "import dbus\n"
+ "import dbus.mainloop.glib\n"
+ "loop = gobject.MainLoop()\n"
+ "def CatchNumberOfSourceClassesChanged(*arg, **kwarg):\n"
+ " print ('Caught CatchNumberOfSourceClassesChanged') \n"
+ " loop.quit()\n"
+ "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n"
+ "bus = dbus.SessionBus()\n"
+ "bus.add_signal_receiver(CatchNumberOfSourceClassesChanged, signal_name='NumberOfSourceClassesChanged', dbus_interface = 'org.genivi.audiomanager', message_keyword='dbus_message')\n"
+ "loop.run()\n", NULL);
+ pthread_join(pythonloop, NULL);
+
+ //ok, now we want to test the signals. It did not work out that the python receiver worked in an own thread (as originally intended)
+ //so it is running in the main context and the signals are send from threads...
+ pthread_create(&pythonloop, NULL, MainConnectionStateChanged, (void*) NULL);
+ PyRun_SimpleStringFlags("import sys\n"
+ "import traceback\n"
+ "import gobject\n"
+ "import dbus\n"
+ "import dbus.mainloop.glib\n"
+ "loop = gobject.MainLoop()\n"
+ "def catchMainConnectionStateChanged(*arg, **karg):\n"
+ " print ('Caught signal (in catchMainConnectionStateChanged handler) ') \n"
+ " print (arg[0])\n"
+ " print (arg[1])\n"
+ " f = open('/tmp/result.txt','w')\n"
+ " f.write(str(arg[0]) + '\\n' + str (arg[1]));\n"
+ " f.close()\n"
+ " loop.quit()\n"
+ "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n"
+ "bus = dbus.SessionBus()\n"
+ "bus.add_signal_receiver(catchMainConnectionStateChanged, signal_name='MainConnectionStateChanged', dbus_interface = 'org.genivi.audiomanager', message_keyword='dbus_message')\n"
+ "loop.run()\n", NULL);
+ pthread_join(pythonloop, NULL);
+
+ ifs.open("/tmp/result.txt");
+ lineCounter = 0;
+ result = 0;
+ while (std::getline(ifs, line))
+ {
+ if (lineCounter == 0)
+ {
+ std::stringstream(line) >> result;
+ ASSERT_EQ(result, 4);
+ }
+ else if (lineCounter == 1)
+ {
+ std::stringstream(line) >> result;
+ ASSERT_EQ(result, CS_CONNECTING);
+ }
+ lineCounter++;
+ }
+ ifs.close();
+
+ //ok, now we want to test the signals. It did not work out that the python receiver worked in an own thread (as originally intended)
+ //so it is running in the main context and the signals are send from threads...
+ pthread_create(&pythonloop, NULL, MainSinkSoundPropertyChanged, (void*) NULL);
+ PyRun_SimpleStringFlags("import sys\n"
+ "import traceback\n"
+ "import gobject\n"
+ "import dbus\n"
+ "import dbus.mainloop.glib\n"
+ "loop = gobject.MainLoop()\n"
+ "def catchMainSinkSoundPropertyChanged(*arg, **karg):\n"
+ " print ('Caught signal (in catchMainSinkSoundPropertyChanged handler) ') \n"
+ " print (arg[0])\n"
+ " print (arg[1])\n"
+ " f = open('/tmp/result.txt','w')\n"
+ " f.write(str(arg[0]) + '\\n' + str (arg[1]));\n"
+ " f.close()\n"
+ " loop.quit()\n"
+ "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n"
+ "bus = dbus.SessionBus()\n"
+ "bus.add_signal_receiver(catchMainSinkSoundPropertyChanged, signal_name='MainSinkSoundPropertyChanged', dbus_interface = 'org.genivi.audiomanager', message_keyword='dbus_message')\n"
+ "loop.run()\n", NULL);
+ pthread_join(pythonloop, NULL);
+
+ ifs.open("/tmp/result.txt");
+ lineCounter = 0;
+ result = 0;
+ while (std::getline(ifs, line))
+ {
+ if (lineCounter == 0)
+ {
+ std::stringstream(line) >> result;
+ ASSERT_EQ(result, 3);
+ }
+ else if (lineCounter == 1)
+ {
+ ASSERT_EQ(line.compare("dbus.Struct((dbus.Int16(1), dbus.Int16(23)), signature=None)"), 0);
+ }
+ lineCounter++;
+ }
+ ifs.close();
+
+ //ok, now we want to test the signals. It did not work out that the python receiver worked in an own thread (as originally intended)
+ //so it is running in the main context and the signals are send from threads...
+ pthread_create(&pythonloop, NULL, MainSourceSoundPropertyChanged, (void*) NULL);
+ PyRun_SimpleStringFlags("import sys\n"
+ "import traceback\n"
+ "import gobject\n"
+ "import dbus\n"
+ "import dbus.mainloop.glib\n"
+ "loop = gobject.MainLoop()\n"
+ "def catchMainSourceSoundPropertyChanged(*arg, **karg):\n"
+ " print ('Caught signal (in catchMainSourceSoundPropertyChanged handler) ') \n"
+ " print (arg[0])\n"
+ " print (arg[1])\n"
+ " f = open('/tmp/result.txt','w')\n"
+ " f.write(str(arg[0]) + '\\n' + str (arg[1]));\n"
+ " f.close()\n"
+ " loop.quit()\n"
+ "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n"
+ "bus = dbus.SessionBus()\n"
+ "bus.add_signal_receiver(catchMainSourceSoundPropertyChanged, signal_name='MainSourceSoundPropertyChanged', dbus_interface = 'org.genivi.audiomanager', message_keyword='dbus_message')\n"
+ "loop.run()\n", NULL);
+ pthread_join(pythonloop, NULL);
+
+ ifs.open("/tmp/result.txt");
+ lineCounter = 0;
+ result = 0;
+ while (std::getline(ifs, line))
+ {
+ if (lineCounter == 0)
+ {
+ std::stringstream(line) >> result;
+ ASSERT_EQ(result, 35);
+ }
+ else if (lineCounter == 1)
+ {
+ ASSERT_EQ(line.compare("dbus.Struct((dbus.Int16(1), dbus.Int16(233)), signature=None)"), 0);
+ }
+ lineCounter++;
+ }
+ ifs.close();
+
+ //ok, now we want to test the signals. It did not work out that the python receiver worked in an own thread (as originally intended)
+ //so it is running in the main context and the signals are send from threads...
+ pthread_create(&pythonloop, NULL, cbSinkAvailabilityChangedLoop, (void*) NULL);
+ PyRun_SimpleStringFlags("import sys\n"
+ "import traceback\n"
+ "import gobject\n"
+ "import dbus\n"
+ "import dbus.mainloop.glib\n"
+ "loop = gobject.MainLoop()\n"
+ "def catchSinkAvailabilityChanged(*arg, **karg):\n"
+ " print ('Caught signal (in catchSinkAvailabilityChanged handler) ') \n"
+ " print (arg[0])\n"
+ " print (arg[1])\n"
+ " f = open('/tmp/result.txt','w')\n"
+ " f.write(str(arg[0]) + '\\n' + str (arg[1]));\n"
+ " f.close()\n"
+ " loop.quit()\n"
+ "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n"
+ "bus = dbus.SessionBus()\n"
+ "bus.add_signal_receiver(catchSinkAvailabilityChanged, signal_name='SinkAvailabilityChanged', dbus_interface = 'org.genivi.audiomanager', message_keyword='dbus_message')\n"
+ "loop.run()\n", NULL);
+ pthread_join(pythonloop, NULL);
+
+ ifs.open("/tmp/result.txt");
+ lineCounter = 0;
+ result = 0;
+ while (std::getline(ifs, line))
+ {
+ if (lineCounter == 0)
+ {
+ std::stringstream(line) >> result;
+ ASSERT_EQ(result, 4);
+ }
+ else if (lineCounter == 1)
+ {
+ ASSERT_EQ(line.compare("dbus.Struct((dbus.Int16(0), dbus.Int16(3)), signature=None)"), 0);
+ }
+ lineCounter++;
+ }
+ ifs.close();
+
+ //ok, now we want to test the signals. It did not work out that the python receiver worked in an own thread (as originally intended)
+ //so it is running in the main context and the signals are send from threads...
+ pthread_create(&pythonloop, NULL, cbSourceAvailabilityChangedLoop, (void*) NULL);
+ PyRun_SimpleStringFlags("import sys\n"
+ "import traceback\n"
+ "import gobject\n"
+ "import dbus\n"
+ "import dbus.mainloop.glib\n"
+ "loop = gobject.MainLoop()\n"
+ "def catchSourceAvailability(*arg, **karg):\n"
+ " print ('Caught signal (in catchSourceAvailability handler) ') \n"
+ " print (arg[0])\n"
+ " print (arg[1])\n"
+ " f = open('/tmp/result.txt','w')\n"
+ " f.write(str(arg[0]) + '\\n' + str (arg[1]));\n"
+ " f.close()\n"
+ " loop.quit()\n"
+ "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n"
+ "bus = dbus.SessionBus()\n"
+ "bus.add_signal_receiver(catchSourceAvailability, signal_name='SourceAvailabilityChanged', dbus_interface = 'org.genivi.audiomanager', message_keyword='dbus_message')\n"
+ "loop.run()\n", NULL);
+ pthread_join(pythonloop, NULL);
+
+ ifs.open("/tmp/result.txt");
+ lineCounter = 0;
+ result = 0;
+ while (std::getline(ifs, line))
+ {
+ if (lineCounter == 0)
+ {
+ std::stringstream(line) >> result;
+ ASSERT_EQ(result, 2);
+ }
+ else if (lineCounter == 1)
+ {
+ ASSERT_EQ(line.compare("dbus.Struct((dbus.Int16(0), dbus.Int16(3)), signature=None)"), 0);
+ }
+ lineCounter++;
+ }
+ ifs.close();
+
+ //ok, now we want to test the signals. It did not work out that the python receiver worked in an own thread (as originally intended)
+ //so it is running in the main context and the signals are send from threads...
+ pthread_create(&pythonloop, NULL, VolumeChanged, (void*) NULL);
+ PyRun_SimpleStringFlags("import sys\n"
+ "import traceback\n"
+ "import gobject\n"
+ "import dbus\n"
+ "import dbus.mainloop.glib\n"
+ "loop = gobject.MainLoop()\n"
+ "def catchVolumeChanged(*arg, **karg):\n"
+ " print ('Caught signal (in catchVolumeChanged handler) ') \n"
+ " print (arg[0])\n"
+ " print (arg[1])\n"
+ " f = open('/tmp/result.txt','w')\n"
+ " f.write(str(arg[0]) + '\\n' + str (arg[1]));\n"
+ " f.close()\n"
+ " loop.quit()\n"
+ "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n"
+ "bus = dbus.SessionBus()\n"
+ "bus.add_signal_receiver(catchVolumeChanged, signal_name='VolumeChanged', dbus_interface = 'org.genivi.audiomanager', message_keyword='dbus_message')\n"
+ "loop.run()\n", NULL);
+ pthread_join(pythonloop, NULL);
+
+ ifs.open("/tmp/result.txt");
+ lineCounter = 0;
+ result = 0;
+ while (std::getline(ifs, line))
+ {
+ if (lineCounter == 0)
+ {
+ std::stringstream(line) >> result;
+ ASSERT_EQ(result, 23);
+ }
+ else if (lineCounter == 1)
+ {
+ std::stringstream(line) >> result;
+ ASSERT_EQ(result, 344);
+ }
+ lineCounter++;
+ }
+ ifs.close();
+
+ //ok, now we want to test the signals. It did not work out that the python receiver worked in an own thread (as originally intended)
+ //so it is running in the main context and the signals are send from threads...
+ pthread_create(&pythonloop, NULL, SinkMuteStateChanged, (void*) NULL);
+ PyRun_SimpleStringFlags("import sys\n"
+ "import traceback\n"
+ "import gobject\n"
+ "import dbus\n"
+ "import dbus.mainloop.glib\n"
+ "loop = gobject.MainLoop()\n"
+ "def catchSinkMuteStateChanged(*arg, **karg):\n"
+ " print ('Caught signal (in catchSinkMuteStateChanged handler) ') \n"
+ " print (arg[0])\n"
+ " print (arg[1])\n"
+ " f = open('/tmp/result.txt','w')\n"
+ " f.write(str(arg[0]) + '\\n' + str (arg[1]));\n"
+ " f.close()\n"
+ " loop.quit()\n"
+ "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n"
+ "bus = dbus.SessionBus()\n"
+ "bus.add_signal_receiver(catchSinkMuteStateChanged, signal_name='SinkMuteStateChanged', dbus_interface = 'org.genivi.audiomanager', message_keyword='dbus_message')\n"
+ "loop.run()\n", NULL);
+ pthread_join(pythonloop, NULL);
+
+ ifs.open("/tmp/result.txt");
+ lineCounter = 0;
+ result = 0;
+ while (std::getline(ifs, line))
+ {
+ if (lineCounter == 0)
+ {
+ std::stringstream(line) >> result;
+ ASSERT_EQ(result, 42);
+ }
+ else if (lineCounter == 1)
+ {
+ std::stringstream(line) >> result;
+ ASSERT_EQ(result, MS_MUTED);
+ }
+ lineCounter++;
+ }
+ ifs.close();
+
+ //ok, now we want to test the signals. It did not work out that the python receiver worked in an own thread (as originally intended)
+ //so it is running in the main context and the signals are send from threads...
+ pthread_create(&pythonloop, NULL, SystemPropertyChanged, (void*) NULL);
+ PyRun_SimpleStringFlags("import sys\n"
+ "import traceback\n"
+ "import gobject\n"
+ "import dbus\n"
+ "import dbus.mainloop.glib\n"
+ "loop = gobject.MainLoop()\n"
+ "def catchSystemPropertyChanged(*arg, **karg):\n"
+ " print ('Caught signal (in catchSystemPropertyChanged handler) ') \n"
+ " print (arg[0])\n"
+ " f = open('/tmp/result.txt','w')\n"
+ " f.write(str(arg[0]));\n"
+ " f.close()\n"
+ " loop.quit()\n"
+ "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n"
+ "bus = dbus.SessionBus()\n"
+ "bus.add_signal_receiver(catchSystemPropertyChanged, signal_name='SystemPropertyChanged', dbus_interface = 'org.genivi.audiomanager', message_keyword='dbus_message')\n"
+ "loop.run()\n", NULL);
+ pthread_join(pythonloop, NULL);
+
+ ifs.open("/tmp/result.txt");
+ lineCounter = 0;
+ result = 0;
+ while (std::getline(ifs, line))
+ {
+ ASSERT_EQ(line.compare("dbus.Struct((dbus.Int16(0), dbus.Int16(355)), signature=None)"), 0);
+ }
+ ifs.close();
+
+ //ok, now we want to test the signals. It did not work out that the python receiver worked in an own thread (as originally intended)
+ //so it is running in the main context and the signals are send from threads...
+ pthread_create(&pythonloop, NULL, TimingInformationChanged, (void*) NULL);
+ PyRun_SimpleStringFlags("import sys\n"
+ "import traceback\n"
+ "import gobject\n"
+ "import dbus\n"
+ "import dbus.mainloop.glib\n"
+ "loop = gobject.MainLoop()\n"
+ "def catchTimingInformationChanged(*arg, **karg):\n"
+ " print ('Caught signal (in catchTimingInformationChanged handler) ') \n"
+ " print (arg[0])\n"
+ " print (arg[1])\n"
+ " f = open('/tmp/result.txt','w')\n"
+ " f.write(str(arg[0]) + '\\n' + str (arg[1]));\n"
+ " f.close()\n"
+ " loop.quit()\n"
+ "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n"
+ "bus = dbus.SessionBus()\n"
+ "bus.add_signal_receiver(catchTimingInformationChanged, signal_name='TimingInformationChanged', dbus_interface = 'org.genivi.audiomanager', message_keyword='dbus_message')\n"
+ "loop.run()\n", NULL);
+ pthread_join(pythonloop, NULL);
+
+ ifs.open("/tmp/result.txt");
+ lineCounter = 0;
+ result = 0;
+ while (std::getline(ifs, line))
+ {
+ if (lineCounter == 0)
+ {
+ std::stringstream(line) >> result;
+ ASSERT_EQ(result, 42);
+ }
+ else if (lineCounter == 1)
+ {
+ std::stringstream(line) >> result;
+ ASSERT_EQ(result, 233);
+ }
+ lineCounter++;
+ }
+ ifs.close();
}
-
-
int main(int argc, char **argv)
{
- ::testing::InitGoogleTest(&argc, argv);
- return RUN_ALL_TESTS();
+ ::testing::InitGoogleTest(&argc, argv);
+ return RUN_ALL_TESTS();
}
void dbuscommaninterfacesignalsTest::SetUp()
{
- Py_Initialize();
+ Py_Initialize();
}
-
-
void dbuscommaninterfacesignalsTest::TearDown()
{
- Py_Finalize();
+ Py_Finalize();
}
-
-
-
-
-
diff --git a/PluginControlInterface/src/ControlSender.cpp b/PluginControlInterface/src/ControlSender.cpp
index 0d1b3de..6f83444 100644
--- a/PluginControlInterface/src/ControlSender.cpp
+++ b/PluginControlInterface/src/ControlSender.cpp
@@ -45,6 +45,7 @@ ControlSenderPlugin::~ControlSenderPlugin()
am_Error_e ControlSenderPlugin::startupController(ControlReceiveInterface *controlreceiveinterface)
{
+ (void) controlreceiveinterface;
return E_NOT_USED;
}
@@ -59,178 +60,250 @@ void ControlSenderPlugin::hookAllPluginsLoaded()
am_Error_e ControlSenderPlugin::hookUserConnectionRequest(const am_sourceID_t sourceID, const am_sinkID_t sinkID, am_mainConnectionID_t & mainConnectionID)
{
+ (void) sourceID;
+ (void) sinkID;
+ (void) mainConnectionID;
return E_NOT_USED;
}
am_Error_e ControlSenderPlugin::hookUserDisconnectionRequest(const am_mainConnectionID_t connectionID)
{
+ (void) connectionID;
return E_NOT_USED;
}
am_Error_e ControlSenderPlugin::hookUserSetMainSinkSoundProperty(const am_sinkID_t sinkID, const am_MainSoundProperty_s & soundProperty)
{
+ (void) sinkID;
+ (void) soundProperty;
return E_NOT_USED;
}
am_Error_e ControlSenderPlugin::hookUserSetMainSourceSoundProperty(const am_sourceID_t sourceID, const am_MainSoundProperty_s & soundProperty)
{
+ (void) sourceID;
+ (void) soundProperty;
return E_NOT_USED;
}
am_Error_e ControlSenderPlugin::hookUserSetSystemProperty(const am_SystemProperty_s & property)
{
+ (void) property;
return E_NOT_USED;
}
am_Error_e ControlSenderPlugin::hookUserVolumeChange(const am_sinkID_t SinkID, const am_mainVolume_t newVolume)
{
+ (void) SinkID;
+ (void) newVolume;
return E_NOT_USED;
}
am_Error_e ControlSenderPlugin::hookUserVolumeStep(const am_sinkID_t SinkID, const int16_t increment)
{
+ (void) SinkID;
+ (void) increment;
return E_NOT_USED;
}
am_Error_e ControlSenderPlugin::hookUserSetSinkMuteState(const am_sinkID_t sinkID, const am_MuteState_e muteState)
{
+ (void) sinkID;
+ (void) muteState;
return E_NOT_USED;
}
am_Error_e ControlSenderPlugin::hookSystemRegisterDomain(const am_Domain_s & domainData, am_domainID_t & domainID)
{
+ (void) domainData;
+ (void) domainID;
return E_NOT_USED;
}
am_Error_e ControlSenderPlugin::hookSystemDeregisterDomain(const am_domainID_t domainID)
{
+ (void) domainID;
return E_NOT_USED;
}
void ControlSenderPlugin::hookSystemDomainRegistrationComplete(const am_domainID_t domainID)
{
+ (void) domainID;
}
am_Error_e ControlSenderPlugin::hookSystemRegisterSink(const am_Sink_s & sinkData, am_sinkID_t & sinkID)
{
+ (void) sinkID;
+ (void) sinkData;
return E_NOT_USED;
}
am_Error_e ControlSenderPlugin::hookSystemDeregisterSink(const am_sinkID_t sinkID)
{
+ (void) sinkID;
return E_NOT_USED;
}
am_Error_e ControlSenderPlugin::hookSystemRegisterSource(const am_Source_s & sourceData, am_sourceID_t & sourceID)
{
+ (void) sourceData;
+ (void) sourceID;
return E_NOT_USED;
}
am_Error_e ControlSenderPlugin::hookSystemDeregisterSource(const am_sourceID_t sourceID)
{
+ (void) sourceID;
return E_NOT_USED;
}
am_Error_e ControlSenderPlugin::hookSystemRegisterGateway(const am_Gateway_s & gatewayData, am_gatewayID_t & gatewayID)
{
+ (void) gatewayData;
+ (void) gatewayID;
return E_NOT_USED;
}
am_Error_e ControlSenderPlugin::hookSystemDeregisterGateway(const am_gatewayID_t gatewayID)
{
+ (void) gatewayID;
return E_NOT_USED;
}
am_Error_e ControlSenderPlugin::hookSystemRegisterCrossfader(const am_Crossfader_s & crossfaderData, am_crossfaderID_t & crossfaderID)
{
+ (void) crossfaderData;
+ (void) crossfaderID;
return E_NOT_USED;
}
am_Error_e ControlSenderPlugin::hookSystemDeregisterCrossfader(const am_crossfaderID_t crossfaderID)
{
+ (void) crossfaderID;
return E_NOT_USED;
}
void ControlSenderPlugin::hookSystemSinkVolumeTick(const am_Handle_s handle, const am_sinkID_t sinkID, const am_volume_t volume)
{
+ (void) handle;
+ (void) sinkID;
+ (void) volume;
}
void ControlSenderPlugin::hookSystemSourceVolumeTick(const am_Handle_s handle, const am_sourceID_t sourceID, const am_volume_t volume)
{
+ (void) handle;
+ (void) sourceID;
+ (void) volume;
}
void ControlSenderPlugin::hookSystemInterruptStateChange(const am_sourceID_t sourceID, const am_InterruptState_e interruptState)
{
+ (void) sourceID;
+ (void) interruptState;
}
void ControlSenderPlugin::hookSystemSinkAvailablityStateChange(const am_sinkID_t sinkID, const am_Availability_s & availability)
{
+ (void) sinkID;
+ (void) availability;
}
void ControlSenderPlugin::hookSystemSourceAvailablityStateChange(const am_sourceID_t sourceID, const am_Availability_s & availability)
{
+ (void) sourceID;
+ (void) availability;
}
void ControlSenderPlugin::hookSystemDomainStateChange(const am_domainID_t domainID, const am_DomainState_e state)
{
+ (void) domainID;
+ (void) state;
}
void ControlSenderPlugin::hookSystemReceiveEarlyData(const std::vector<am_EarlyData_s> & data)
{
+ (void) data;
}
void ControlSenderPlugin::hookSystemSpeedChange(const am_speed_t speed)
{
-
+ (void) speed;
}
void ControlSenderPlugin::hookSystemTimingInformationChanged(const am_mainConnectionID_t mainConnectionID, const am_timeSync_t time)
{
-
+ (void) mainConnectionID;
+ (void) time;
}
void ControlSenderPlugin::cbAckConnect(const am_Handle_s handle, const am_Error_e errorID)
{
+ (void) handle;
+ (void) errorID;
}
void ControlSenderPlugin::cbAckDisconnect(const am_Handle_s handle, const am_Error_e errorID)
{
+ (void) handle;
+ (void) errorID;
}
void ControlSenderPlugin::cbAckCrossFade(const am_Handle_s handle, const am_HotSink_e hostsink, const am_Error_e error)
{
+ (void) handle;
+ (void) hostsink;
+ (void) error;
}
void ControlSenderPlugin::cbAckSetSinkVolumeChange(const am_Handle_s handle, const am_volume_t volume, const am_Error_e error)
{
+ (void) error;
+ (void) volume;
+ (void) handle;
}
void ControlSenderPlugin::cbAckSetSourceVolumeChange(const am_Handle_s handle, const am_volume_t voulme, const am_Error_e error)
{
+ (void) error;
+ (void) voulme;
+ (void) handle;
}
void ControlSenderPlugin::cbAckSetSourceState(const am_Handle_s handle, const am_Error_e error)
{
+ (void) error;
+ (void) handle;
}
void ControlSenderPlugin::cbAckSetSourceSoundProperty(const am_Handle_s handle, const am_Error_e error)
{
+ (void) error;
+ (void) handle;
}
void ControlSenderPlugin::cbAckSetSinkSoundProperty(const am_Handle_s handle, const am_Error_e error)
{
+ (void) error;
+ (void) handle;
}
void ControlSenderPlugin::cbAckSetSourceSoundProperties(const am_Handle_s handle, const am_Error_e error)
{
+ (void) error;
+ (void) handle;
}
void ControlSenderPlugin::cbAckSetSinkSoundProperties(const am_Handle_s handle, const am_Error_e error)
{
+ (void) error;
+ (void) handle;
}
am_Error_e ControlSenderPlugin::getConnectionFormatChoice(const am_sourceID_t sourceID, const am_sinkID_t sinkID, const std::vector<am_ConnectionFormat_e> listPossibleConnectionFormats, std::vector<am_ConnectionFormat_e>& listPrioConnectionFormats)
{
+ (void) sourceID;
+ (void) sinkID;
listPrioConnectionFormats = listPossibleConnectionFormats;
return (E_OK);
}
diff --git a/PluginRoutingInterfaceAsync/include/RoutingSenderAsyn.h b/PluginRoutingInterfaceAsync/include/RoutingSenderAsyn.h
index 6ca920d..4dcf29c 100644
--- a/PluginRoutingInterfaceAsync/include/RoutingSenderAsyn.h
+++ b/PluginRoutingInterfaceAsync/include/RoutingSenderAsyn.h
@@ -121,7 +121,7 @@ private:
Worker *worker;
};
std::vector<threadInfo_s> mListWorkers; //<! list of all workers
- static pthread_mutex_t mBlockingMutex; //<! mutex to block the acces of the list
+ static pthread_mutex_t mBlockingMutex; //<! mutex to block the acces of the list
};
class AsyncRoutingSender: public RoutingSendInterface
@@ -138,10 +138,10 @@ public:
am_Error_e asyncSetSinkVolume(const am_Handle_s handle, const am_sinkID_t sinkID, const am_volume_t volume, const am_RampType_e ramp, const am_time_t time);
am_Error_e asyncSetSourceVolume(const am_Handle_s handle, const am_sourceID_t sourceID, const am_volume_t volume, const am_RampType_e ramp, const am_time_t time);
am_Error_e asyncSetSourceState(const am_Handle_s handle, const am_sourceID_t sourceID, const am_SourceState_e state);
- am_Error_e asyncSetSinkSoundProperty(const am_Handle_s handle, const am_SoundProperty_s& soundProperty, const am_sinkID_t sinkID);
- am_Error_e asyncSetSinkSoundProperties(const am_Handle_s handle, const std::vector<am_SoundProperty_s>& listSoundProperties, const am_sinkID_t sinkID);
- am_Error_e asyncSetSourceSoundProperty(const am_Handle_s handle, const am_SoundProperty_s& soundProperty, const am_sourceID_t sourceID);
- am_Error_e asyncSetSourceSoundProperties(const am_Handle_s handle, const std::vector<am_SoundProperty_s>& listSoundProperties, const am_sourceID_t sourceID);
+ am_Error_e asyncSetSinkSoundProperty(const am_Handle_s handle, const am_sinkID_t sinkID, const am_SoundProperty_s& soundProperty);
+ am_Error_e asyncSetSinkSoundProperties(const am_Handle_s handle, const am_sinkID_t sinkID, const std::vector<am_SoundProperty_s>& listSoundProperties);
+ am_Error_e asyncSetSourceSoundProperty(const am_Handle_s handle, const am_sourceID_t sourceID, const am_SoundProperty_s& soundProperty);
+ am_Error_e asyncSetSourceSoundProperties(const am_Handle_s handle, const am_sourceID_t sourceID, const std::vector<am_SoundProperty_s>& listSoundProperties);
am_Error_e asyncCrossFade(const am_Handle_s handle, const am_crossfaderID_t crossfaderID, const am_HotSink_e hotSink, const am_RampType_e rampType, const am_time_t time);
am_Error_e setDomainState(const am_domainID_t domainID, const am_DomainState_e domainState);
am_Error_e returnBusName(std::string& BusName) const;
@@ -211,6 +211,9 @@ public:
private:
/**
* Extra thread that handles dbus stimulation for interrupt tests
+ * This is a very very very basic implementation of the dbus interface
+ * there is not failure handling, nothing.
+ * it is used just for testing, not intended to be used otherwise...
* @param data
*/
static void* InterruptEvents(void* data);
diff --git a/PluginRoutingInterfaceAsync/src/RoutingReceiverAsyncShadow.cpp b/PluginRoutingInterfaceAsync/src/RoutingReceiverAsyncShadow.cpp
index 3192e09..26655e4 100644
--- a/PluginRoutingInterfaceAsync/src/RoutingReceiverAsyncShadow.cpp
+++ b/PluginRoutingInterfaceAsync/src/RoutingReceiverAsyncShadow.cpp
@@ -39,11 +39,11 @@ pthread_mutex_t RoutingReceiverAsyncShadow::mMutex = PTHREAD_MUTEX_INITIALIZER;
RoutingReceiverAsyncShadow::RoutingReceiverAsyncShadow():
asyncMsgReceive(this, &RoutingReceiverAsyncShadow::asyncMsgReceiver), //
-asyncDispatch(this, &RoutingReceiverAsyncShadow::asyncDispatcher),//
-asyncCheck(this, &RoutingReceiverAsyncShadow::asyncChecker), //
-mSocketHandler(), //
-mRoutingReceiveInterface(),//
-mHandle (),//
+ asyncDispatch(this, &RoutingReceiverAsyncShadow::asyncDispatcher), //
+ asyncCheck(this, &RoutingReceiverAsyncShadow::asyncChecker), //
+ mSocketHandler(), //
+ mRoutingReceiveInterface(), //
+mHandle (), //
mPipe()
{
@@ -489,7 +489,8 @@ bool RoutingReceiverAsyncShadow::asyncDispatcher(const sh_pollHandle_t handle, v
bool retVal = false;
pthread_mutex_lock(&mMutex);
- if (mQueue.size() > 0) retVal = true;
+ if (mQueue.size() > 0)
+ retVal = true;
pthread_mutex_unlock(&mMutex);
return (retVal);
@@ -501,7 +502,8 @@ bool RoutingReceiverAsyncShadow::asyncChecker(const sh_pollHandle_t handle, void
(void) userData;
bool returnVal = false;
pthread_mutex_lock(&mMutex);
- if (mQueue.size() > 0) returnVal = true;
+ if (mQueue.size() > 0)
+ returnVal = true;
pthread_mutex_unlock(&mMutex);
return (returnVal);
}
diff --git a/PluginRoutingInterfaceAsync/src/RoutingSenderAsync.cpp b/PluginRoutingInterfaceAsync/src/RoutingSenderAsync.cpp
index 562e269..9a39422 100644
--- a/PluginRoutingInterfaceAsync/src/RoutingSenderAsync.cpp
+++ b/PluginRoutingInterfaceAsync/src/RoutingSenderAsync.cpp
@@ -57,9 +57,6 @@ pthread_mutex_t WorkerThreadPool::mBlockingMutex = PTHREAD_MUTEX_INITIALIZER;
void* AsyncRoutingSender::InterruptEvents(void *data)
{
- //This is a very very very basic implementation of the dbus interface
- //there is not failure handling, nothing.
- //it is used just for testing, not intended to be used otherwise...
RoutingReceiverAsyncShadow *shadow=(RoutingReceiverAsyncShadow *)data;
DBusError err;
DBusMessage* msg;
@@ -69,7 +66,7 @@ void* AsyncRoutingSender::InterruptEvents(void *data)
dbus_uint32_t serial = 0;
DBusMessage* reply;
DBusMessageIter args;
- int answer = dbus_bus_request_name(conn, "org.genivi.test",DBUS_NAME_FLAG_REPLACE_EXISTING , &err);
+ dbus_bus_request_name(conn, "org.genivi.test",DBUS_NAME_FLAG_REPLACE_EXISTING , &err);
while (dbus_connection_read_write_dispatch(conn, -1))
{
@@ -94,7 +91,6 @@ void* AsyncRoutingSender::InterruptEvents(void *data)
else if (dbus_message_is_method_call(msg, "org.genivi.test", "SinkAvailablityStatusChange"))
{
am_sinkID_t sinkID;
- am_timeSync_t delay;
am_Availability_s availability;
dbus_message_iter_init(msg, &args);
dbus_message_iter_get_basic(&args,(void*) &sinkID);
@@ -108,7 +104,6 @@ void* AsyncRoutingSender::InterruptEvents(void *data)
else if (dbus_message_is_method_call(msg, "org.genivi.test", "SourceAvailablityStatusChange"))
{
am_sourceID_t sourceID;
- am_timeSync_t delay;
am_Availability_s availability;
dbus_message_iter_init(msg, &args);
dbus_message_iter_get_basic(&args,(void*) &sourceID);
@@ -123,7 +118,7 @@ void* AsyncRoutingSender::InterruptEvents(void *data)
{
am_sourceID_t sourceID;
- am_InterruptState_e state;
+ am_InterruptState_e state=IS_MIN;
dbus_message_iter_init(msg, &args);
dbus_message_iter_get_basic(&args,(void*) &sourceID);
reply = dbus_message_new_method_return(msg);
@@ -135,6 +130,7 @@ void* AsyncRoutingSender::InterruptEvents(void *data)
}
dbus_connection_flush(conn);
}
+ return NULL;
}
void *WorkerThreadPool::WorkerThread(void* data)
@@ -150,10 +146,11 @@ void *WorkerThreadPool::WorkerThread(void* data)
actWorker->start2work();
actWorker->pPool->finishedWork(myInfo->threadID);
}
+ return NULL;
}
WorkerThreadPool::WorkerThreadPool(int numThreads):
- mNumThreads(numThreads)
+mNumThreads(numThreads)
{
int workerID=0;
mListWorkers.resize(mNumThreads);
@@ -222,58 +219,58 @@ WorkerThreadPool::~WorkerThreadPool()
{
pthread_cancel(mListWorkers[i].threadID);
}
- }
-
-Worker::Worker(WorkerThreadPool *pool):
- pPool(pool), //
- mCancelSem()
-{
}
-void Worker::setCancelSempaphore(sem_t* cancel)
-{
- mCancelSem=cancel;
-}
+Worker::Worker(WorkerThreadPool *pool):
+pPool(pool), //
+ mCancelSem()
+ {
+ }
-bool Worker::timedWait(timespec timer)
-{
- timespec temp;
- if(clock_gettime(0, &temp)==-1)
- {
- DLT_LOG(PluginRoutingAsync, DLT_LOG_ERROR, DLT_STRING("Worker::timedWait error on getting time"));
- }
- temp.tv_nsec+=timer.tv_nsec;
- temp.tv_sec+=timer.tv_sec;
- //if(sem_wait(mCancelSem)==-1)
- if (sem_timedwait(mCancelSem,&temp)==-1)
- {
- //a timeout happened
- if(errno == ETIMEDOUT)
+ void Worker::setCancelSempaphore(sem_t* cancel)
{
- DLT_LOG(PluginRoutingAsync, DLT_LOG_ERROR, DLT_STRING("Worker::timedWait timeout waiting error"));
- return (false);
+ mCancelSem=cancel;
}
- else //failure in waiting, nevertheless, we quit the thread...
+
+ bool Worker::timedWait(timespec timer)
{
- DLT_LOG(PluginRoutingAsync, DLT_LOG_ERROR, DLT_STRING("Worker::timedWait semaphore waiting error"));
- return (true);
+ timespec temp;
+ if(clock_gettime(0, &temp)==-1)
+ {
+ DLT_LOG(PluginRoutingAsync, DLT_LOG_ERROR, DLT_STRING("Worker::timedWait error on getting time"));
+ }
+ temp.tv_nsec+=timer.tv_nsec;
+ temp.tv_sec+=timer.tv_sec;
+ //if(sem_wait(mCancelSem)==-1)
+ if (sem_timedwait(mCancelSem,&temp)==-1)
+ {
+ //a timeout happened
+ if(errno == ETIMEDOUT)
+ {
+ DLT_LOG(PluginRoutingAsync, DLT_LOG_ERROR, DLT_STRING("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"));
+ return (true);
+ }
}
+ DLT_LOG(PluginRoutingAsync, DLT_LOG_ERROR, DLT_STRING("Worker::timedWait semaphore waiting error"));
+ this->cancelWork();
+ return (true);
}
- DLT_LOG(PluginRoutingAsync, DLT_LOG_ERROR, DLT_STRING("Worker::timedWait semaphore waiting error"));
- this->cancelWork();
- return (true);
-}
-AsyncRoutingSender::AsyncRoutingSender():
+ AsyncRoutingSender::AsyncRoutingSender():
mShadow(), //
mReceiveInterface(0), //
- mDomains(createDomainTable()), //
- mSinks(createSinkTable()), //
- mSources ( createSourceTable ( ) ), //
- mGateways ( createGatewayTable ( ) ) , //
- mMapHandleWorker ( ), //
- mMapConnectionIDRoute(),//
- mPool(10)
+ mDomains(createDomainTable()), //
+ mSinks(createSinkTable()), //
+mSources ( createSourceTable ( ) ), //
+mGateways ( createGatewayTable ( ) ) , //
+mMapHandleWorker ( ), //
+mMapConnectionIDRoute(),//
+mPool(10)
{
DLT_REGISTER_CONTEXT(PluginRoutingAsync,"ASY","Async Plugin");
DLT_LOG(PluginRoutingAsync,DLT_LOG_INFO, DLT_STRING("AsyncRoutingSender constructed"));
@@ -374,7 +371,8 @@ am_Error_e AsyncRoutingSender::asyncAbort(const am_Handle_s handle)
pthread_mutex_unlock(&mMapHandleWorkerMutex);
//ok, cancel the action:
- if (mPool.cancelWork(iter->second)) return (E_OK);
+ if (mPool.cancelWork(iter->second))
+ return (E_OK);
return (E_UNKNOWN);
}
@@ -402,7 +400,8 @@ am_Error_e AsyncRoutingSender::asyncConnect(const am_Handle_s handle, const am_c
break;
}
}
- if (sinkIter == mSinks.end()) return (E_NON_EXISTENT); //not found!
+ if (sinkIter == mSinks.end())
+ return (E_NON_EXISTENT); //not found!
//find the source
std::vector<am_Source_s>::iterator sourceIter = mSources.begin();
@@ -414,11 +413,14 @@ am_Error_e AsyncRoutingSender::asyncConnect(const am_Handle_s handle, const am_c
break;
}
}
- if (sourceIter == mSources.end()) return (E_NON_EXISTENT); //not found!
+ if (sourceIter == mSources.end())
+ return (E_NON_EXISTENT); //not found!
//check the format
- if (std::find(source.listConnectionFormats.begin(), source.listConnectionFormats.end(), connectionFormat) == source.listConnectionFormats.end()) return (E_WRONG_FORMAT);
- if (std::find(sink.listConnectionFormats.begin(), sink.listConnectionFormats.end(), connectionFormat) == sink.listConnectionFormats.end()) return (E_WRONG_FORMAT);
+ if (std::find(source.listConnectionFormats.begin(), source.listConnectionFormats.end(), connectionFormat) == source.listConnectionFormats.end())
+ return (E_WRONG_FORMAT);
+ if (std::find(sink.listConnectionFormats.begin(), sink.listConnectionFormats.end(), connectionFormat) == sink.listConnectionFormats.end())
+ return (E_WRONG_FORMAT);
//the operation is ok, lets create a worker, assign it to a task in the task pool
asycConnectWorker *worker = new asycConnectWorker(this, &mPool, &mShadow, handle, connectionID, sourceID, sinkID, connectionFormat);
@@ -495,7 +497,8 @@ am_Error_e AsyncRoutingSender::asyncSetSinkVolume(const am_Handle_s handle, cons
}
}
pthread_mutex_unlock(&mSinksMutex);
- if (sinkIter == mSinks.end()) return (E_NON_EXISTENT); //not found!
+ if (sinkIter == mSinks.end())
+ return (E_NON_EXISTENT); //not found!
asyncSetSinkVolumeWorker *worker = new asyncSetSinkVolumeWorker(this, &mPool, &mShadow, sinkIter->volume, handle, sinkID, volume, ramp, time);
if ((work = mPool.startWork(worker)) == -1)
@@ -536,7 +539,8 @@ am_Error_e AsyncRoutingSender::asyncSetSourceVolume(const am_Handle_s handle, co
}
}
pthread_mutex_unlock(&mSourcesMutex);
- if (sourceIter == mSources.end()) return (E_NON_EXISTENT); //not found!
+ if (sourceIter == mSources.end())
+ return (E_NON_EXISTENT); //not found!
asyncSetSourceVolumeWorker *worker = new asyncSetSourceVolumeWorker(this, &mPool, &mShadow, sourceIter->volume, handle, sourceID, volume, ramp, time);
if ((work = mPool.startWork(worker)) == -1)
@@ -577,7 +581,8 @@ am_Error_e AsyncRoutingSender::asyncSetSourceState(const am_Handle_s handle, con
}
}
pthread_mutex_unlock(&mSourcesMutex);
- if (sourceIter == mSources.end()) return (E_NON_EXISTENT); //not found!
+ if (sourceIter == mSources.end())
+ return (E_NON_EXISTENT); //not found!
asyncSetSourceStateWorker *worker = new asyncSetSourceStateWorker(this, &mPool, &mShadow, handle, sourceID, state);
if ((work = mPool.startWork(worker)) == -1)
@@ -595,7 +600,7 @@ am_Error_e AsyncRoutingSender::asyncSetSourceState(const am_Handle_s handle, con
return (E_OK);
}
-am_Error_e AsyncRoutingSender::asyncSetSinkSoundProperty(const am_Handle_s handle, const am_SoundProperty_s& soundProperty, const am_sinkID_t sinkID)
+am_Error_e AsyncRoutingSender::asyncSetSinkSoundProperty(const am_Handle_s handle, const am_sinkID_t sinkID, const am_SoundProperty_s & soundProperty)
{
assert(mReceiveInterface!=0);
assert(handle.handle!=0);
@@ -618,7 +623,8 @@ am_Error_e AsyncRoutingSender::asyncSetSinkSoundProperty(const am_Handle_s handl
}
}
pthread_mutex_unlock(&mSinksMutex);
- if (sinkIter == mSinks.end()) return (E_NON_EXISTENT); //not found!
+ if (sinkIter == mSinks.end())
+ return (E_NON_EXISTENT); //not found!
asyncSetSinkSoundPropertyWorker *worker = new asyncSetSinkSoundPropertyWorker(this, &mPool, &mShadow, handle, soundProperty, sinkID);
if ((work = mPool.startWork(worker)) == -1)
@@ -639,6 +645,11 @@ am_Error_e AsyncRoutingSender::asyncSetSinkSoundProperty(const am_Handle_s handl
am_Error_e AsyncRoutingSender::asyncCrossFade(const am_Handle_s handle, const am_crossfaderID_t crossfaderID, const am_HotSink_e hotSink, const am_RampType_e rampType, const am_time_t time)
{
//todo: implement crossfader
+ (void) handle;
+ (void) crossfaderID;
+ (void) hotSink;
+ (void) rampType;
+ (void) time;
return E_NOT_USED;
}
@@ -663,7 +674,8 @@ am_Error_e AsyncRoutingSender::setDomainState(const am_domainID_t domainID, cons
}
}
pthread_mutex_unlock(&mDomainsMutex);
- if (domainIter == mDomains.end()) return (E_NON_EXISTENT); //not found!
+ if (domainIter == mDomains.end())
+ return (E_NON_EXISTENT); //not found!
asyncDomainStateChangeWorker *worker = new asyncDomainStateChangeWorker(this, &mPool, &mShadow, domainID, domainState);
if ((work = mPool.startWork(worker)) == -1)
@@ -677,7 +689,7 @@ am_Error_e AsyncRoutingSender::setDomainState(const am_domainID_t domainID, cons
}
-am_Error_e AsyncRoutingSender::asyncSetSourceSoundProperty(const am_Handle_s handle, const am_SoundProperty_s & soundProperty, const am_sourceID_t sourceID)
+am_Error_e AsyncRoutingSender::asyncSetSourceSoundProperty(const am_Handle_s handle, const am_sourceID_t sourceID, const am_SoundProperty_s & soundProperty)
{
assert(mReceiveInterface!=0);
assert(handle.handle!=0);
@@ -700,7 +712,8 @@ am_Error_e AsyncRoutingSender::asyncSetSourceSoundProperty(const am_Handle_s han
}
}
pthread_mutex_unlock(&mSourcesMutex);
- if (sourceIter == mSources.end()) return (E_NON_EXISTENT); //not found!
+ if (sourceIter == mSources.end())
+ return (E_NON_EXISTENT); //not found!
asyncSetSourceSoundPropertyWorker *worker = new asyncSetSourceSoundPropertyWorker(this, &mPool, &mShadow, handle, soundProperty, sourceID);
if ((work = mPool.startWork(worker)) == -1)
@@ -758,9 +771,9 @@ std::vector<am_Sink_s> AsyncRoutingSender::createSinkTable()
{
std::stringstream temp;
temp << i;
- item.domainID = 0; //we cannot know this when the table is created !
+ item.domainID = 0; //we cannot know this when the table is created !
item.name = "mySink" + temp.str();
- item.sinkID = i; //take fixed ids to make thins easy
+ item.sinkID = i; //take fixed ids to make thins easy
item.sinkClassID = 1;
item.volume = 0;
item.listSoundProperties.push_back(sp);
@@ -780,9 +793,9 @@ std::vector<am_Source_s> AsyncRoutingSender::createSourceTable()
{
std::stringstream temp;
temp << i;
- item.domainID = 0; //we cannot know this when the table is created !
+ item.domainID = 0; //we cannot know this when the table is created !
item.name = "mySource" + temp.str();
- item.sourceID = i; //take fixed ids to make thins easy
+ item.sourceID = i; //take fixed ids to make thins easy
item.sourceClassID = 1;
item.volume = 0;
item.visible = true;
@@ -928,14 +941,22 @@ uint16_t AsyncRoutingSender::getInterfaceVersion() const
return (RoutingSendVersion);
}
-am_Error_e am::AsyncRoutingSender::asyncSetSinkSoundProperties(const am_Handle_s handle, const std::vector<am_SoundProperty_s> & listSoundProperties, const am_sinkID_t sinkID)
+am_Error_e AsyncRoutingSender::asyncSetSourceSoundProperties(const am_Handle_s handle, const am_sourceID_t sourceID, const std::vector<am_SoundProperty_s> & listSoundProperties)
{
//todo: implement
+ (void) handle;
+ (void) sourceID;
+ (void) listSoundProperties;
+ return (E_NOT_USED);
}
-am_Error_e am::AsyncRoutingSender::asyncSetSourceSoundProperties(const am_Handle_s handle, const std::vector<am_SoundProperty_s> & listSoundProperties, const am_sourceID_t sourceID)
+am_Error_e AsyncRoutingSender::asyncSetSinkSoundProperties(const am_Handle_s handle, const am_sinkID_t sinkID, const std::vector<am_SoundProperty_s> & listSoundProperties)
{
//todo: implement
+ (void) handle;
+ (void) sinkID;
+ (void) listSoundProperties;
+ return (E_NOT_USED);
}
std::vector<am_Gateway_s> AsyncRoutingSender::createGatewayTable()
@@ -950,7 +971,14 @@ std::vector<am_Gateway_s> AsyncRoutingSender::createGatewayTable()
}
asycConnectWorker::asycConnectWorker(AsyncRoutingSender * asyncSender, WorkerThreadPool *pool, RoutingReceiverAsyncShadow* shadow, const am_Handle_s handle, const am_connectionID_t connectionID, const am_sourceID_t sourceID, const am_sinkID_t sinkID, const am_ConnectionFormat_e connectionFormat) :
- Worker(pool), mAsyncSender(asyncSender), mShadow(shadow), mHandle(handle), mConnectionID(connectionID), mSourceID(sourceID), mSinkID(sinkID), mConnectionFormat(connectionFormat)
+ Worker(pool), //
+ mAsyncSender(asyncSender), //
+ mShadow(shadow), //
+ mHandle(handle), //
+ mConnectionID(connectionID), //
+ mSourceID(sourceID), //
+ mSinkID(sinkID), //
+ mConnectionFormat(connectionFormat)
{
}
@@ -962,7 +990,8 @@ void asycConnectWorker::start2work()
t.tv_sec = 1;
//do something for one second
- if (timedWait(t)) return;
+ if (timedWait(t))
+ return;
am_RoutingElement_s route;
route.sinkID = mSinkID;
route.sourceID = mSourceID;
@@ -985,7 +1014,11 @@ void asycConnectWorker::cancelWork()
}
asycDisConnectWorker::asycDisConnectWorker(AsyncRoutingSender *asyncSender, WorkerThreadPool *pool, RoutingReceiverAsyncShadow *shadow, const am_Handle_s handle, const am_connectionID_t connectionID) :
- Worker(pool), mAsyncSender(asyncSender), mShadow(shadow), mHandle(handle), mConnectionID(connectionID)
+ Worker(pool), //
+ mAsyncSender(asyncSender), //
+ mShadow(shadow), //
+ mHandle(handle), //
+ mConnectionID(connectionID)
{
}
@@ -997,7 +1030,8 @@ void asycDisConnectWorker::start2work()
t.tv_sec = 1;
//do something for one second
- if (timedWait(t)) return;
+ if (timedWait(t))
+ return;
am_RoutingElement_s route;
//enter new connectionID into the list
@@ -1018,7 +1052,15 @@ void asycDisConnectWorker::cancelWork()
}
asyncSetSinkVolumeWorker::asyncSetSinkVolumeWorker(AsyncRoutingSender *asyncSender, WorkerThreadPool *pool, RoutingReceiverAsyncShadow *shadow, const am_volume_t currentVolume, const am_Handle_s handle, const am_sinkID_t sinkID, const am_volume_t volume, const am_RampType_e ramp, const am_time_t time) :
- Worker(pool), mAsyncSender(asyncSender), mShadow(shadow), mCurrentVolume(currentVolume), mHandle(handle), mSinkID(sinkID), mVolume(volume), mRamp(ramp), mTime(time)
+ Worker(pool), //
+ mAsyncSender(asyncSender), //
+ mShadow(shadow), //
+ mCurrentVolume(currentVolume), //
+ mHandle(handle), //
+ mSinkID(sinkID), //
+ mVolume(volume), //
+ mRamp(ramp), //
+ mTime(time)
{
}
@@ -1037,7 +1079,8 @@ void asyncSetSinkVolumeWorker::start2work()
else
mCurrentVolume--;
mShadow->ackSinkVolumeTick(mHandle, mSinkID, mCurrentVolume);
- if (timedWait(t)) return;
+ if (timedWait(t))
+ return;
}
//enter new connectionID into the list
@@ -1057,12 +1100,20 @@ void asyncSetSinkVolumeWorker::cancelWork()
mShadow->ackSetSinkVolumeChange(mHandle, mCurrentVolume, E_ABORTED);
}
-am::asyncSetSourceVolumeWorker::asyncSetSourceVolumeWorker(AsyncRoutingSender *asyncSender, WorkerThreadPool *pool, RoutingReceiverAsyncShadow *shadow, const am_volume_t currentVolume, const am_Handle_s handle, const am_sourceID_t SourceID, const am_volume_t volume, const am_RampType_e ramp, const am_time_t time) :
- Worker(pool), mAsyncSender(asyncSender), mShadow(shadow), mCurrentVolume(currentVolume), mHandle(handle), mSourceID(SourceID), mVolume(volume), mRamp(ramp), mTime(time)
+asyncSetSourceVolumeWorker::asyncSetSourceVolumeWorker(AsyncRoutingSender *asyncSender, WorkerThreadPool *pool, RoutingReceiverAsyncShadow *shadow, const am_volume_t currentVolume, const am_Handle_s handle, const am_sourceID_t SourceID, const am_volume_t volume, const am_RampType_e ramp, const am_time_t time) :
+ Worker(pool), //
+ mAsyncSender(asyncSender), //
+ mShadow(shadow), //
+ mCurrentVolume(currentVolume), //
+ mHandle(handle), //
+ mSourceID(SourceID), //
+ mVolume(volume), //
+ mRamp(ramp), //
+ mTime(time)
{
}
-void am::asyncSetSourceVolumeWorker::start2work()
+void asyncSetSourceVolumeWorker::start2work()
{
//todo: this implementation does not respect time and ramp....
DLT_LOG(PluginRoutingAsync, DLT_LOG_INFO, DLT_STRING("Start setting source volume"));
@@ -1077,7 +1128,8 @@ void am::asyncSetSourceVolumeWorker::start2work()
else
mCurrentVolume--;
mShadow->ackSourceVolumeTick(mHandle, mSourceID, mCurrentVolume);
- if (timedWait(t)) return;
+ if (timedWait(t))
+ return;
}
//enter new connectionID into the list
@@ -1090,19 +1142,24 @@ void am::asyncSetSourceVolumeWorker::start2work()
mAsyncSender->removeHandleSafe(mHandle.handle);
}
-void am::asyncSetSourceVolumeWorker::cancelWork()
+void asyncSetSourceVolumeWorker::cancelWork()
{
mAsyncSender->updateSourceVolumeSafe(mSourceID, mCurrentVolume);
mAsyncSender->removeHandleSafe(mHandle.handle);
mShadow->ackSetSourceVolumeChange(mHandle, mCurrentVolume, E_ABORTED);
}
-am::asyncSetSourceStateWorker::asyncSetSourceStateWorker(AsyncRoutingSender *asyncSender, WorkerThreadPool *pool, RoutingReceiverAsyncShadow *shadow, const am_Handle_s handle, const am_sourceID_t sourceID, const am_SourceState_e state) :
- Worker(pool), mAsyncSender(asyncSender), mShadow(shadow), mHandle(handle), mSourceID(sourceID), mSourcestate(state)
+asyncSetSourceStateWorker::asyncSetSourceStateWorker(AsyncRoutingSender *asyncSender, WorkerThreadPool *pool, RoutingReceiverAsyncShadow *shadow, const am_Handle_s handle, const am_sourceID_t sourceID, const am_SourceState_e state) :
+ Worker(pool), //
+ mAsyncSender(asyncSender), //
+ mShadow(shadow), //
+ mHandle(handle), //
+ mSourceID(sourceID), //
+ mSourcestate(state)
{
}
-void am::asyncSetSourceStateWorker::start2work()
+void asyncSetSourceStateWorker::start2work()
{
DLT_LOG(PluginRoutingAsync, DLT_LOG_INFO, DLT_STRING("Start setting source state"));
timespec t;
@@ -1110,7 +1167,8 @@ void am::asyncSetSourceStateWorker::start2work()
t.tv_sec = 1;
//do something for one second
- if (timedWait(t)) return;
+ if (timedWait(t))
+ return;
//enter new connectionID into the list
mAsyncSender->updateSourceStateSafe(mSourceID, mSourcestate);
@@ -1122,7 +1180,7 @@ void am::asyncSetSourceStateWorker::start2work()
mAsyncSender->removeHandleSafe(mHandle.handle);
}
-void am::asyncSetSourceStateWorker::cancelWork()
+void asyncSetSourceStateWorker::cancelWork()
{
//send the ack
mShadow->ackSetSourceState(mHandle, E_ABORTED);
@@ -1131,12 +1189,17 @@ void am::asyncSetSourceStateWorker::cancelWork()
mAsyncSender->removeHandleSafe(mHandle.handle);
}
-am::asyncSetSinkSoundPropertyWorker::asyncSetSinkSoundPropertyWorker(AsyncRoutingSender *asyncSender, WorkerThreadPool *pool, RoutingReceiverAsyncShadow *shadow, const am_Handle_s handle, const am_SoundProperty_s soundProperty, const am_sinkID_t sinkID) :
- Worker(pool), mAsyncSender(asyncSender), mShadow(shadow), mHandle(), mSinkID(sinkID), mSoundProperty(soundProperty)
+asyncSetSinkSoundPropertyWorker::asyncSetSinkSoundPropertyWorker(AsyncRoutingSender *asyncSender, WorkerThreadPool *pool, RoutingReceiverAsyncShadow *shadow, const am_Handle_s handle, const am_SoundProperty_s soundProperty, const am_sinkID_t sinkID) :
+ Worker(pool), //
+ mAsyncSender(asyncSender), //
+ mShadow(shadow), //
+ mHandle(handle), //
+ mSinkID(sinkID), //
+ mSoundProperty(soundProperty)
{
}
-void am::asyncSetSinkSoundPropertyWorker::start2work()
+void asyncSetSinkSoundPropertyWorker::start2work()
{
DLT_LOG(PluginRoutingAsync, DLT_LOG_INFO, DLT_STRING("Start setting sink sound property"));
timespec t;
@@ -1144,7 +1207,8 @@ void am::asyncSetSinkSoundPropertyWorker::start2work()
t.tv_sec = 1;
//do something for one second
- if (timedWait(t)) return;
+ if (timedWait(t))
+ return;
//enter new connectionID into the list
mAsyncSender->updateSinkSoundPropertySafe(mSinkID, mSoundProperty);
@@ -1156,7 +1220,7 @@ void am::asyncSetSinkSoundPropertyWorker::start2work()
mAsyncSender->removeHandleSafe(mHandle.handle);
}
-void am::asyncSetSinkSoundPropertyWorker::cancelWork()
+void asyncSetSinkSoundPropertyWorker::cancelWork()
{
//send the ack
mShadow->ackSetSinkSoundProperty(mHandle, E_OK);
@@ -1165,12 +1229,17 @@ void am::asyncSetSinkSoundPropertyWorker::cancelWork()
mAsyncSender->removeHandleSafe(mHandle.handle);
}
-am::asyncSetSourceSoundPropertyWorker::asyncSetSourceSoundPropertyWorker(AsyncRoutingSender *asyncSender, WorkerThreadPool *pool, RoutingReceiverAsyncShadow *shadow, const am_Handle_s handle, const am_SoundProperty_s soundProperty, const am_sourceID_t sourceID) :
- Worker(pool), mAsyncSender(asyncSender), mShadow(shadow), mHandle(), mSourceID(sourceID), mSoundProperty(soundProperty)
+asyncSetSourceSoundPropertyWorker::asyncSetSourceSoundPropertyWorker(AsyncRoutingSender *asyncSender, WorkerThreadPool *pool, RoutingReceiverAsyncShadow *shadow, const am_Handle_s handle, const am_SoundProperty_s soundProperty, const am_sourceID_t sourceID) :
+ Worker(pool), //
+ mAsyncSender(asyncSender), //
+ mShadow(shadow), //
+ mHandle(handle), //
+ mSourceID(sourceID), //
+ mSoundProperty(soundProperty)
{
}
-void am::asyncSetSourceSoundPropertyWorker::start2work()
+void asyncSetSourceSoundPropertyWorker::start2work()
{
DLT_LOG(PluginRoutingAsync, DLT_LOG_INFO, DLT_STRING("Start setting source sound property"));
timespec t;
@@ -1178,7 +1247,8 @@ void am::asyncSetSourceSoundPropertyWorker::start2work()
t.tv_sec = 1;
//do something for one second
- if (timedWait(t)) return;
+ if (timedWait(t))
+ return;
//enter new connectionID into the list
mAsyncSender->updateSourceSoundPropertySafe(mSourceID, mSoundProperty);
@@ -1190,7 +1260,7 @@ void am::asyncSetSourceSoundPropertyWorker::start2work()
mAsyncSender->removeHandleSafe(mHandle.handle);
}
-void am::asyncSetSourceSoundPropertyWorker::cancelWork()
+void asyncSetSourceSoundPropertyWorker::cancelWork()
{
//send the ack
mShadow->ackSetSourceSoundProperty(mHandle, E_OK);
@@ -1199,12 +1269,16 @@ void am::asyncSetSourceSoundPropertyWorker::cancelWork()
mAsyncSender->removeHandleSafe(mHandle.handle);
}
-am::asyncDomainStateChangeWorker::asyncDomainStateChangeWorker(AsyncRoutingSender *asyncSender, WorkerThreadPool *pool, RoutingReceiverAsyncShadow *shadow, const am_domainID_t domainID, const am_DomainState_e domainState) :
- Worker(pool), mAsyncSender(asyncSender), mShadow(shadow), mDomainID(domainID), mDomainState(domainState)
+asyncDomainStateChangeWorker::asyncDomainStateChangeWorker(AsyncRoutingSender *asyncSender, WorkerThreadPool *pool, RoutingReceiverAsyncShadow *shadow, const am_domainID_t domainID, const am_DomainState_e domainState) :
+ Worker(pool), //
+ mAsyncSender(asyncSender), //
+ mShadow(shadow), //
+ mDomainID(domainID), //
+ mDomainState(domainState)
{
}
-void am::asyncDomainStateChangeWorker::start2work()
+void asyncDomainStateChangeWorker::start2work()
{
//todo: sendchanged data must be in here !
DLT_LOG(PluginRoutingAsync, DLT_LOG_INFO, DLT_STRING("Start setting source sound property"));
@@ -1213,7 +1287,8 @@ void am::asyncDomainStateChangeWorker::start2work()
t.tv_sec = 1;
//do something for one second
- if (timedWait(t)) return;
+ if (timedWait(t))
+ return;
//enter new connectionID into the list
mAsyncSender->updateDomainstateSafe(mDomainID, mDomainState);
diff --git a/PluginRoutingInterfaceAsync/test/testRoutingInterfaceAsync.cpp b/PluginRoutingInterfaceAsync/test/testRoutingInterfaceAsync.cpp
index 512ef8f..fe74f42 100644
--- a/PluginRoutingInterfaceAsync/test/testRoutingInterfaceAsync.cpp
+++ b/PluginRoutingInterfaceAsync/test/testRoutingInterfaceAsync.cpp
@@ -106,6 +106,8 @@ am_Error_e am::testRoutingInterfaceAsync::handleDomainRegister(const am_Domain_s
void am::testRoutingInterfaceAsync::timerCallback(sh_timerHandle_t handle, void *userData)
{
+ (void) handle;
+ (void) userData;
pSocketHandler.stop_listening();
}
@@ -284,9 +286,6 @@ TEST_F(testRoutingInterfaceAsync,disconnectNonExisting)
handle.handleType = H_CONNECT;
am_connectionID_t connectionID = 4;
- am_sourceID_t sourceID = 2;
- am_sinkID_t sinkID = 1;
- am_ConnectionFormat_e format = CF_ANALOG;
EXPECT_CALL(pReceiveInterface,ackConnect(_,connectionID,E_OK)).Times(0);
EXPECT_CALL(pReceiveInterface,ackDisconnect(_,connectionID,E_OK)).Times(0);
diff --git a/PluginRoutingInterfaceAsync/test/testRoutingInterfaceAsyncInterrupt.cpp b/PluginRoutingInterfaceAsync/test/testRoutingInterfaceAsyncInterrupt.cpp
index be8a326..9f40230 100644
--- a/PluginRoutingInterfaceAsync/test/testRoutingInterfaceAsyncInterrupt.cpp
+++ b/PluginRoutingInterfaceAsync/test/testRoutingInterfaceAsyncInterrupt.cpp
@@ -106,8 +106,10 @@ am_Error_e am::testRoutingInterfaceAsync::handleDomainRegister(const am_Domain_s
return (E_OK);
}
-void am::testRoutingInterfaceAsync::timerCallback(sh_timerHandle_t handle, void *userData)
+void testRoutingInterfaceAsync::timerCallback(sh_timerHandle_t handle, void *userData)
{
+ (void) handle;
+ (void) userData;
pSocketHandler.stop_listening();
}
diff --git a/PluginRoutingInterfaceDbus/include/RoutingSender.h b/PluginRoutingInterfaceDbus/include/RoutingSender.h
index 2b6f75b..700a1f5 100644
--- a/PluginRoutingInterfaceDbus/include/RoutingSender.h
+++ b/PluginRoutingInterfaceDbus/include/RoutingSender.h
@@ -44,10 +44,10 @@ public:
am_Error_e asyncSetSinkVolume(const am_Handle_s handle, const am_sinkID_t sinkID, const am_volume_t volume, const am_RampType_e ramp, const am_time_t time);
am_Error_e asyncSetSourceVolume(const am_Handle_s handle, const am_sourceID_t sourceID, const am_volume_t volume, const am_RampType_e ramp, const am_time_t time);
am_Error_e asyncSetSourceState(const am_Handle_s handle, const am_sourceID_t sourceID, const am_SourceState_e state);
- am_Error_e asyncSetSinkSoundProperty(const am_Handle_s handle, const am_SoundProperty_s& soundProperty, const am_sinkID_t sinkID);
- am_Error_e asyncSetSinkSoundProperties(const am_Handle_s handle, const std::vector<am_SoundProperty_s>& listSoundProperties, const am_sinkID_t sinkID);
- am_Error_e asyncSetSourceSoundProperty(const am_Handle_s handle, const am_SoundProperty_s& soundProperty, const am_sourceID_t sourceID);
- am_Error_e asyncSetSourceSoundProperties(const am_Handle_s handle, const std::vector<am_SoundProperty_s>& listSoundProperties, const am_sourceID_t sourceID);
+ am_Error_e asyncSetSinkSoundProperty(const am_Handle_s handle, const am_sinkID_t sinkID, const am_SoundProperty_s& soundProperty);
+ am_Error_e asyncSetSinkSoundProperties(const am_Handle_s handle, const am_sinkID_t sinkID, const std::vector<am_SoundProperty_s>& listSoundProperties);
+ am_Error_e asyncSetSourceSoundProperty(const am_Handle_s handle, const am_sourceID_t sourceID, const am_SoundProperty_s& soundProperty);
+ am_Error_e asyncSetSourceSoundProperties(const am_Handle_s handle, const am_sourceID_t sourceID, const std::vector<am_SoundProperty_s>& listSoundProperties);
am_Error_e asyncCrossFade(const am_Handle_s handle, const am_crossfaderID_t crossfaderID, const am_HotSink_e hotSink, const am_RampType_e rampType, const am_time_t time);
am_Error_e setDomainState(const am_domainID_t domainID, const am_DomainState_e domainState);
am_Error_e returnBusName(std::string& BusName) const;
diff --git a/PluginRoutingInterfaceDbus/src/RoutingSender.cpp b/PluginRoutingInterfaceDbus/src/RoutingSender.cpp
index 44eadc5..0feb441 100644
--- a/PluginRoutingInterfaceDbus/src/RoutingSender.cpp
+++ b/PluginRoutingInterfaceDbus/src/RoutingSender.cpp
@@ -45,6 +45,7 @@ DbusRoutingSender::~DbusRoutingSender()
void DbusRoutingSender::startupRoutingInterface(RoutingReceiveInterface *routingreceiveinterface)
{
+ (void)routingreceiveinterface;
}
void DbusRoutingSender::routingInterfacesReady()
@@ -57,42 +58,70 @@ void DbusRoutingSender::routingInterfacesRundown()
am_Error_e DbusRoutingSender::asyncAbort(const am_Handle_s handle)
{
+ (void) handle;
+ return (E_NOT_USED);
}
am_Error_e DbusRoutingSender::asyncConnect(const am_Handle_s handle, const am_connectionID_t connectionID, const am_sourceID_t sourceID, const am_sinkID_t sinkID, const am_ConnectionFormat_e connectionFormat)
{
+ (void) handle;
+ (void) connectionID;
+ (void) sourceID;
+ (void) sinkID;
+ (void) connectionFormat;
+ return (E_NOT_USED);
}
am_Error_e DbusRoutingSender::asyncDisconnect(const am_Handle_s handle, const am_connectionID_t connectionID)
{
+ (void) handle;
+ (void) connectionID;
+ return (E_NOT_USED);
}
am_Error_e DbusRoutingSender::asyncSetSinkVolume(const am_Handle_s handle, const am_sinkID_t sinkID, const am_volume_t volume, const am_RampType_e ramp, const am_time_t time)
{
+ (void) handle;
+ (void) sinkID;
+ (void) volume;
+ (void) ramp;
+ (void) time;
+ return (E_NOT_USED);
}
am_Error_e DbusRoutingSender::asyncSetSourceVolume(const am_Handle_s handle, const am_sourceID_t sourceID, const am_volume_t volume, const am_RampType_e ramp, const am_time_t time)
{
+ (void) handle;
+ (void) sourceID;
+ (void) volume;
+ (void) ramp;
+ (void) time;
+ return (E_NOT_USED);
}
am_Error_e DbusRoutingSender::asyncSetSourceState(const am_Handle_s handle, const am_sourceID_t sourceID, const am_SourceState_e state)
{
-}
-
-am_Error_e DbusRoutingSender::asyncSetSinkSoundProperty(const am_Handle_s handle, const am_SoundProperty_s& soundProperty, const am_sinkID_t sinkID)
-{
+ (void) handle;
+ (void) sourceID;
+ (void) state;
+ return (E_NOT_USED);
}
am_Error_e DbusRoutingSender::asyncCrossFade(const am_Handle_s handle, const am_crossfaderID_t crossfaderID, const am_HotSink_e hotSink, const am_RampType_e rampType, const am_time_t time)
{
+ (void) handle;
+ (void) crossfaderID;
+ (void) hotSink;
+ (void) rampType;
+ (void) time;
+ return (E_NOT_USED);
}
am_Error_e DbusRoutingSender::setDomainState(const am_domainID_t domainID, const am_DomainState_e domainState)
{
-}
-
-am_Error_e DbusRoutingSender::asyncSetSourceSoundProperty(const am_Handle_s handle, const am_SoundProperty_s & soundProperty, const am_sourceID_t sourceID)
-{
+ (void) domainID;
+ (void) domainState;
+ return (E_NOT_USED);
}
am_Error_e DbusRoutingSender::returnBusName(std::string & BusName) const
@@ -101,14 +130,36 @@ am_Error_e DbusRoutingSender::returnBusName(std::string & BusName) const
return (E_OK);
}
-am_Error_e DbusRoutingSender::asyncSetSinkSoundProperties(const am_Handle_s handle, const std::vector<am_SoundProperty_s> & listSoundProperties, const am_sinkID_t sinkID)
+am_Error_e DbusRoutingSender::asyncSetSinkSoundProperty(const am_Handle_s handle, const am_sinkID_t sinkID, const am_SoundProperty_s & soundProperty)
{
+ (void) handle;
+ (void) sinkID;
+ (void) soundProperty;
+ return (E_NOT_USED);
+}
+am_Error_e DbusRoutingSender::asyncSetSinkSoundProperties(const am_Handle_s handle, const am_sinkID_t sinkID, const std::vector<am_SoundProperty_s> & listSoundProperties)
+{
+ (void) handle;
+ (void) sinkID;
+ (void) listSoundProperties;
+ return (E_NOT_USED);
}
-am_Error_e DbusRoutingSender::asyncSetSourceSoundProperties(const am_Handle_s handle, const std::vector<am_SoundProperty_s> & listSoundProperties, const am_sourceID_t sourceID)
+am_Error_e DbusRoutingSender::asyncSetSourceSoundProperty(const am_Handle_s handle, const am_sourceID_t sourceID, const am_SoundProperty_s & soundProperty)
{
+ (void) handle;
+ (void) sourceID;
+ (void) soundProperty;
+ return (E_NOT_USED);
+}
+am_Error_e DbusRoutingSender::asyncSetSourceSoundProperties(const am_Handle_s handle, const am_sourceID_t sourceID, const std::vector<am_SoundProperty_s> & listSoundProperties)
+{
+ (void) handle;
+ (void) sourceID;
+ (void) listSoundProperties;
+ return (E_NOT_USED);
}
uint16_t DbusRoutingSender::getInterfaceVersion() const
diff --git a/includes/SocketHandler.h b/includes/SocketHandler.h
index e7e80ba..2a20af6 100644
--- a/includes/SocketHandler.h
+++ b/includes/SocketHandler.h
@@ -130,8 +130,8 @@ private:
sh_timerHandle_t mNextTimer;
sh_timerHandle_t mLastInsertedHandle;
sh_pollHandle_t mLastInsertedPollHandle;
- timespec mTimeout;
bool mRecreatePollfds;
+ timespec mTimeout;
};
/**
diff --git a/includes/audiomanagertypes.h b/includes/audiomanagertypes.h
index 228c848..6c39ad8 100644
--- a/includes/audiomanagertypes.h
+++ b/includes/audiomanagertypes.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_3B272E4F_E824_49e3_862F_3C86FD59D14B__INCLUDED_)
-#define EA_3B272E4F_E824_49e3_862F_3C86FD59D14B__INCLUDED_
+#if !defined(EA_C4520781_52CF_4636_BE82_37A28F483C93__INCLUDED_)
+#define EA_C4520781_52CF_4636_BE82_37A28F483C93__INCLUDED_
#include <stdint.h>
#include "projecttypes.h"
@@ -124,56 +124,56 @@ namespace am {
* After the buildup of a connection the first timing information needs to be sent within 5 seconds, the timing information from the routing adaptors need to be sent via 4 seconds. If the latency for a connection is variable and changes over lifetime of the connection, the routing adaptors shall resend the value and the audiomanger will correct the over all latency.\n
* @author christian
* @version 1.0
- * @created 19-Jan-2012 4:31:47 PM
+ * @created 26-Jan-2012 6:00:48 PM
*/
typedef uint16_t am_domainID_t;
/**
* @author christian
* @version 1.0
- * @created 19-Jan-2012 4:31:47 PM
+ * @created 26-Jan-2012 6:00:48 PM
*/
typedef uint16_t am_sourceID_t;
/**
* @author christian
* @version 1.0
- * @created 19-Jan-2012 4:31:48 PM
+ * @created 26-Jan-2012 6:00:48 PM
*/
typedef uint16_t am_sinkID_t;
/**
* @author christian
* @version 1.0
- * @created 19-Jan-2012 4:31:48 PM
+ * @created 26-Jan-2012 6:00:48 PM
*/
typedef uint16_t am_gatewayID_t;
/**
* @author christian
* @version 1.0
- * @created 19-Jan-2012 4:31:48 PM
+ * @created 26-Jan-2012 6:00:48 PM
*/
typedef uint16_t am_crossfaderID_t;
/**
* @author christian
* @version 1.0
- * @created 19-Jan-2012 4:31:48 PM
+ * @created 26-Jan-2012 6:00:48 PM
*/
typedef uint16_t am_connectionID_t;
/**
* @author christian
* @version 1.0
- * @created 19-Jan-2012 4:31:49 PM
+ * @created 26-Jan-2012 6:00:48 PM
*/
typedef uint16_t am_mainConnectionID_t;
/**
* @author christian
* @version 1.0
- * @created 19-Jan-2012 4:31:49 PM
+ * @created 26-Jan-2012 6:00:48 PM
*/
typedef uint16_t am_speed_t;
@@ -181,7 +181,7 @@ namespace am {
* The unit is 0.1 db steps,The smallest value -3000 (=AM_MUTE). The minimum and maximum can be limited by actual project.
* @author christian
* @version 1.0
- * @created 19-Jan-2012 4:31:49 PM
+ * @created 26-Jan-2012 6:00:48 PM
*/
typedef int16_t am_volume_t;
@@ -190,21 +190,21 @@ namespace am {
* The range of this type is customer specific.
* @author christian
* @version 1.0
- * @created 19-Jan-2012 4:31:49 PM
+ * @created 26-Jan-2012 6:00:48 PM
*/
typedef int16_t am_mainVolume_t;
/**
* @author christian
* @version 1.0
- * @created 19-Jan-2012 4:31:50 PM
+ * @created 26-Jan-2012 6:00:48 PM
*/
typedef uint16_t am_sourceClass_t;
/**
* @author christian
* @version 1.0
- * @created 19-Jan-2012 4:31:50 PM
+ * @created 26-Jan-2012 6:00:48 PM
*/
typedef uint16_t am_sinkClass_t;
@@ -212,7 +212,7 @@ namespace am {
* time in ms!
* @author christian
* @version 1.0
- * @created 19-Jan-2012 4:31:50 PM
+ * @created 26-Jan-2012 6:00:48 PM
*/
typedef uint16_t am_time_t;
@@ -220,7 +220,7 @@ namespace am {
* offset time that is introduced in milli seconds.
* @author christian
* @version 1.0
- * @created 19-Jan-2012 4:31:50 PM
+ * @created 26-Jan-2012 6:00:48 PM
*/
typedef int16_t am_timeSync_t;
@@ -228,7 +228,7 @@ namespace am {
* with the help of this enum, sinks and sources can report their availability state
* @author christian
* @version 1.0
- * @created 19-Jan-2012 4:31:50 PM
+ * @created 26-Jan-2012 6:00:48 PM
*/
enum am_Availablility_e
{
@@ -243,7 +243,7 @@ namespace am {
* represents the connection state
* @author christian
* @version 1.0
- * @created 19-Jan-2012 4:31:50 PM
+ * @created 26-Jan-2012 6:00:48 PM
*/
enum am_ConnectionState_e
{
@@ -274,7 +274,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 19-Jan-2012 4:31:51 PM
+ * @created 26-Jan-2012 6:00:48 PM
*/
enum am_DomainState_e
{
@@ -289,7 +289,7 @@ namespace am {
* This enum characterizes the data of the EarlyData_t
* @author christian
* @version 1.0
- * @created 19-Jan-2012 4:31:51 PM
+ * @created 26-Jan-2012 6:00:48 PM
*/
enum am_EarlyDataType_e
{
@@ -305,7 +305,7 @@ namespace am {
* the errors of the audiomanager. All possible errors are in here. This enum is used widely as return parameter.
* @author christian
* @version 1.0
- * @created 19-Jan-2012 4:31:51 PM
+ * @created 26-Jan-2012 6:00:48 PM
*/
enum am_Error_e
{
@@ -330,7 +330,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 19-Jan-2012 4:31:51 PM
+ * @created 26-Jan-2012 6:00:48 PM
*/
enum am_MuteState_e
{
@@ -344,7 +344,7 @@ namespace am {
* The source state reflects the state of the source
* @author christian
* @version 1.0
- * @created 19-Jan-2012 4:31:52 PM
+ * @created 26-Jan-2012 6:00:48 PM
*/
enum am_SourceState_e
{
@@ -368,7 +368,7 @@ namespace am {
* This enumeration is used to define the type of the action that is correlated to a handle.
* @author christian
* @version 1.0
- * @created 19-Jan-2012 4:31:52 PM
+ * @created 26-Jan-2012 6:00:48 PM
*/
enum am_Handle_e
{
@@ -389,7 +389,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 19-Jan-2012 4:31:52 PM
+ * @created 26-Jan-2012 6:00:48 PM
*/
enum am_InterruptState_e
{
@@ -403,7 +403,7 @@ namespace am {
* describes the active sink of a crossfader.
* @author christian
* @version 1.0
- * @created 19-Jan-2012 4:31:52 PM
+ * @created 26-Jan-2012 6:00:49 PM
*/
enum am_HotSink_e
{
@@ -418,7 +418,7 @@ namespace am {
* this describes the availability of a sink or a source together with the latest change
* @author christian
* @version 1.0
- * @created 19-Jan-2012 4:31:52 PM
+ * @created 26-Jan-2012 6:00:49 PM
*/
struct am_Availability_s
{
@@ -438,7 +438,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 19-Jan-2012 4:31:53 PM
+ * @created 26-Jan-2012 6:00:49 PM
*/
struct am_ClassProperty_s
{
@@ -452,7 +452,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 19-Jan-2012 4:31:53 PM
+ * @created 26-Jan-2012 6:00:49 PM
*/
struct am_Crossfader_s
{
@@ -470,7 +470,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 19-Jan-2012 4:31:53 PM
+ * @created 26-Jan-2012 6:00:49 PM
*/
struct am_Gateway_s
{
@@ -511,7 +511,7 @@ namespace am {
* This represents one "hopp" in a route
* @author christian
* @version 1.0
- * @created 19-Jan-2012 4:31:54 PM
+ * @created 26-Jan-2012 6:00:49 PM
*/
struct am_RoutingElement_s
{
@@ -527,7 +527,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 19-Jan-2012 4:31:54 PM
+ * @created 26-Jan-2012 6:00:49 PM
*/
struct am_Route_s
{
@@ -542,7 +542,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 19-Jan-2012 4:31:54 PM
+ * @created 26-Jan-2012 6:00:49 PM
*/
struct am_SoundProperty_s
{
@@ -556,7 +556,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 19-Jan-2012 4:31:55 PM
+ * @created 26-Jan-2012 6:00:49 PM
*/
struct am_SystemProperty_s
{
@@ -576,7 +576,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 19-Jan-2012 4:31:55 PM
+ * @created 26-Jan-2012 6:00:50 PM
*/
struct am_SinkClass_s
{
@@ -591,7 +591,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 19-Jan-2012 4:31:55 PM
+ * @created 26-Jan-2012 6:00:50 PM
*/
struct am_SourceClass_s
{
@@ -610,7 +610,7 @@ namespace am {
* this type holds all information of sources relevant to the HMI
* @author christian
* @version 1.0
- * @created 19-Jan-2012 4:31:55 PM
+ * @created 26-Jan-2012 6:00:50 PM
*/
struct am_SourceType_s
{
@@ -627,7 +627,7 @@ namespace am {
* this type holds all information of sinks relevant to the HMI
* @author christian
* @version 1.0
- * @created 19-Jan-2012 4:31:56 PM
+ * @created 26-Jan-2012 6:00:50 PM
*/
struct am_SinkType_s
{
@@ -645,7 +645,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 19-Jan-2012 4:31:56 PM
+ * @created 26-Jan-2012 6:00:50 PM
*/
struct am_Handle_s
{
@@ -659,7 +659,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 19-Jan-2012 4:31:56 PM
+ * @created 26-Jan-2012 6:00:50 PM
*/
struct am_MainSoundProperty_s
{
@@ -674,7 +674,7 @@ namespace am {
* this type holds all information of connections relevant to the HMI
* @author christian
* @version 1.0
- * @created 19-Jan-2012 4:31:57 PM
+ * @created 26-Jan-2012 6:00:50 PM
*/
struct am_MainConnectionType_s
{
@@ -691,7 +691,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 19-Jan-2012 4:31:57 PM
+ * @created 26-Jan-2012 6:00:50 PM
*/
struct am_MainConnection_s
{
@@ -707,7 +707,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 19-Jan-2012 4:31:57 PM
+ * @created 26-Jan-2012 6:00:51 PM
*/
struct am_Sink_s
{
@@ -731,7 +731,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 19-Jan-2012 4:31:58 PM
+ * @created 26-Jan-2012 6:00:51 PM
*/
struct am_Source_s
{
@@ -764,7 +764,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 19-Jan-2012 4:31:58 PM
+ * @created 26-Jan-2012 6:00:51 PM
*/
struct am_Domain_s
{
@@ -783,7 +783,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 19-Jan-2012 4:31:59 PM
+ * @created 26-Jan-2012 6:00:51 PM
*/
struct am_Connection_s
{
@@ -803,7 +803,7 @@ namespace am {
* soundProperty_t in case of ED_SOURCE_PROPERTY, ED_SINK_PROPERTY
* @author christian
* @version 1.0
- * @created 19-Jan-2012 4:31:59 PM
+ * @created 26-Jan-2012 6:00:51 PM
*/
union am_EarlyData_u
{
@@ -820,7 +820,7 @@ namespace am {
* sinkID in case of ED_SINK_VOLUME, ED_SINK_PROPERTY
* @author christian
* @version 1.0
- * @created 19-Jan-2012 4:31:59 PM
+ * @created 26-Jan-2012 6:00:51 PM
*/
union am_DataType_u
{
@@ -834,7 +834,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 19-Jan-2012 4:31:59 PM
+ * @created 26-Jan-2012 6:00:51 PM
*/
struct am_EarlyData_s
{
@@ -846,4 +846,4 @@ namespace am {
};
}
-#endif // !defined(EA_3B272E4F_E824_49e3_862F_3C86FD59D14B__INCLUDED_)
+#endif // !defined(EA_C4520781_52CF_4636_BE82_37A28F483C93__INCLUDED_)
diff --git a/includes/command/CommandReceiveInterface.h b/includes/command/CommandReceiveInterface.h
index 8821898..20e4455 100644
--- a/includes/command/CommandReceiveInterface.h
+++ b/includes/command/CommandReceiveInterface.h
@@ -22,12 +22,12 @@
*
* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
*/
-#if !defined(EA_434BDFE9_DDA7_4273_AF1E_77AE60CB055D__INCLUDED_)
-#define EA_434BDFE9_DDA7_4273_AF1E_77AE60CB055D__INCLUDED_
+#if !defined(EA_6FE1E594_3CEA_4eaa_BAD0_7BB39D3150D2__INCLUDED_)
+#define EA_6FE1E594_3CEA_4eaa_BAD0_7BB39D3150D2__INCLUDED_
#include <vector>
#include <string>
-#include "../audiomanagertypes.h"
+#include "audiomanagertypes.h"
namespace am {
class DBusWrapper;
class SocketHandler;
@@ -40,12 +40,20 @@ namespace am {
* The interface towards the Controlling Instance (e.g HMI). It handles the communication towards the HMI and other system components who need to interact with the audiomanagement.
* @author christian
* @version 1.0
- * @created 19-Jan-2012 4:32:00 PM
+ * @created 26-Jan-2012 6:00:52 PM
*/
class CommandReceiveInterface
{
public:
+ CommandReceiveInterface() {
+
+ }
+
+ virtual ~CommandReceiveInterface() {
+
+ }
+
/**
* connects a source to sink
* @return E_OK on success, E_NOT_POSSIBLE on failure, E_ALREADY_EXISTS if the connection does already exists
@@ -196,4 +204,4 @@ namespace am {
};
}
-#endif // !defined(EA_434BDFE9_DDA7_4273_AF1E_77AE60CB055D__INCLUDED_)
+#endif // !defined(EA_6FE1E594_3CEA_4eaa_BAD0_7BB39D3150D2__INCLUDED_)
diff --git a/includes/command/CommandSendInterface.h b/includes/command/CommandSendInterface.h
index 160db6c..f1ec602 100644
--- a/includes/command/CommandSendInterface.h
+++ b/includes/command/CommandSendInterface.h
@@ -22,12 +22,12 @@
*
* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
*/
-#if !defined(EA_55B59518_08CD_47c3_91EC_B59681773D46__INCLUDED_)
-#define EA_55B59518_08CD_47c3_91EC_B59681773D46__INCLUDED_
+#if !defined(EA_B298DDFD_7AC9_4a18_BB8C_595921C525B6__INCLUDED_)
+#define EA_B298DDFD_7AC9_4a18_BB8C_595921C525B6__INCLUDED_
#include <vector>
#include <string>
-#include "../audiomanagertypes.h"
+#include "audiomanagertypes.h"
namespace am {
class CommandReceiveInterface;
@@ -41,12 +41,20 @@ namespace am {
* This interface handles all communication from the AudioManagerDaemon towards the system. It is designed in such a way that only callbacks with no return types are implemented. So when the CommandInterfacePlugins are designed in such a way that they broadcast signals to any node who is interested in the particular information (like signals on Dbus for example), more information can be retrieved via the CommandReceiveInterface.
* @author christian
* @version 1.0
- * @created 19-Jan-2012 4:32:00 PM
+ * @created 26-Jan-2012 6:00:52 PM
*/
class CommandSendInterface
{
public:
+ CommandSendInterface() {
+
+ }
+
+ virtual ~CommandSendInterface() {
+
+ }
+
/**
* This command starts the interface, the plugin itself. This is not meant to start communication with the HMI itself. It is a good idea to implement here everything that sets up the basic communication like DbusCommunication etc...
* @return E_OK on success, E_UNKNOWN on error
@@ -145,10 +153,10 @@ namespace am {
/**
* CommandReceiveVer_0.0.9.
*
- * @param time
* @param mainConnectionID
+ * @param time
*/
- virtual void cbTimingInformationChanged(const am_timeSync_t time, const am_mainConnectionID_t mainConnectionID) =0;
+ virtual void cbTimingInformationChanged(const am_mainConnectionID_t mainConnectionID, const am_timeSync_t time) =0;
/**
* This function returns the version of the interface
* returns E_OK, E_UNKOWN if version is unknown.
@@ -157,4 +165,4 @@ namespace am {
};
}
-#endif // !defined(EA_55B59518_08CD_47c3_91EC_B59681773D46__INCLUDED_)
+#endif // !defined(EA_B298DDFD_7AC9_4a18_BB8C_595921C525B6__INCLUDED_)
diff --git a/includes/config.h b/includes/config.h
index 754b1e9..920b050 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-14-gaf0ba5b"
+#define DAEMONVERSION "ver-0.0.1-16-g002295b"
#define WITH_DBUS_WRAPPER
#define WITH_SOCKETHANDLER_LOOP
diff --git a/includes/control/ControlReceiveInterface.h b/includes/control/ControlReceiveInterface.h
index 85fda32..4a2334c 100644
--- a/includes/control/ControlReceiveInterface.h
+++ b/includes/control/ControlReceiveInterface.h
@@ -22,12 +22,12 @@
*
* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
*/
-#if !defined(EA_E6AC61AD_E107_4b3d_8E11_9A434157C19F__INCLUDED_)
-#define EA_E6AC61AD_E107_4b3d_8E11_9A434157C19F__INCLUDED_
+#if !defined(EA_9550F257_23AE_4781_B149_0E4B3A9889AC__INCLUDED_)
+#define EA_9550F257_23AE_4781_B149_0E4B3A9889AC__INCLUDED_
#include <vector>
#include <string>
-#include "../audiomanagertypes.h"
+#include "audiomanagertypes.h"
namespace am {
class SocketHandler;
}
@@ -39,12 +39,20 @@ namespace am {
* This interface gives access to all important functions of the audiomanager that are used by the AudioManagerController to control the system.
* @author christian
* @version 1.0
- * @created 19-Jan-2012 4:32:00 PM
+ * @created 26-Jan-2012 6:00:52 PM
*/
class ControlReceiveInterface
{
public:
+ ControlReceiveInterface() {
+
+ }
+
+ virtual ~ControlReceiveInterface() {
+
+ }
+
/**
* calculates a route from source to sink.
* @return E_OK on success, E_UNKNOWN on error
@@ -562,4 +570,4 @@ namespace am {
};
}
-#endif // !defined(EA_E6AC61AD_E107_4b3d_8E11_9A434157C19F__INCLUDED_)
+#endif // !defined(EA_9550F257_23AE_4781_B149_0E4B3A9889AC__INCLUDED_)
diff --git a/includes/control/ControlSendInterface.h b/includes/control/ControlSendInterface.h
index 9c1fa7a..401d176 100644
--- a/includes/control/ControlSendInterface.h
+++ b/includes/control/ControlSendInterface.h
@@ -22,12 +22,12 @@
*
* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
*/
-#if !defined(EA_7E13E25E_46FA_4211_BD7C_7169D8F7D065__INCLUDED_)
-#define EA_7E13E25E_46FA_4211_BD7C_7169D8F7D065__INCLUDED_
+#if !defined(EA_7C94464D_AE95_434a_A108_201C19F97A85__INCLUDED_)
+#define EA_7C94464D_AE95_434a_A108_201C19F97A85__INCLUDED_
#include <vector>
#include <string>
-#include "../audiomanagertypes.h"
+#include "audiomanagertypes.h"
namespace am {
class ControlReceiveInterface;
@@ -40,12 +40,20 @@ namespace am {
* All the hooks represent system events that need to be handled. The callback functions are used to handle for example answers to function calls on the AudioManagerCoreInterface.
* @author christian
* @version 1.0
- * @created 19-Jan-2012 4:32:01 PM
+ * @created 26-Jan-2012 6:00:53 PM
*/
class ControlSendInterface
{
public:
+ ControlSendInterface() {
+
+ }
+
+ virtual ~ControlSendInterface() {
+
+ }
+
/**
* Starts up the controller.
*
@@ -359,4 +367,4 @@ namespace am {
};
}
-#endif // !defined(EA_7E13E25E_46FA_4211_BD7C_7169D8F7D065__INCLUDED_)
+#endif // !defined(EA_7C94464D_AE95_434a_A108_201C19F97A85__INCLUDED_)
diff --git a/includes/dbus/DBusWrapper.h b/includes/dbus/DBusWrapper.h
index 528d111..24b2795 100644
--- a/includes/dbus/DBusWrapper.h
+++ b/includes/dbus/DBusWrapper.h
@@ -75,12 +75,12 @@ public:
bool dbusDispatchCallback(const sh_pollHandle_t handle, void* userData);
shPollDispatch_T<DBusWrapper> pDbusDispatchCallback;
- bool dbusCheckCallback(const sh_pollHandle_t handle, void* userData);
- shPollCheck_T<DBusWrapper> pDbusCheckCallback;
-
void dbusFireCallback(const pollfd pollfd, const sh_pollHandle_t handle, void* userData);
shPollFired_T<DBusWrapper> pDbusFireCallback;
+ bool dbusCheckCallback(const sh_pollHandle_t handle, void* userData);
+ shPollCheck_T<DBusWrapper> pDbusCheckCallback;
+
void dbusTimerCallback(sh_timerHandle_t handle, void* userData);
shTimerCallBack_T<DBusWrapper> pDbusTimerCallback;
diff --git a/includes/projecttypes.h b/includes/projecttypes.h
index 6e463b9..8ad8bfa 100644
--- a/includes/projecttypes.h
+++ b/includes/projecttypes.h
@@ -22,15 +22,15 @@
*
* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
*/
-#if !defined(EA_D441AD1F_B077_485c_AE04_AF1567A1359F__INCLUDED_)
-#define EA_D441AD1F_B077_485c_AE04_AF1567A1359F__INCLUDED_
+#if !defined(EA_9A582C38_7B95_4ebf_B316_F765C90F29C5__INCLUDED_)
+#define EA_9A582C38_7B95_4ebf_B316_F765C90F29C5__INCLUDED_
namespace am {
/**
* This enum classifies the format in which data is exchanged within a connection. The enum itself is project specific although there are some Genivi standard formats defined.
* @author christian
* @version 1.0
- * @created 19-Jan-2012 4:31:59 PM
+ * @created 26-Jan-2012 6:00:52 PM
*/
enum am_ConnectionFormat_e
{
@@ -45,7 +45,7 @@ namespace am {
* This enum gives the information about reason for reason for Source/Sink change
* @author christian
* @version 1.0
- * @created 19-Jan-2012 4:31:59 PM
+ * @created 26-Jan-2012 6:00:52 PM
*/
enum am_AvailabilityReason_e
{
@@ -63,7 +63,7 @@ namespace am {
* product specific identifier of property
* @author christian
* @version 1.0
- * @created 19-Jan-2012 4:31:59 PM
+ * @created 26-Jan-2012 6:00:52 PM
*/
enum am_ClassProperty_e
{
@@ -84,7 +84,7 @@ namespace am {
* It is in the responsibility of the product to make sure that the routing plugins are aware of the ramp types used.
* @author christian
* @version 1.0
- * @created 19-Jan-2012 4:31:59 PM
+ * @created 26-Jan-2012 6:00:52 PM
*/
enum am_RampType_e
{
@@ -106,7 +106,7 @@ namespace am {
* sound properties. Within genivi only the standard properties are defined, for products these need to be extended.
* @author christian
* @version 1.0
- * @created 19-Jan-2012 4:31:59 PM
+ * @created 26-Jan-2012 6:00:52 PM
*/
enum am_SoundPropertyType_e
{
@@ -121,7 +121,7 @@ namespace am {
* Here are all SoundProperties that can be set via the CommandInterface. Product specific
* @author christian
* @version 1.0
- * @created 19-Jan-2012 4:31:59 PM
+ * @created 26-Jan-2012 6:00:52 PM
*/
enum am_MainSoundPropertyType_e
{
@@ -138,7 +138,7 @@ namespace am {
* describes the different system properties. Project specific
* @author christian
* @version 1.0
- * @created 19-Jan-2012 4:31:59 PM
+ * @created 26-Jan-2012 6:00:52 PM
*/
enum am_SystemPropertyType_e
{
@@ -147,4 +147,4 @@ namespace am {
SYP_MIN = SYP_TEST
};
}
-#endif // !defined(EA_D441AD1F_B077_485c_AE04_AF1567A1359F__INCLUDED_)
+#endif // !defined(EA_9A582C38_7B95_4ebf_B316_F765C90F29C5__INCLUDED_)
diff --git a/includes/routing/RoutingReceiveInterface.h b/includes/routing/RoutingReceiveInterface.h
index 13752c4..ff33d61 100644
--- a/includes/routing/RoutingReceiveInterface.h
+++ b/includes/routing/RoutingReceiveInterface.h
@@ -22,12 +22,12 @@
*
* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
*/
-#if !defined(EA_5AC7DCDD_B4FD_44d2_8783_CC96D8595F43__INCLUDED_)
-#define EA_5AC7DCDD_B4FD_44d2_8783_CC96D8595F43__INCLUDED_
+#if !defined(EA_6B4A81F5_2BD8_4604_859D_4539E7E95638__INCLUDED_)
+#define EA_6B4A81F5_2BD8_4604_859D_4539E7E95638__INCLUDED_
#include <vector>
#include <string>
-#include "../audiomanagertypes.h"
+#include "audiomanagertypes.h"
namespace am {
class DBusWrapper;
@@ -41,12 +41,20 @@ namespace am {
* Routing Receive sendInterface description. This class implements everything from RoutingAdapter -> Audiomanager
* @author christian
* @version 1.0
- * @created 19-Jan-2012 4:32:01 PM
+ * @created 26-Jan-2012 6:00:53 PM
*/
class RoutingReceiveInterface
{
public:
+ RoutingReceiveInterface() {
+
+ }
+
+ virtual ~RoutingReceiveInterface() {
+
+ }
+
/**
* acknowledges a asyncConnect
*
@@ -324,4 +332,4 @@ namespace am {
};
}
-#endif // !defined(EA_5AC7DCDD_B4FD_44d2_8783_CC96D8595F43__INCLUDED_)
+#endif // !defined(EA_6B4A81F5_2BD8_4604_859D_4539E7E95638__INCLUDED_)
diff --git a/includes/routing/RoutingSendInterface.h b/includes/routing/RoutingSendInterface.h
index ac4b6ab..d046709 100644
--- a/includes/routing/RoutingSendInterface.h
+++ b/includes/routing/RoutingSendInterface.h
@@ -22,12 +22,12 @@
*
* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
*/
-#if !defined(EA_D17051E6_21F6_42a8_A7D0_F996E885E15F__INCLUDED_)
-#define EA_D17051E6_21F6_42a8_A7D0_F996E885E15F__INCLUDED_
+#if !defined(EA_E9CE2BB6_7523_49e4_9B57_31E776765683__INCLUDED_)
+#define EA_E9CE2BB6_7523_49e4_9B57_31E776765683__INCLUDED_
#include <vector>
#include <string>
-#include "../audiomanagertypes.h"
+#include "audiomanagertypes.h"
namespace am {
class RoutingReceiveInterface;
@@ -41,12 +41,20 @@ namespace am {
* This class implements everything from Audiomanager -> RoutingAdapter
* @author christian
* @version 1.0
- * @created 19-Jan-2012 4:32:02 PM
+ * @created 26-Jan-2012 6:00:54 PM
*/
class RoutingSendInterface
{
public:
+ RoutingSendInterface() {
+
+ }
+
+ virtual ~RoutingSendInterface() {
+
+ }
+
/**
* starts up the interface. In the implementations, here is the best place for init routines.
*
@@ -124,37 +132,37 @@ namespace am {
* @return E_OK on success, E_UNKNOWN on error, E_OUT_OF_RANGE in case the propery value is out of range
*
* @param handle
- * @param listSoundProperties
* @param sinkID
+ * @param listSoundProperties
*/
- virtual am_Error_e asyncSetSinkSoundProperties(const am_Handle_s handle, const std::vector<am_SoundProperty_s>& listSoundProperties, const am_sinkID_t sinkID) =0;
+ virtual am_Error_e asyncSetSinkSoundProperties(const am_Handle_s handle, const am_sinkID_t sinkID, const std::vector<am_SoundProperty_s>& listSoundProperties) =0;
/**
* this function sets the sinksoundproperty.
* @return E_OK on success, E_UNKNOWN on error, E_OUT_OF_RANGE in case the propery value is out of range
*
* @param handle
- * @param soundProperty
* @param sinkID
+ * @param soundProperty
*/
- virtual am_Error_e asyncSetSinkSoundProperty(const am_Handle_s handle, const am_SoundProperty_s& soundProperty, const am_sinkID_t sinkID) =0;
+ virtual am_Error_e asyncSetSinkSoundProperty(const am_Handle_s handle, const am_sinkID_t sinkID, const am_SoundProperty_s& soundProperty) =0;
/**
* this function sets the sourcesoundproperty.
* @return E_OK on success, E_UNKNOWN on error, E_OUT_OF_RANGE in case the propery value is out of range
*
* @param handle
- * @param listSoundProperties
* @param sourceID
+ * @param listSoundProperties
*/
- virtual am_Error_e asyncSetSourceSoundProperties(const am_Handle_s handle, const std::vector<am_SoundProperty_s>& listSoundProperties, const am_sourceID_t sourceID) =0;
+ virtual am_Error_e asyncSetSourceSoundProperties(const am_Handle_s handle, const am_sourceID_t sourceID, const std::vector<am_SoundProperty_s>& listSoundProperties) =0;
/**
* this function sets the sourcesoundproperty.
* @return E_OK on success, E_UNKNOWN on error, E_OUT_OF_RANGE in case the propery value is out of range
*
* @param handle
- * @param soundProperty
* @param sourceID
+ * @param soundProperty
*/
- virtual am_Error_e asyncSetSourceSoundProperty(const am_Handle_s handle, const am_SoundProperty_s& soundProperty, const am_sourceID_t sourceID) =0;
+ virtual am_Error_e asyncSetSourceSoundProperty(const am_Handle_s handle, const am_sourceID_t sourceID, const am_SoundProperty_s& soundProperty) =0;
/**
* this function triggers crossfading.
* @return E_OK on success, E_UNKNOWN on error
@@ -188,4 +196,4 @@ namespace am {
};
}
-#endif // !defined(EA_D17051E6_21F6_42a8_A7D0_F996E885E15F__INCLUDED_)
+#endif // !defined(EA_E9CE2BB6_7523_49e4_9B57_31E776765683__INCLUDED_)