summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchristian linke <christian.linke@bmw.de>2013-01-11 13:09:26 +0100
committerchristian linke <christian.linke@bmw.de>2013-01-11 13:09:26 +0100
commit0269a33680a25e5d682761e8af434611cb28d00c (patch)
tree75d9373329f35502ac2272b6d5d37d1aea1f392b
parent1c3e5d99546d0c2d803d50411168d0d887365399 (diff)
downloadaudiomanager-0269a33680a25e5d682761e8af434611cb28d00c.tar.gz
* add support to switch dedicated plugins off, fix databasehandler regarding getSourceInfo and getSinkInfo, add and fix tests for database
Signed-off-by: christian linke <christian.linke@bmw.de>
-rw-r--r--AudioManagerDaemon/src/CAmDatabaseHandler.cpp138
-rwxr-xr-xAudioManagerDaemon/src/CAmTelnetServer.cpp9
-rw-r--r--AudioManagerDaemon/test/AmDatabaseHandlerTest/CAmDatabaseHandlerTest.cpp133
-rw-r--r--AudioManagerDaemon/test/AmDatabaseHandlerTest/CMakeLists.txt4
-rw-r--r--AudioManagerDaemon/test/AmRouterTest/CMakeLists.txt4
-rw-r--r--AudioManagerDaemon/test/AmRoutingInterfaceTest/CMakeLists.txt4
-rw-r--r--AudioManagerDaemon/test/AmTelnetServerTest/CMakeLists.txt4
-rw-r--r--AudioManagerDaemon/test/CAmCommonFunctions.cpp26
-rw-r--r--AudioManagerDaemon/test/CAmCommonFunctions.h1
-rwxr-xr-xCMakeLists.txt5
-rw-r--r--PluginCommandInterfaceDbus/CMakeLists.txt7
-rw-r--r--PluginControlInterface/CMakeLists.txt7
-rw-r--r--PluginRoutingInterfaceAsync/CMakeLists.txt7
-rw-r--r--PluginRoutingInterfaceDbus/CMakeLists.txt6
14 files changed, 269 insertions, 86 deletions
diff --git a/AudioManagerDaemon/src/CAmDatabaseHandler.cpp b/AudioManagerDaemon/src/CAmDatabaseHandler.cpp
index b9fcd4a..06d797b 100644
--- a/AudioManagerDaemon/src/CAmDatabaseHandler.cpp
+++ b/AudioManagerDaemon/src/CAmDatabaseHandler.cpp
@@ -855,7 +855,7 @@ am_Error_e CAmDatabaseHandler::enterSourceDB(const am_Source_s & sourceData, am_
command = "INSERT INTO SourceConnectionFormat" + i2s(sourceID) + std::string("(soundFormat) VALUES (?)");
MY_SQLITE_PREPARE_V2(mpDatabase, command.c_str(), -1, &query, NULL)
std::vector<am_ConnectionFormat_e>::const_iterator connectionFormatIterator = sourceData.listConnectionFormats.begin();
- for (; connectionFormatIterator < sourceData.listConnectionFormats.end(); ++connectionFormatIterator)
+ for (; connectionFormatIterator != sourceData.listConnectionFormats.end(); ++connectionFormatIterator)
{
MY_SQLITE_BIND_INT(query, 1, *connectionFormatIterator)
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
@@ -872,7 +872,7 @@ am_Error_e CAmDatabaseHandler::enterSourceDB(const am_Source_s & sourceData, am_
command = "INSERT INTO SourceSoundProperty" + i2s(sourceID) + std::string("(soundPropertyType,value) VALUES (?,?)");
MY_SQLITE_PREPARE_V2(mpDatabase, command.c_str(), -1, &query, NULL)
std::vector<am_SoundProperty_s>::const_iterator SoundPropertyIterator = sourceData.listSoundProperties.begin();
- for (; SoundPropertyIterator < sourceData.listSoundProperties.end(); ++SoundPropertyIterator)
+ for (; SoundPropertyIterator != sourceData.listSoundProperties.end(); ++SoundPropertyIterator)
{
MY_SQLITE_BIND_INT(query, 1, SoundPropertyIterator->type)
MY_SQLITE_BIND_INT(query, 2, SoundPropertyIterator->value)
@@ -913,7 +913,7 @@ am_Error_e CAmDatabaseHandler::enterSourceDB(const am_Source_s & sourceData, am_
command = "INSERT INTO SourceMainSoundProperty" + i2s(sourceID) + std::string("(soundPropertyType,value) VALUES (?,?)");
MY_SQLITE_PREPARE_V2(mpDatabase, command.c_str(), -1, &query, NULL)
std::vector<am_MainSoundProperty_s>::const_iterator mainSoundPropertyIterator = sourceData.listMainSoundProperties.begin();
- for (; mainSoundPropertyIterator < sourceData.listMainSoundProperties.end(); ++mainSoundPropertyIterator)
+ for (; mainSoundPropertyIterator != sourceData.listMainSoundProperties.end(); ++mainSoundPropertyIterator)
{
MY_SQLITE_BIND_INT(query, 1, mainSoundPropertyIterator->type)
MY_SQLITE_BIND_INT(query, 2, mainSoundPropertyIterator->value)
@@ -935,7 +935,7 @@ am_Error_e CAmDatabaseHandler::enterSourceDB(const am_Source_s & sourceData, am_
command = "INSERT INTO SourceMainNotificationConfiguration" + i2s(sourceID) + std::string("(notificationType,notificationStatus,notificationParameter) VALUES (?,?,?)");
MY_SQLITE_PREPARE_V2(mpDatabase, command.c_str(), -1, &query, NULL)
std::vector<am_NotificationConfiguration_s>::const_iterator mainNotificationConfigurationIterator(sourceData.listMainNotificationConfigurations.begin());
- for (; mainNotificationConfigurationIterator < sourceData.listMainNotificationConfigurations.end(); ++mainNotificationConfigurationIterator)
+ for (; mainNotificationConfigurationIterator != sourceData.listMainNotificationConfigurations.end(); ++mainNotificationConfigurationIterator)
{
MY_SQLITE_BIND_INT(query, 1, mainNotificationConfigurationIterator->notificationType)
MY_SQLITE_BIND_INT(query, 2, mainNotificationConfigurationIterator->notificationStatus)
@@ -1577,11 +1577,12 @@ am_Error_e CAmDatabaseHandler::getSinkInfoDB(const am_sinkID_t sinkID, am_Sink_s
return (E_NON_EXISTENT);
}
- sqlite3_stmt* query = NULL, *qConnectionFormat = NULL, *qSoundProperty = NULL, *qMAinSoundProperty = NULL;
+ sqlite3_stmt* query = NULL, *qConnectionFormat = NULL, *qSoundProperty = NULL, *qMAinSoundProperty = NULL, *qMainNotification = NULL, *qNotification = NULL;
int eCode = 0;
am_ConnectionFormat_e tempConnectionFormat;
am_SoundProperty_s tempSoundProperty;
am_MainSoundProperty_s tempMainSoundProperty;
+ am_NotificationConfiguration_s tempNotificationConfiguration,tempMainNotification;
std::string command = "SELECT name, domainID, sinkClassID, volume, visible, availability, availabilityReason, muteState, mainVolume, sinkID FROM " + std::string(SINK_TABLE) + " WHERE reserved=0 and sinkID=" + i2s(sinkID);
MY_SQLITE_PREPARE_V2(mpDatabase, command.c_str(), -1, &query, NULL)
@@ -1621,17 +1622,45 @@ am_Error_e CAmDatabaseHandler::getSinkInfoDB(const am_sinkID_t sinkID, am_Sink_s
MY_SQLITE_FINALIZE(qSoundProperty)
- //read out MainSoundProperties
- std::string commandMainSoundProperty = "SELECT soundPropertyType, value FROM SinkMainSoundProperty" + i2s(sinkID);
- MY_SQLITE_PREPARE_V2(mpDatabase, commandMainSoundProperty.c_str(), -1, &qMAinSoundProperty, NULL)
- while ((eCode = sqlite3_step(qMAinSoundProperty)) == SQLITE_ROW)
+ std::string notificationCommand = "SELECT notificationType, notificationStatus, notificationParameter FROM SinkNotificationConfiguration" + i2s(sinkID);
+ MY_SQLITE_PREPARE_V2(mpDatabase, notificationCommand.c_str(), -1, &qNotification, NULL)
+
+ while ((eCode = sqlite3_step(qNotification)) == SQLITE_ROW)
{
- tempMainSoundProperty.type = (am_MainSoundPropertyType_e) sqlite3_column_int(qMAinSoundProperty, 0);
- tempMainSoundProperty.value = sqlite3_column_int(qMAinSoundProperty, 1);
- sinkData.listMainSoundProperties.push_back(tempMainSoundProperty);
+ tempNotificationConfiguration.notificationType = static_cast<am_NotificationType_e>(sqlite3_column_int(qNotification, 0));
+ tempNotificationConfiguration.notificationStatus = static_cast<am_NotificationStatus_e>(sqlite3_column_int(qNotification, 1));
+ tempNotificationConfiguration.notificationParameter= static_cast<int16_t>(sqlite3_column_int(qNotification, 2));
+ sinkData.listNotificationConfigurations.push_back(tempNotificationConfiguration);
}
+ MY_SQLITE_FINALIZE(qNotification)
+
+ if (sinkData.visible)
+ {
+
+ //read out MainSoundProperties
+ std::string commandMainSoundProperty = "SELECT soundPropertyType, value FROM SinkMainSoundProperty" + i2s(sinkID);
+ MY_SQLITE_PREPARE_V2(mpDatabase, commandMainSoundProperty.c_str(), -1, &qMAinSoundProperty, NULL)
+ while ((eCode = sqlite3_step(qMAinSoundProperty)) == SQLITE_ROW)
+ {
+ tempMainSoundProperty.type = (am_MainSoundPropertyType_e) sqlite3_column_int(qMAinSoundProperty, 0);
+ tempMainSoundProperty.value = sqlite3_column_int(qMAinSoundProperty, 1);
+ sinkData.listMainSoundProperties.push_back(tempMainSoundProperty);
+ }
+
+ MY_SQLITE_FINALIZE(qMAinSoundProperty)
+
+ std::string mainNotificationCommand = "SELECT notificationType, notificationStatus, notificationParameter FROM SinkMainNotificationConfiguration" + i2s(sinkID);
+ MY_SQLITE_PREPARE_V2(mpDatabase, mainNotificationCommand.c_str(), -1, &qMainNotification, NULL)
- MY_SQLITE_FINALIZE(qMAinSoundProperty)
+ while ((eCode = sqlite3_step(qMainNotification)) == SQLITE_ROW)
+ {
+ tempMainNotification.notificationType = static_cast<am_NotificationType_e>(sqlite3_column_int(qMainNotification, 0));
+ tempMainNotification.notificationStatus = static_cast<am_NotificationStatus_e>(sqlite3_column_int(qMainNotification, 1));
+ tempMainNotification.notificationParameter= static_cast<int16_t>(sqlite3_column_int(qMainNotification, 2));
+ sinkData.listMainNotificationConfigurations.push_back(tempMainNotification);
+ }
+ MY_SQLITE_FINALIZE(qMainNotification)
+ }
}
else if (eCode != SQLITE_DONE)
@@ -1655,11 +1684,12 @@ am_Error_e CAmDatabaseHandler::getSourceInfoDB(const am_sourceID_t sourceID, am_
return (E_NON_EXISTENT);
}
- sqlite3_stmt* query = NULL, *qConnectionFormat = NULL, *qSoundProperty = NULL, *qMAinSoundProperty = NULL;
+ sqlite3_stmt* query = NULL, *qConnectionFormat = NULL, *qSoundProperty = NULL, *qMAinSoundProperty = NULL, *qMainNotification = NULL, *qNotification = NULL;
int eCode = 0;
am_ConnectionFormat_e tempConnectionFormat;
am_SoundProperty_s tempSoundProperty;
am_MainSoundProperty_s tempMainSoundProperty;
+ am_NotificationConfiguration_s tempNotificationConfiguration,tempMainNotification;
std::string command = "SELECT name, domainID, sourceClassID, sourceState, volume, visible, availability, availabilityReason, interruptState, sourceID FROM " + std::string(SOURCE_TABLE) + " WHERE reserved=0 AND sourceID=" + i2s(sourceID);
MY_SQLITE_PREPARE_V2(mpDatabase, command.c_str(), -1, &query, NULL)
@@ -1699,17 +1729,46 @@ am_Error_e CAmDatabaseHandler::getSourceInfoDB(const am_sourceID_t sourceID, am_
MY_SQLITE_FINALIZE(qSoundProperty)
- //read out MainSoundProperties
- std::string commandMainSoundProperty = "SELECT soundPropertyType, value FROM SourceMainSoundProperty" + i2s(sourceID);
- MY_SQLITE_PREPARE_V2(mpDatabase, commandMainSoundProperty.c_str(), -1, &qMAinSoundProperty, NULL)
- while ((eCode = sqlite3_step(qMAinSoundProperty)) == SQLITE_ROW)
+ std::string notificationCommand = "SELECT notificationType, notificationStatus, notificationParameter FROM SourceNotificationConfiguration" + i2s(sourceID);
+ MY_SQLITE_PREPARE_V2(mpDatabase, notificationCommand.c_str(), -1, &qNotification, NULL)
+
+ while ((eCode = sqlite3_step(qNotification)) == SQLITE_ROW)
{
- tempMainSoundProperty.type = (am_MainSoundPropertyType_e) sqlite3_column_int(qMAinSoundProperty, 0);
- tempMainSoundProperty.value = sqlite3_column_int(qMAinSoundProperty, 1);
- sourceData.listMainSoundProperties.push_back(tempMainSoundProperty);
+ tempNotificationConfiguration.notificationType = static_cast<am_NotificationType_e>(sqlite3_column_int(qNotification, 0));
+ tempNotificationConfiguration.notificationStatus = static_cast<am_NotificationStatus_e>(sqlite3_column_int(qNotification, 1));
+ tempNotificationConfiguration.notificationParameter= static_cast<int16_t>(sqlite3_column_int(qNotification, 2));
+ sourceData.listNotificationConfigurations.push_back(tempNotificationConfiguration);
}
+ MY_SQLITE_FINALIZE(qNotification)
+
+ if (sourceData.visible)
+ {
- MY_SQLITE_FINALIZE(qMAinSoundProperty)
+ //read out MainSoundProperties
+ std::string commandMainSoundProperty = "SELECT soundPropertyType, value FROM SourceMainSoundProperty" + i2s(sourceID);
+ MY_SQLITE_PREPARE_V2(mpDatabase, commandMainSoundProperty.c_str(), -1, &qMAinSoundProperty, NULL)
+ while ((eCode = sqlite3_step(qMAinSoundProperty)) == SQLITE_ROW)
+ {
+ tempMainSoundProperty.type = (am_MainSoundPropertyType_e) sqlite3_column_int(qMAinSoundProperty, 0);
+ tempMainSoundProperty.value = sqlite3_column_int(qMAinSoundProperty, 1);
+ sourceData.listMainSoundProperties.push_back(tempMainSoundProperty);
+ }
+
+ MY_SQLITE_FINALIZE(qMAinSoundProperty)
+
+ std::string mainNotificationCommand = "SELECT notificationType, notificationStatus, notificationParameter FROM SourceMainNotificationConfiguration" + i2s(sourceID);
+ MY_SQLITE_PREPARE_V2(mpDatabase, mainNotificationCommand.c_str(), -1, &qMainNotification, NULL)
+
+ while ((eCode = sqlite3_step(qMainNotification)) == SQLITE_ROW)
+ {
+ tempMainNotification.notificationType = static_cast<am_NotificationType_e>(sqlite3_column_int(qMainNotification, 0));
+ tempMainNotification.notificationStatus = static_cast<am_NotificationStatus_e>(sqlite3_column_int(qMainNotification, 1));
+ tempMainNotification.notificationParameter= static_cast<int16_t>(sqlite3_column_int(qMainNotification, 2));
+ sourceData.listMainNotificationConfigurations.push_back(tempMainNotification);
+ }
+ MY_SQLITE_FINALIZE(qMainNotification)
+
+ }
}
else if (eCode != SQLITE_DONE)
{
@@ -1789,7 +1848,13 @@ am_Error_e CAmDatabaseHandler::changeSinkClassInfoDB(const am_SinkClass_s& sinkC
{
logError("DatabaseHandler::setSinkClassInfoDB SQLITE Step error code:", eCode);
MY_SQLITE_FINALIZE(query)
- return (E_DATABASE_ERROR);
+ return (E_DATABASE_ERROR); if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
+ {
+ logError("DatabaseHandler::changeMainSourceNotificationConfigurationDB SQLITE Step error code:", eCode);
+ MY_SQLITE_FINALIZE(query)
+ return (E_DATABASE_ERROR);
+ }
+ MY_SQLITE_FINALIZE(query)
}
MY_SQLITE_RESET(query)
}
@@ -2352,12 +2417,13 @@ am_Error_e CAmDatabaseHandler::getListSinks(std::vector<am_Sink_s> & listSinks)
am_Error_e CAmDatabaseHandler::getListSources(std::vector<am_Source_s> & listSources) const
{
listSources.clear();
- sqlite3_stmt* query = NULL, *qConnectionFormat = NULL, *qSoundProperty = NULL, *qMAinSoundProperty = NULL;
+ sqlite3_stmt* query = NULL, *qConnectionFormat = NULL, *qSoundProperty = NULL, *qMAinSoundProperty = NULL, *qNotification(NULL), *qMainNotification(NULL);
int eCode = 0;
am_Source_s temp;
am_ConnectionFormat_e tempConnectionFormat;
am_SoundProperty_s tempSoundProperty;
am_MainSoundProperty_s tempMainSoundProperty;
+ am_NotificationConfiguration_s tempNotificationConfiguration;
std::string command = "SELECT name, domainID, sourceClassID, sourceState, volume, visible, availability, availabilityReason, interruptState, sourceID FROM " + std::string(SOURCE_TABLE) + " WHERE reserved=0";
MY_SQLITE_PREPARE_V2(mpDatabase, command.c_str(), -1, &query, NULL)
@@ -2397,6 +2463,18 @@ am_Error_e CAmDatabaseHandler::getListSources(std::vector<am_Source_s> & listSou
MY_SQLITE_FINALIZE(qSoundProperty)
+ std::string notificationCommand = "SELECT notificationType, notificationStatus, notificationParameter FROM SourceNotificationConfiguration" + i2s(temp.sourceID);
+ MY_SQLITE_PREPARE_V2(mpDatabase, notificationCommand.c_str(), -1, &qNotification, NULL)
+
+ while ((eCode = sqlite3_step(qNotification)) == SQLITE_ROW)
+ {
+ tempNotificationConfiguration.notificationType = static_cast<am_NotificationType_e>(sqlite3_column_int(qNotification, 0));
+ tempNotificationConfiguration.notificationStatus = static_cast<am_NotificationStatus_e>(sqlite3_column_int(qNotification, 1));
+ tempNotificationConfiguration.notificationParameter= static_cast<int16_t>(sqlite3_column_int(qNotification, 2));
+ temp.listNotificationConfigurations.push_back(tempNotificationConfiguration);
+ }
+ MY_SQLITE_FINALIZE(qNotification)
+
//read out MainSoundProperties if source is visible
if(temp.visible)
{
@@ -2410,6 +2488,18 @@ am_Error_e CAmDatabaseHandler::getListSources(std::vector<am_Source_s> & listSou
}
MY_SQLITE_FINALIZE(qMAinSoundProperty)
+
+ std::string mainNotificationCommand = "SELECT notificationType, notificationStatus, notificationParameter FROM SourceMainNotificationConfiguration" + i2s(temp.sourceID);
+ MY_SQLITE_PREPARE_V2(mpDatabase, mainNotificationCommand.c_str(), -1, &qMainNotification, NULL)
+
+ while ((eCode = sqlite3_step(qMainNotification)) == SQLITE_ROW)
+ {
+ tempNotificationConfiguration.notificationType = static_cast<am_NotificationType_e>(sqlite3_column_int(qMainNotification, 0));
+ tempNotificationConfiguration.notificationStatus = static_cast<am_NotificationStatus_e>(sqlite3_column_int(qMainNotification, 1));
+ tempNotificationConfiguration.notificationParameter= static_cast<int16_t>(sqlite3_column_int(qMainNotification, 2));
+ temp.listMainNotificationConfigurations.push_back(tempNotificationConfiguration);
+ }
+ MY_SQLITE_FINALIZE(qMainNotification)
}
diff --git a/AudioManagerDaemon/src/CAmTelnetServer.cpp b/AudioManagerDaemon/src/CAmTelnetServer.cpp
index fcd7cc7..ee8fb26 100755
--- a/AudioManagerDaemon/src/CAmTelnetServer.cpp
+++ b/AudioManagerDaemon/src/CAmTelnetServer.cpp
@@ -34,6 +34,8 @@
#include <iostream>
#include <iterator>
#include <unistd.h>
+#include <stdexcept>
+#include <cstdlib>
#include "CAmDatabaseHandler.h"
#include "CAmRoutingSender.h"
#include "CAmTelnetMenuHelper.h"
@@ -94,11 +96,16 @@ CAmTelnetServer::CAmTelnetServer(CAmSocketHandler *iSocketHandler, CAmCommandSen
servAddr.sin_family = AF_INET;
servAddr.sin_addr.s_addr = INADDR_ANY;
servAddr.sin_port = htons(servPort);
- assert(bind(mConnectFD, (struct sockaddr *) &servAddr, sizeof(servAddr))==0);
+ if(bind(mConnectFD, (struct sockaddr *) &servAddr, sizeof(servAddr))!=0)
+ {
+ logError("CAmTelnetServer::CAmTelnetServer bind failed, error",errno);
+ throw std::runtime_error("CAmTelnetServer::CAmTelnetServer bind failed");
+ }
if (listen(mConnectFD, mMaxConnections) < 0)
{
logError("TelnetServer::TelnetServerk cannot listen ", errno);
+ throw std::runtime_error("CAmTelnetServer::CAmTelnetServer bind failed");
}
else
logInfo("TelnetServer::TelnetServer started listening on port", mServerPort);
diff --git a/AudioManagerDaemon/test/AmDatabaseHandlerTest/CAmDatabaseHandlerTest.cpp b/AudioManagerDaemon/test/AmDatabaseHandlerTest/CAmDatabaseHandlerTest.cpp
index a5143ef..14e8577 100644
--- a/AudioManagerDaemon/test/AmDatabaseHandlerTest/CAmDatabaseHandlerTest.cpp
+++ b/AudioManagerDaemon/test/AmDatabaseHandlerTest/CAmDatabaseHandlerTest.cpp
@@ -31,6 +31,7 @@ using namespace testing;
//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 equalNotificationConfiguration(const am_NotificationConfiguration_s a, const am_NotificationConfiguration_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);
@@ -214,7 +215,7 @@ TEST_F(CAmDatabaseHandlerTest,getMainConnectionInfo)
}
-TEST_F(CAmDatabaseHandlerTest,getSinKInfo)
+TEST_F(CAmDatabaseHandlerTest,getSinkInfo)
{
//fill the connection database
am_Sink_s staticSink, firstDynamicSink, secondDynamicSink;
@@ -271,7 +272,18 @@ TEST_F(CAmDatabaseHandlerTest,getSinKInfo)
am_Sink_s sinkData;
ASSERT_EQ(E_OK, pDatabaseHandler.getSinkInfoDB(secondDynamicSinkID,sinkData));
- ASSERT_TRUE( (secondDynamicSink.available.availability == sinkData.available.availability) && (secondDynamicSink.available.availabilityReason == sinkData.available.availabilityReason) && (secondDynamicSink.sinkClassID == sinkData.sinkClassID) && (secondDynamicSink.domainID == sinkData.domainID) && (secondDynamicSink.visible == sinkData.visible) && (secondDynamicSink.name.compare(sinkData.name) == 0) && (secondDynamicSink.volume == sinkData.volume) && std::equal(secondDynamicSink.listConnectionFormats.begin(), secondDynamicSink.listConnectionFormats.end(), sinkData.listConnectionFormats.begin()) && std::equal(secondDynamicSink.listMainSoundProperties.begin(), secondDynamicSink.listMainSoundProperties.end(), sinkData.listMainSoundProperties.begin(), equalMainSoundProperty));
+ ASSERT_TRUE( (secondDynamicSink.available.availability == sinkData.available.availability) && //
+ (secondDynamicSink.available.availabilityReason == sinkData.available.availabilityReason) && //
+ (secondDynamicSink.sinkClassID == sinkData.sinkClassID) && //
+ (secondDynamicSink.domainID == sinkData.domainID) && //
+ (secondDynamicSink.visible == sinkData.visible) && //
+ (secondDynamicSink.name.compare(sinkData.name) == 0) && //
+ (secondDynamicSink.volume == sinkData.volume) && //
+ std::equal(secondDynamicSink.listConnectionFormats.begin(), secondDynamicSink.listConnectionFormats.end(), sinkData.listConnectionFormats.begin()) && //
+ std::equal(secondDynamicSink.listMainSoundProperties.begin(), secondDynamicSink.listMainSoundProperties.end(), sinkData.listMainSoundProperties.begin(), equalMainSoundProperty) && //
+ std::equal(secondDynamicSink.listNotificationConfigurations.begin(), secondDynamicSink.listNotificationConfigurations.end(), sinkData.listNotificationConfigurations.begin(), equalNotificationConfiguration) && //
+ std::equal(secondDynamicSink.listMainNotificationConfigurations.begin(), secondDynamicSink.listMainNotificationConfigurations.end(), sinkData.listMainNotificationConfigurations.begin(), equalNotificationConfiguration) //
+ );
}
@@ -335,8 +347,16 @@ TEST_F(CAmDatabaseHandlerTest,getSourceInfo)
am_Source_s sourceData;
ASSERT_EQ(E_OK, pDatabaseHandler.getSourceInfoDB(secondDynamicSourceID,sourceData));
- ASSERT_TRUE(
- (secondDynamicSource.available.availability == sourceData.available.availability) && (secondDynamicSource.available.availabilityReason == sourceData.available.availabilityReason) && (secondDynamicSource.sourceClassID == sourceData.sourceClassID) && (secondDynamicSource.domainID == sourceData.domainID) && (secondDynamicSource.interruptState == sourceData.interruptState) && (secondDynamicSource.visible == sourceData.visible) && (secondDynamicSource.name.compare(sourceData.name) == 0) && (secondDynamicSource.volume == sourceData.volume) && std::equal(secondDynamicSource.listConnectionFormats.begin(), secondDynamicSource.listConnectionFormats.end(), sourceData.listConnectionFormats.begin()) && std::equal(secondDynamicSource.listMainSoundProperties.begin(), secondDynamicSource.listMainSoundProperties.end(), sourceData.listMainSoundProperties.begin(), equalMainSoundProperty));
+ ASSERT_TRUE((secondDynamicSource.available.availability == sourceData.available.availability) && //
+ (secondDynamicSource.available.availabilityReason == sourceData.available.availabilityReason) && //
+ (secondDynamicSource.sourceClassID == sourceData.sourceClassID) && (secondDynamicSource.domainID == sourceData.domainID) && //
+ (secondDynamicSource.interruptState == sourceData.interruptState) && (secondDynamicSource.visible == sourceData.visible) && //
+ (secondDynamicSource.name.compare(sourceData.name) == 0) && (secondDynamicSource.volume == sourceData.volume) && //
+ std::equal(secondDynamicSource.listConnectionFormats.begin(), secondDynamicSource.listConnectionFormats.end(), sourceData.listConnectionFormats.begin()) && //
+ std::equal(secondDynamicSource.listMainSoundProperties.begin(), secondDynamicSource.listMainSoundProperties.end(), sourceData.listMainSoundProperties.begin(), equalMainSoundProperty) && //
+ std::equal(secondDynamicSource.listMainNotificationConfigurations.begin(), secondDynamicSource.listMainNotificationConfigurations.end(), sourceData.listMainNotificationConfigurations.begin(), equalNotificationConfiguration) && //
+ std::equal(secondDynamicSource.listNotificationConfigurations.begin(), secondDynamicSource.listNotificationConfigurations.end(), sourceData.listNotificationConfigurations.begin(), equalNotificationConfiguration) //
+ );
}
@@ -1917,7 +1937,7 @@ TEST_F(CAmDatabaseHandlerTest,enterSinksCorrect)
TEST_F(CAmDatabaseHandlerTest,enterNotificationConfigurationCorrect)
{
- am_Sink_s testSinkData;
+ am_Sink_s testSinkData, readoutData;
pCF.createSink(testSinkData);
testSinkData.sinkID = 4;
am_sinkID_t sinkID;
@@ -1937,9 +1957,17 @@ TEST_F(CAmDatabaseHandlerTest,enterNotificationConfigurationCorrect)
ASSERT_EQ(E_OK,pDatabaseHandler.getListSinks(listSinks))
<< "ERROR: database error";
- ASSERT_EQ(listSinks.begin()->listNotificationConfigurations.begin()->notificationParameter,notify.notificationParameter);
- ASSERT_EQ(listSinks.begin()->listNotificationConfigurations.begin()->notificationStatus,notify.notificationStatus);
- ASSERT_EQ(listSinks.begin()->listNotificationConfigurations.begin()->notificationType,notify.notificationType);
+ ASSERT_EQ(listSinks.begin()->listNotificationConfigurations[2].notificationParameter,notify.notificationParameter);
+ ASSERT_EQ(listSinks.begin()->listNotificationConfigurations[2].notificationStatus,notify.notificationStatus);
+ ASSERT_EQ(listSinks.begin()->listNotificationConfigurations[2].notificationType,notify.notificationType);
+
+ ASSERT_EQ(E_OK,pDatabaseHandler.getSinkInfoDB(testSinkData.sinkID,readoutData))
+ << "ERROR: database error";
+
+ ASSERT_EQ(readoutData.listNotificationConfigurations[2].notificationParameter,notify.notificationParameter);
+ ASSERT_EQ(readoutData.listNotificationConfigurations[2].notificationStatus,notify.notificationStatus);
+ ASSERT_EQ(readoutData.listNotificationConfigurations[2].notificationType,notify.notificationType);
+
}
TEST_F(CAmDatabaseHandlerTest,enterMainNotificationConfigurationCorrect)
@@ -1965,12 +1993,12 @@ TEST_F(CAmDatabaseHandlerTest,enterMainNotificationConfigurationCorrect)
ASSERT_EQ(E_OK,pDatabaseHandler.getListSinks(listSinks))
<< "ERROR: database error";
- ASSERT_EQ(listSinks.begin()->listMainNotificationConfigurations.begin()->notificationParameter,notify.notificationParameter);
- ASSERT_EQ(listSinks.begin()->listMainNotificationConfigurations.begin()->notificationStatus,notify.notificationStatus);
- ASSERT_EQ(listSinks.begin()->listMainNotificationConfigurations.begin()->notificationType,notify.notificationType);
+ ASSERT_EQ(listSinks.begin()->listMainNotificationConfigurations[2].notificationParameter,notify.notificationParameter);
+ ASSERT_EQ(listSinks.begin()->listMainNotificationConfigurations[2].notificationStatus,notify.notificationStatus);
+ ASSERT_EQ(listSinks.begin()->listMainNotificationConfigurations[2].notificationType,notify.notificationType);
}
-TEST_F(CAmDatabaseHandlerTest,removeNotifications)
+TEST_F(CAmDatabaseHandlerTest,removeNotificationsSink)
{
am_Sink_s testSinkData;
pCF.createSink(testSinkData);
@@ -1993,14 +2021,45 @@ TEST_F(CAmDatabaseHandlerTest,removeNotifications)
ASSERT_EQ(E_OK,pDatabaseHandler.getListSinks(listSinks))
<< "ERROR: database error";
- ASSERT_EQ(listSinks.begin()->listMainNotificationConfigurations.begin()->notificationParameter,notify.notificationParameter);
- ASSERT_EQ(listSinks.begin()->listMainNotificationConfigurations.begin()->notificationStatus,notify.notificationStatus);
- ASSERT_EQ(listSinks.begin()->listMainNotificationConfigurations.begin()->notificationType,notify.notificationType);
+ ASSERT_EQ(listSinks.begin()->listMainNotificationConfigurations[2].notificationParameter,notify.notificationParameter);
+ ASSERT_EQ(listSinks.begin()->listMainNotificationConfigurations[2].notificationStatus,notify.notificationStatus);
+ ASSERT_EQ(listSinks.begin()->listMainNotificationConfigurations[2].notificationType,notify.notificationType);
//now we remove the sink
ASSERT_EQ(E_OK,pDatabaseHandler.removeSinkDB(sinkID));
}
+TEST_F(CAmDatabaseHandlerTest,removeNotificationsSource)
+{
+ am_Source_s testSourceData;
+ pCF.createSource(testSourceData);
+ testSourceData.sourceID = 4;
+ am_sourceID_t sourceID;
+ std::vector<am_Source_s> listSources;
+
+ am_NotificationConfiguration_s notify;
+ notify.notificationType=NT_UNKNOWN;
+ notify.notificationStatus=NS_CHANGE;
+ notify.notificationParameter=25;
+
+ testSourceData.listMainNotificationConfigurations.push_back(notify);
+
+ //enter the sink in the database
+ ASSERT_EQ(E_OK,pDatabaseHandler.enterSourceDB(testSourceData,sourceID))
+ << "ERROR: database error";
+
+ //read it again
+ ASSERT_EQ(E_OK,pDatabaseHandler.getListSources(listSources))
+ << "ERROR: database error";
+
+ ASSERT_EQ(listSources.begin()->listMainNotificationConfigurations[2].notificationParameter,notify.notificationParameter);
+ ASSERT_EQ(listSources.begin()->listMainNotificationConfigurations[2].notificationStatus,notify.notificationStatus);
+ ASSERT_EQ(listSources.begin()->listMainNotificationConfigurations[2].notificationType,notify.notificationType);
+
+ //now we remove the sink
+ ASSERT_EQ(E_OK,pDatabaseHandler.removeSourceDB(sourceID));
+}
+
TEST_F(CAmDatabaseHandlerTest,getMainNotificationsSink)
{
am_Sink_s testSinkData;
@@ -2032,13 +2091,7 @@ TEST_F(CAmDatabaseHandlerTest,getMainNotificationsSink)
ASSERT_EQ(E_OK,pDatabaseHandler.getListSinkMainNotificationConfigurations(sinkID,returnList))
<< "ERROR: database error";
- ASSERT_EQ(returnList[0].notificationParameter,notify.notificationParameter);
- ASSERT_EQ(returnList[0].notificationStatus,notify.notificationStatus);
- ASSERT_EQ(returnList[0].notificationType,notify.notificationType);
-
- ASSERT_EQ(returnList[1].notificationParameter,notify1.notificationParameter);
- ASSERT_EQ(returnList[1].notificationStatus,notify1.notificationStatus);
- ASSERT_EQ(returnList[1].notificationType,notify1.notificationType);
+ std::equal(testSinkData.listMainNotificationConfigurations.begin(),testSinkData.listMainNotificationConfigurations.end(),returnList.begin(),equalNotificationConfiguration);
}
@@ -2073,13 +2126,7 @@ TEST_F(CAmDatabaseHandlerTest,getMainNotificationsSources)
ASSERT_EQ(E_OK,pDatabaseHandler.getListSourceMainNotificationConfigurations(sourceID,returnList))
<< "ERROR: database error";
- ASSERT_EQ(returnList[0].notificationParameter,notify.notificationParameter);
- ASSERT_EQ(returnList[0].notificationStatus,notify.notificationStatus);
- ASSERT_EQ(returnList[0].notificationType,notify.notificationType);
-
- ASSERT_EQ(returnList[1].notificationParameter,notify1.notificationParameter);
- ASSERT_EQ(returnList[1].notificationStatus,notify1.notificationStatus);
- ASSERT_EQ(returnList[1].notificationType,notify1.notificationType);
+ std::equal(testSourceData.listMainNotificationConfigurations.begin(),testSourceData.listMainNotificationConfigurations.end(),returnList.begin(),equalNotificationConfiguration);
}
@@ -2119,13 +2166,7 @@ TEST_F(CAmDatabaseHandlerTest,changeMainNotificationsSources)
ASSERT_EQ(E_OK,pDatabaseHandler.getListSourceMainNotificationConfigurations(sourceID,returnList))
<< "ERROR: database error";
- ASSERT_EQ(returnList[0].notificationParameter,notify.notificationParameter);
- ASSERT_EQ(returnList[0].notificationStatus,notify.notificationStatus);
- ASSERT_EQ(returnList[0].notificationType,notify.notificationType);
-
- ASSERT_EQ(returnList[1].notificationParameter,notify1.notificationParameter);
- ASSERT_EQ(returnList[1].notificationStatus,notify1.notificationStatus);
- ASSERT_EQ(returnList[1].notificationType,notify1.notificationType);
+ std::equal(testSourceData.listMainNotificationConfigurations.begin(),testSourceData.listMainNotificationConfigurations.end(),returnList.begin(),equalNotificationConfiguration);
//change a setting
ASSERT_EQ(E_OK,pDatabaseHandler.changeMainSourceNotificationConfigurationDB(sourceID,notify2));
@@ -2133,9 +2174,9 @@ TEST_F(CAmDatabaseHandlerTest,changeMainNotificationsSources)
ASSERT_EQ(E_OK,pDatabaseHandler.getListSourceMainNotificationConfigurations(sourceID,returnList1))
<< "ERROR: database error";
- ASSERT_EQ(returnList1[1].notificationParameter,notify2.notificationParameter);
- ASSERT_EQ(returnList1[1].notificationStatus,notify2.notificationStatus);
- ASSERT_EQ(returnList1[1].notificationType,notify2.notificationType);
+ ASSERT_EQ(returnList1[3].notificationParameter,notify2.notificationParameter);
+ ASSERT_EQ(returnList1[3].notificationStatus,notify2.notificationStatus);
+ ASSERT_EQ(returnList1[3].notificationType,notify2.notificationType);
}
@@ -2175,13 +2216,7 @@ TEST_F(CAmDatabaseHandlerTest,changeMainNotificationsSink)
ASSERT_EQ(E_OK,pDatabaseHandler.getListSinkMainNotificationConfigurations(sinkID,returnList))
<< "ERROR: database error";
- ASSERT_EQ(returnList[0].notificationParameter,notify.notificationParameter);
- ASSERT_EQ(returnList[0].notificationStatus,notify.notificationStatus);
- ASSERT_EQ(returnList[0].notificationType,notify.notificationType);
-
- ASSERT_EQ(returnList[1].notificationParameter,notify1.notificationParameter);
- ASSERT_EQ(returnList[1].notificationStatus,notify1.notificationStatus);
- ASSERT_EQ(returnList[1].notificationType,notify1.notificationType);
+ std::equal(testSinkData.listMainNotificationConfigurations.begin(),testSinkData.listMainNotificationConfigurations.end(),returnList.begin(),equalNotificationConfiguration);
ASSERT_EQ(E_OK,pDatabaseHandler.changeMainSinkNotificationConfigurationDB(sinkID,notify2))
<< "ERROR: database error";
@@ -2189,9 +2224,9 @@ TEST_F(CAmDatabaseHandlerTest,changeMainNotificationsSink)
ASSERT_EQ(E_OK,pDatabaseHandler.getListSinkMainNotificationConfigurations(sinkID,returnList1))
<< "ERROR: database error";
- ASSERT_EQ(returnList1[1].notificationParameter,notify2.notificationParameter);
- ASSERT_EQ(returnList1[1].notificationStatus,notify2.notificationStatus);
- ASSERT_EQ(returnList1[1].notificationType,notify2.notificationType);
+ ASSERT_EQ(returnList1[3].notificationParameter,notify2.notificationParameter);
+ ASSERT_EQ(returnList1[3].notificationStatus,notify2.notificationStatus);
+ ASSERT_EQ(returnList1[3].notificationType,notify2.notificationType);
}
//Commented out - gives always a warning..
diff --git a/AudioManagerDaemon/test/AmDatabaseHandlerTest/CMakeLists.txt b/AudioManagerDaemon/test/AmDatabaseHandlerTest/CMakeLists.txt
index f4c7ecb..83e7197 100644
--- a/AudioManagerDaemon/test/AmDatabaseHandlerTest/CMakeLists.txt
+++ b/AudioManagerDaemon/test/AmDatabaseHandlerTest/CMakeLists.txt
@@ -61,8 +61,8 @@ file(GLOB DATABASE_SRCS_CXX
)
IF(WITH_NSM)
- SET (CONTROL_INTERFACE_SRCS_CXX
- ${CONTROL_INTERFACE_SRCS_CXX}
+ SET (DATABASE_SRCS_CXX
+ ${DATABASE_SRCS_CXX}
"../../src/CAmNodeStateCommunicator.cpp")
ENDIF(WITH_NSM)
diff --git a/AudioManagerDaemon/test/AmRouterTest/CMakeLists.txt b/AudioManagerDaemon/test/AmRouterTest/CMakeLists.txt
index 67c1065..d820118 100644
--- a/AudioManagerDaemon/test/AmRouterTest/CMakeLists.txt
+++ b/AudioManagerDaemon/test/AmRouterTest/CMakeLists.txt
@@ -61,8 +61,8 @@ file(GLOB ROUTING_SRCS_CXX
)
IF(WITH_NSM)
- SET (CONTROL_INTERFACE_SRCS_CXX
- ${CONTROL_INTERFACE_SRCS_CXX}
+ SET (ROUTING_SRCS_CXX
+ ${ROUTING_SRCS_CXX}
"../../src/CAmNodeStateCommunicator.cpp")
ENDIF(WITH_NSM)
diff --git a/AudioManagerDaemon/test/AmRoutingInterfaceTest/CMakeLists.txt b/AudioManagerDaemon/test/AmRoutingInterfaceTest/CMakeLists.txt
index 2928335..3799151 100644
--- a/AudioManagerDaemon/test/AmRoutingInterfaceTest/CMakeLists.txt
+++ b/AudioManagerDaemon/test/AmRoutingInterfaceTest/CMakeLists.txt
@@ -62,8 +62,8 @@ file(GLOB ROUTING_INTERFACE_SRCS_CXX
)
IF(WITH_NSM)
- SET (CONTROL_INTERFACE_SRCS_CXX
- ${CONTROL_INTERFACE_SRCS_CXX}
+ SET (ROUTING_INTERFACE_SRCS_CXX
+ ${ROUTING_INTERFACE_SRCS_CXX}
"../../src/CAmNodeStateCommunicator.cpp")
ENDIF(WITH_NSM)
diff --git a/AudioManagerDaemon/test/AmTelnetServerTest/CMakeLists.txt b/AudioManagerDaemon/test/AmTelnetServerTest/CMakeLists.txt
index 925b2f0..999ba1d 100644
--- a/AudioManagerDaemon/test/AmTelnetServerTest/CMakeLists.txt
+++ b/AudioManagerDaemon/test/AmTelnetServerTest/CMakeLists.txt
@@ -68,8 +68,8 @@ file(GLOB TELNET_SRCS_CXX
)
IF(WITH_NSM)
- SET (CONTROL_INTERFACE_SRCS_CXX
- ${CONTROL_INTERFACE_SRCS_CXX}
+ SET (TELNET_SRCS_CXX
+ ${TELNET_SRCS_CXX}
"../../src/CAmNodeStateCommunicator.cpp")
ENDIF(WITH_NSM)
diff --git a/AudioManagerDaemon/test/CAmCommonFunctions.cpp b/AudioManagerDaemon/test/CAmCommonFunctions.cpp
index b11c3a2..c1f1af4 100644
--- a/AudioManagerDaemon/test/CAmCommonFunctions.cpp
+++ b/AudioManagerDaemon/test/CAmCommonFunctions.cpp
@@ -109,6 +109,11 @@ bool equalMainSoundProperty(const am_MainSoundProperty_s a, const am_MainSoundPr
return (a.type == b.type && a.value == b.value);
}
+bool equalNotificationConfiguration(const am_NotificationConfiguration_s a, const am_NotificationConfiguration_s b)
+{
+ return (a.notificationParameter == b.notificationParameter && a.notificationStatus == b.notificationStatus && a.notificationType == b.notificationType);
+}
+
bool equalRoutingElement(const am_RoutingElement_s a, const am_RoutingElement_s b)
{
return (a.connectionFormat == b.connectionFormat && a.domainID == b.domainID && a.sinkID == b.sinkID && a.sourceID == b.sourceID);
@@ -235,6 +240,8 @@ void CAmCommonFunctions::createSink(am_Sink_s& sink) const
sink.listConnectionFormats = getStandardConnectionFormatList();
sink.listSoundProperties = getStandardSoundPropertyList();
sink.listMainSoundProperties = getStandardMainSoundPropertyList();
+ sink.listNotificationConfigurations = getStandardNotificationConfigurationList();
+ sink.listMainNotificationConfigurations = getStandardNotificationConfigurationList();
sink.mainVolume = 12;
sink.muteState = MS_UNMUTED;
sink.visible = true;
@@ -252,6 +259,8 @@ void CAmCommonFunctions::createSource(am_Source_s& source) const
source.listConnectionFormats = getStandardConnectionFormatList();
source.listSoundProperties = getStandardSoundPropertyList();
source.listMainSoundProperties = getStandardMainSoundPropertyList();
+ source.listMainNotificationConfigurations=getStandardNotificationConfigurationList();
+ source.listNotificationConfigurations=getStandardNotificationConfigurationList();
source.interruptState = IS_OFF;
source.visible = true;
source.volume = 23;
@@ -307,6 +316,23 @@ std::vector<bool> CAmCommonFunctions::getStandardConvertionMatrix()
return convMatrix;
}
+std::vector<am_NotificationConfiguration_s> am::CAmCommonFunctions::getStandardNotificationConfigurationList()
+{
+ std::vector<am_NotificationConfiguration_s> listNotificationConfigurations;
+ am_NotificationConfiguration_s tempNotificationConfiguration;
+ tempNotificationConfiguration.notificationParameter=12;
+ tempNotificationConfiguration.notificationStatus=NS_PERIODIC;
+ tempNotificationConfiguration.notificationType=NT_MAX;
+ listNotificationConfigurations.push_back(tempNotificationConfiguration);
+
+ tempNotificationConfiguration.notificationParameter=16;
+ tempNotificationConfiguration.notificationStatus=NS_CHANGE;
+ tempNotificationConfiguration.notificationType=NT_UNKNOWN;
+ listNotificationConfigurations.push_back(tempNotificationConfiguration);
+
+ return (listNotificationConfigurations);
+}
+
void CAmCommonFunctions::connectionList2RoutingList(std::vector<am_RoutingElement_s> & routingList, const std::vector<am_Connection_s>& connectionList)
{
am_RoutingElement_s routingElement;
diff --git a/AudioManagerDaemon/test/CAmCommonFunctions.h b/AudioManagerDaemon/test/CAmCommonFunctions.h
index 20d7de7..0c9e362 100644
--- a/AudioManagerDaemon/test/CAmCommonFunctions.h
+++ b/AudioManagerDaemon/test/CAmCommonFunctions.h
@@ -34,6 +34,7 @@ public:
static std::vector<am_SoundProperty_s> getStandardSoundPropertyList();
static std::vector<am_MainSoundProperty_s> getStandardMainSoundPropertyList();
static std::vector<bool> getStandardConvertionMatrix();
+ static std::vector<am_NotificationConfiguration_s> getStandardNotificationConfigurationList();
bool compareSource(std::vector<am_Source_s>::iterator listIterator, const am_Source_s& sourceData);
bool compareSink(std::vector<am_Sink_s>::iterator listIterator, const am_Sink_s& sinkData);
bool compareGateway(std::vector<am_Gateway_s>::iterator listIterator, const am_Gateway_s& gatewayData);
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a5e60d7..9e8a33b 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -82,8 +82,7 @@ OPTION ( WITH_NSM
IF (NOT WITH_DBUS_WRAPPER)
SET (WITH_NSM OFF)
ENDIF (NOT WITH_DBUS_WRAPPER)
-
-
+
#Can be changed via passing -DDBUS_SERVICE_PREFIX="XXX" to cmake
IF(NOT DEFINED DBUS_SERVICE_PREFIX)
SET( DBUS_SERVICE_PREFIX "org.genivi.audiomanager\0")
@@ -96,7 +95,7 @@ ENDIF(NOT DEFINED DBUS_SERVICE_OBJECT_PATH)
#Can be changed via passing -DDEFAULT_TELNETPORT="XXX" to cmake
IF(NOT DEFINED DEFAULT_TELNETPORT)
- SET( DEFAULT_TELNETPORT 6060 )
+ SET( DEFAULT_TELNETPORT 6080 )
ENDIF(NOT DEFINED DEFAULT_TELNETPORT)
#Can be changed via passing -DMAX_TELNETCONNECTIONS="XXX" to cmake
diff --git a/PluginCommandInterfaceDbus/CMakeLists.txt b/PluginCommandInterfaceDbus/CMakeLists.txt
index 06e3c30..a27e02f 100644
--- a/PluginCommandInterfaceDbus/CMakeLists.txt
+++ b/PluginCommandInterfaceDbus/CMakeLists.txt
@@ -18,6 +18,11 @@ cmake_minimum_required(VERSION 2.6)
PROJECT(PluginCommandInterfaceDbus)
+OPTION (WITH_COMMAND_INTERFACE_DBUS
+ "build with commandinterface dbus plugin" ON )
+
+IF (WITH_COMMAND_INTERFACE_DBUS)
+
set(LIBRARY_OUTPUT_PATH ${PLUGINS_OUTPUT_PATH}/command)
set(DOC_OUTPUT_PATH ${DOC_OUTPUT_PATH}/CommandDBusPlugin)
set(INCLUDE_FOLDER "include")
@@ -98,3 +103,5 @@ ENDIF(USE_BUILD_LIBS)
SET(ADD_DEPEND "audiomanager-bin" "dlt" "libdbus-1-3(>=1.2.16)")
set_property(GLOBAL APPEND PROPERTY sampleplugins_prop "${ADD_DEPEND}")
+
+ENDIF (WITH_COMMAND_INTERFACE_DBUS)
diff --git a/PluginControlInterface/CMakeLists.txt b/PluginControlInterface/CMakeLists.txt
index f90fe04..16b49be 100644
--- a/PluginControlInterface/CMakeLists.txt
+++ b/PluginControlInterface/CMakeLists.txt
@@ -18,6 +18,11 @@ cmake_minimum_required(VERSION 2.6)
PROJECT(PluginControlInterface)
+OPTION (WITH_TEST_CONTROLLER
+ "Build with the test controller" ON)
+
+IF (WITH_TEST_CONTROLLER)
+
set(LIBRARY_OUTPUT_PATH ${PLUGINS_OUTPUT_PATH}/control)
set(DOC_OUTPUT_PATH ${DOC_OUTPUT_PATH}/ControlPlugin)
set(INCLUDE_FOLDER "include")
@@ -72,3 +77,5 @@ INSTALL(TARGETS PluginControlInterface
SET(ADD_DEPEND "audiomanager-bin")
set_property(GLOBAL APPEND PROPERTY sampleplugins_prop "${ADD_DEPEND}")
+
+ENDIF (WITH_TEST_CONTROLLER)
diff --git a/PluginRoutingInterfaceAsync/CMakeLists.txt b/PluginRoutingInterfaceAsync/CMakeLists.txt
index e3e52f7..b4cd576 100644
--- a/PluginRoutingInterfaceAsync/CMakeLists.txt
+++ b/PluginRoutingInterfaceAsync/CMakeLists.txt
@@ -17,6 +17,11 @@ cmake_minimum_required(VERSION 2.6)
PROJECT(PluginRoutingInterfaceAsync)
+OPTION (WITH_ROUTING_INTERFACE_ASYNC
+ "build with routing interface async plugin" ON)
+
+IF (WITH_ROUTING_INTERFACE_ASYNC)
+
set(LIBRARY_OUTPUT_PATH ${PLUGINS_OUTPUT_PATH}/routing)
set(DOC_OUTPUT_PATH ${DOC_OUTPUT_PATH}/RoutingAsync)
set(INCLUDE_FOLDER "include")
@@ -78,4 +83,4 @@ INSTALL(TARGETS PluginRoutingInterfaceAsync
SET(ADD_DEPEND "audiomanager-bin" "dlt" "libdbus-1-3(>=1.2.16)" "libpthread-stubs0")
set_property(GLOBAL APPEND PROPERTY sampleplugins_prop "${ADD_DEPEND}")
-
+ENDIF (WITH_ROUTING_INTERFACE_ASYNC)
diff --git a/PluginRoutingInterfaceDbus/CMakeLists.txt b/PluginRoutingInterfaceDbus/CMakeLists.txt
index 2bab903..ec636c3 100644
--- a/PluginRoutingInterfaceDbus/CMakeLists.txt
+++ b/PluginRoutingInterfaceDbus/CMakeLists.txt
@@ -18,6 +18,11 @@ cmake_minimum_required(VERSION 2.6)
PROJECT(PluginRoutingInterfaceDbus)
+OPTION(WITH_ROUTING_INTERFACE_DBUS
+ "build with routing iterface dbus plugin" ON)
+
+IF(WITH_ROUTING_INTERFACE_DBUS)
+
set(LIBRARY_OUTPUT_PATH ${PLUGINS_OUTPUT_PATH}/routing)
set(DOC_OUTPUT_PATH ${DOC_OUTPUT_PATH}/RoutingPlugin)
set(INCLUDE_FOLDER "include")
@@ -104,3 +109,4 @@ INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/RoutingReceiver.xml
SET(ADD_DEPEND "audiomanager-bin" "dlt" "libdbus-1-3(>=1.2.16)")
set_property(GLOBAL APPEND PROPERTY sampleplugins_prop "${ADD_DEPEND}")
+ENDIF(WITH_ROUTING_INTERFACE_DBUS)