summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Herchet <frank.fh.herchet@bmw.de>2012-02-14 17:00:45 +0100
committerFrank Herchet <frank.fh.herchet@bmw.de>2012-02-14 17:00:45 +0100
commit6d59e9585db35d9a3c16f01b4180ea440e4b5a4a (patch)
treeac8931eab1c733becece1a6fa49216169fdcf90e
parent000b6cb9766473e76e3f7790c6579d44a09c81c0 (diff)
downloadaudiomanager-6d59e9585db35d9a3c16f01b4180ea440e4b5a4a.tar.gz
* merge of changes from Christian
-rw-r--r--.gitignore2
-rw-r--r--AudioManagerDaemon/include/ControlReceiver.h5
-rw-r--r--AudioManagerDaemon/include/DatabaseHandler.h5
-rw-r--r--AudioManagerDaemon/src/CAmTelnetMenuHelper.cpp1455
-rw-r--r--AudioManagerDaemon/src/CommandSender.cpp2
-rw-r--r--AudioManagerDaemon/src/ControlReceiver.cpp42
-rw-r--r--AudioManagerDaemon/src/DatabaseHandler.cpp320
-rw-r--r--AudioManagerDaemon/src/SocketHandler.cpp5
-rw-r--r--AudioManagerDaemon/src/TelnetServer.cpp6
-rw-r--r--AudioManagerDaemon/src/main.cpp2
-rw-r--r--AudioManagerDaemon/test/CommonFunctions.cpp8
-rw-r--r--AudioManagerDaemon/test/CommonFunctions.h1
-rw-r--r--AudioManagerDaemon/test/database/databaseTest.cpp329
-rw-r--r--CHANGELOG6
-rw-r--r--CMakeLists.txt2
-rw-r--r--PluginCommandInterfaceDbus/src/DBusCommandSender.cpp1
-rw-r--r--PluginControlInterface/include/ControlSender.h19
-rw-r--r--PluginControlInterface/src/ControlSender.cpp146
-rw-r--r--includes/audiomanagertypes.h112
-rw-r--r--includes/command/CommandReceiveInterface.h8
-rw-r--r--includes/command/CommandSendInterface.h8
-rw-r--r--includes/control/ControlReceiveInterface.h36
-rw-r--r--includes/control/ControlSendInterface.h8
-rw-r--r--includes/routing/RoutingReceiveInterface.h15
-rw-r--r--includes/routing/RoutingSendInterface.h8
25 files changed, 1530 insertions, 1021 deletions
diff --git a/.gitignore b/.gitignore
index b3857df..9e40053 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,4 +3,6 @@ build/
doc/
packages/
.*
+CHANGELOG
+includes/config.h
diff --git a/AudioManagerDaemon/include/ControlReceiver.h b/AudioManagerDaemon/include/ControlReceiver.h
index a40f800..45788f5 100644
--- a/AudioManagerDaemon/include/ControlReceiver.h
+++ b/AudioManagerDaemon/include/ControlReceiver.h
@@ -68,7 +68,7 @@ public:
am_Error_e enterSinkClassDB(const am_SinkClass_s & sinkClass, am_sinkClass_t & sinkClassID);
am_Error_e enterSourceClassDB(am_sourceClass_t & sourceClassID, const am_SourceClass_s & sourceClass);
am_Error_e enterSystemPropertiesListDB(const std::vector<am_SystemProperty_s>& listSystemProperties);
- am_Error_e changeMainConnectionRouteDB(const am_mainConnectionID_t mainconnectionID, const am_Route_s& route);
+ am_Error_e changeMainConnectionRouteDB(const am_mainConnectionID_t mainconnectionID, const std::vector<am_connectionID_t>& listConnectionID);
am_Error_e changeMainConnectionStateDB(const am_mainConnectionID_t mainconnectionID, const am_ConnectionState_e connectionState);
am_Error_e changeSinkMainVolumeDB(const am_mainVolume_t mainVolume, const am_sinkID_t sinkID);
am_Error_e changeSinkAvailabilityDB(const am_Availability_s& availability, const am_sinkID_t sinkID);
@@ -90,8 +90,11 @@ public:
am_Error_e removeSourceClassDB(const am_sourceClass_t sourceClassID);
am_Error_e getSourceClassInfoDB(const am_sourceID_t sourceID, am_SourceClass_s& classInfo) const;
am_Error_e getSinkClassInfoDB(const am_sinkID_t sinkID, am_SinkClass_s& sinkClass) const;
+ am_Error_e getSinkInfoDB(const am_sinkID_t sinkID, am_Sink_s& sinkData) const;
+ am_Error_e getSourceInfoDB(const am_sourceID_t sourceID, am_Source_s& sourceData) const;
am_Error_e getGatewayInfoDB(const am_gatewayID_t gatewayID, am_Gateway_s& gatewayData) const;
am_Error_e getCrossfaderInfoDB(const am_crossfaderID_t crossfaderID, am_Crossfader_s& crossfaderData) const;
+ am_Error_e getMainConnectionInfoDB(const am_mainConnectionID_t mainConnectionID, am_MainConnection_s& mainConnectionData) const;
am_Error_e getListSinksOfDomain(const am_domainID_t domainID, std::vector<am_sinkID_t>& listSinkID) const;
am_Error_e getListSourcesOfDomain(const am_domainID_t domainID, std::vector<am_sourceID_t>& listSourceID) const;
am_Error_e getListCrossfadersOfDomain(const am_domainID_t domainID, std::vector<am_crossfaderID_t>& listGatewaysID) const;
diff --git a/AudioManagerDaemon/include/DatabaseHandler.h b/AudioManagerDaemon/include/DatabaseHandler.h
index 1337c3d..550c13d 100644
--- a/AudioManagerDaemon/include/DatabaseHandler.h
+++ b/AudioManagerDaemon/include/DatabaseHandler.h
@@ -64,7 +64,7 @@ public:
am_Error_e enterSinkClassDB(const am_SinkClass_s& sinkClass, am_sinkClass_t& sinkClassID);
am_Error_e enterSourceClassDB(am_sourceClass_t& sourceClassID, const am_SourceClass_s& sourceClass);
am_Error_e enterSystemProperties(const std::vector<am_SystemProperty_s>& listSystemProperties);
- am_Error_e changeMainConnectionRouteDB(const am_mainConnectionID_t mainconnectionID, const am_Route_s& route);
+ am_Error_e changeMainConnectionRouteDB(const am_mainConnectionID_t mainconnectionID, const std::vector<am_connectionID_t>& listConnectionID);
am_Error_e changeMainConnectionStateDB(const am_mainConnectionID_t mainconnectionID, const am_ConnectionState_e connectionState);
am_Error_e changeSinkMainVolumeDB(const am_mainVolume_t mainVolume, const am_sinkID_t sinkID);
am_Error_e changeSinkAvailabilityDB(const am_Availability_s& availability, const am_sinkID_t sinkID);
@@ -97,7 +97,10 @@ public:
am_Error_e getSourceClassInfoDB(const am_sourceID_t sourceID, am_SourceClass_s& classInfo) const;
am_Error_e getSinkClassInfoDB(const am_sinkID_t sinkID, am_SinkClass_s& sinkClass) const;
am_Error_e getGatewayInfoDB(const am_gatewayID_t gatewayID, am_Gateway_s& gatewayData) const;
+ am_Error_e getSinkInfoDB(const am_sinkID_t sinkID, am_Sink_s& sinkData) const;
+ am_Error_e getSourceInfoDB(const am_sourceID_t sourceID, am_Source_s& sourceData) const;
am_Error_e getCrossfaderInfoDB(const am_crossfaderID_t crossfaderID, am_Crossfader_s& crossfaderData) const;
+ am_Error_e getMainConnectionInfoDB(const am_mainConnectionID_t mainConnectionID, am_MainConnection_s& mainConnectionData) const;
am_Error_e getSinkVolume(const am_sinkID_t sinkID, am_volume_t& volume) const;
am_Error_e getSourceVolume(const am_sourceID_t sourceID, am_volume_t& volume) const;
am_Error_e getSinkSoundPropertyValue(const am_sinkID_t sinkID, const am_SoundPropertyType_e propertyType, uint16_t& value) const;
diff --git a/AudioManagerDaemon/src/CAmTelnetMenuHelper.cpp b/AudioManagerDaemon/src/CAmTelnetMenuHelper.cpp
index f965a3b..eca274b 100644
--- a/AudioManagerDaemon/src/CAmTelnetMenuHelper.cpp
+++ b/AudioManagerDaemon/src/CAmTelnetMenuHelper.cpp
@@ -1,26 +1,26 @@
/**
-* Copyright (C) 2012, BMW AG
-*
-* GeniviAudioMananger AudioManagerDaemon
-*
-* \file CAmTelnetMenuHelper.cpp
-*
-* \date 24-Jan-2012
-* \author Frank Herchet (frank.fh.herchet@bmw.de)
-*
-* \section License
-* GNU Lesser General Public License, version 2.1, with special exception (GENIVI clause)
-* Copyright (C) 2012, BMW AG Frank Herchet frank.fh.herchet@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.
-*
-*/
+ * Copyright (C) 2012, BMW AG
+ *
+ * GeniviAudioMananger AudioManagerDaemon
+ *
+ * \file CAmTelnetMenuHelper.cpp
+ *
+ * \date 24-Jan-2012
+ * \author Frank Herchet (frank.fh.herchet@bmw.de)
+ *
+ * \section License
+ * GNU Lesser General Public License, version 2.1, with special exception (GENIVI clause)
+ * Copyright (C) 2012, BMW AG Frank Herchet frank.fh.herchet@bmw.de
+ *
+ * This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License, version 2.1, as published by the Free Software Foundation.
+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License, version 2.1, for more details.
+ * You should have received a copy of the GNU Lesser General Public License, version 2.1, along with this program; if not, see <http://www.gnu.org/licenses/lgpl-2.1.html>.
+ * Note that the copyright holders assume that the GNU Lesser General Public License, version 2.1, may also be applicable to programs even in cases in which the program is not a library in the technical sense.
+ * Linking AudioManager statically or dynamically with other modules is making a combined work based on AudioManager. You may license such other modules under the GNU Lesser General Public License, version 2.1. If you do not want to license your linked modules under the GNU Lesser General Public License, version 2.1, you may use the program under the following exception.
+ * As a special exception, the copyright holders of AudioManager give you permission to combine AudioManager with software programs or libraries that are released under any license unless such a combination is not permitted by the license of such a software program or library. You may copy and distribute such a system following the terms of the GNU Lesser General Public License, version 2.1, including this special exception, for AudioManager and the licenses of the other code concerned.
+ * Note that people who make modified versions of AudioManager are not obligated to grant this special exception for their modified versions; it is their choice whether to do so. The GNU Lesser General Public License, version 2.1, gives permission to release a modified version without this exception; this exception also makes it possible to release a modified version which carries forward this exception.
+ *
+ */
#include "CAmTelnetMenuHelper.h"
#include "TelnetServer.h"
@@ -42,30 +42,13 @@ using namespace am;
CAmTelnetMenuHelper* CAmTelnetMenuHelper::instance = NULL;
/****************************************************************************/
-CAmTelnetMenuHelper::CAmTelnetMenuHelper(SocketHandler *iSocketHandler,
- CommandSender *iCommandSender,
- CommandReceiver *iCommandReceiver,
- RoutingSender *iRoutingSender,
- RoutingReceiver *iRoutingReceiver,
- ControlSender *iControlSender,
- ControlReceiver *iControlReceiver,
- DatabaseHandler *iDatabasehandler,
- Router *iRouter,
- TelnetServer *iTelnetServer)
-/****************************************************************************/
-: mTelenetServer(iTelnetServer)
-, mSocketHandler(iSocketHandler)
-, mCommandSender(iCommandSender)
-, mCommandReceiver(iCommandReceiver)
-, mRoutingSender(iRoutingSender)
-, mRoutingReceiver(iRoutingReceiver)
-, mControlSender(iControlSender)
-, mControlReceiver(iControlReceiver)
-, mDatabasehandler(iDatabasehandler)
-, mRouter(iRouter)
+CAmTelnetMenuHelper::CAmTelnetMenuHelper(SocketHandler *iSocketHandler, CommandSender *iCommandSender, CommandReceiver *iCommandReceiver, RoutingSender *iRoutingSender, RoutingReceiver *iRoutingReceiver, ControlSender *iControlSender, ControlReceiver *iControlReceiver, DatabaseHandler *iDatabasehandler, Router *iRouter)
+/****************************************************************************/
+:
+ mTelenetServer(NULL), mSocketHandler(iSocketHandler), mCommandSender(iCommandSender), mCommandReceiver(iCommandReceiver), mRoutingSender(iRoutingSender), mRoutingReceiver(iRoutingReceiver), mControlSender(iControlSender), mControlReceiver(iControlReceiver), mDatabasehandler(iDatabasehandler), mRouter(iRouter)
{
- instance = this;
- createCommandMaps();
+ instance = this;
+ createCommandMaps();
}
/****************************************************************************/
@@ -78,705 +61,696 @@ CAmTelnetMenuHelper::~CAmTelnetMenuHelper()
void CAmTelnetMenuHelper::createCommandMaps()
/****************************************************************************/
{
- // ROOT commands
-
- mRootCommands.clear();
-
- mRootCommands.insert(std::make_pair("help",sCommandPrototypeInfo("show all possible commands",&CAmTelnetMenuHelper::helpCommand)));
- mRootCommands.insert(std::make_pair("list",sCommandPrototypeInfo("Go into 'list'-submenu",&CAmTelnetMenuHelper::rootListCommand)));
- mRootCommands.insert(std::make_pair("info",sCommandPrototypeInfo("Go into 'info'-submenu",&CAmTelnetMenuHelper::rootInfoCommand)));
- mRootCommands.insert(std::make_pair("set",sCommandPrototypeInfo("Go into 'set'-submenu",&CAmTelnetMenuHelper::rootSetCommand)));
- mRootCommands.insert(std::make_pair("get",sCommandPrototypeInfo("Go into 'get'-submenu",&CAmTelnetMenuHelper::rootGetCommand)));
- mRootCommands.insert(std::make_pair("exit",sCommandPrototypeInfo("quit telnet session",&CAmTelnetMenuHelper::exitCommand)));
-
- // List commands
- mListCommands.insert(std::make_pair("help",sCommandPrototypeInfo(std::string("show all possible commands"),&CAmTelnetMenuHelper::helpCommand)));
- mListCommands.insert(std::make_pair("conn",sCommandPrototypeInfo("list all connections",&CAmTelnetMenuHelper::listConnectionsCommand)));
- mListCommands.insert(std::make_pair("sources",sCommandPrototypeInfo("list all available sources",&CAmTelnetMenuHelper::listSourcesCommand)));
- mListCommands.insert(std::make_pair("sinks",sCommandPrototypeInfo("list all available sinks",&CAmTelnetMenuHelper::listSinksCommands)));
- mListCommands.insert(std::make_pair("crfaders",sCommandPrototypeInfo("list all crossfaders",&CAmTelnetMenuHelper::listCrossfaders)));
- mListCommands.insert(std::make_pair("domains",sCommandPrototypeInfo("list all domains",&CAmTelnetMenuHelper::listDomainsCommand)));
- mListCommands.insert(std::make_pair("gws",sCommandPrototypeInfo("list all gateways",&CAmTelnetMenuHelper::listGatewaysCommand)));
- mListCommands.insert(std::make_pair("..",sCommandPrototypeInfo("one step back in menu tree (back to root folder)",&CAmTelnetMenuHelper::oneStepBackCommand)));
- mListCommands.insert(std::make_pair("exit",sCommandPrototypeInfo("close telnet session",&CAmTelnetMenuHelper::exitCommand)));
-
- // Set commands
- mSetCommands.insert(std::make_pair("help",sCommandPrototypeInfo(std::string("show all possible commands"),&CAmTelnetMenuHelper::helpCommand)));
- mSetCommands.insert(std::make_pair("..",sCommandPrototypeInfo("one step back in menu tree (back to root folder)",&CAmTelnetMenuHelper::oneStepBackCommand)));
- mSetCommands.insert(std::make_pair("exit",sCommandPrototypeInfo("close telnet session",&CAmTelnetMenuHelper::exitCommand)));
- mSetCommands.insert(std::make_pair("conn",sCommandPrototypeInfo("use 'conn sourceId sinkId' to connect a source and a sink",&CAmTelnetMenuHelper::setConnection)));
- mSetCommands.insert(std::make_pair("routing",sCommandPrototypeInfo("use 'routing sourceId sinkId' to get all\n\t possible routes between a sourceID and a sinkID",&CAmTelnetMenuHelper::setRoutingCommand)));
- mSetCommands.insert(std::make_pair("disc",sCommandPrototypeInfo("use 'disc connectionID' to disconnect \n\t this connection",&CAmTelnetMenuHelper::setDisconnectConnId)));
-
- // Get commands
- mGetCommands.insert(std::make_pair("help",sCommandPrototypeInfo(std::string("show all possible commands"),&CAmTelnetMenuHelper::helpCommand)));
- mGetCommands.insert(std::make_pair("routing",sCommandPrototypeInfo("show current routing",&CAmTelnetMenuHelper::getRoutingCommand)));
- mGetCommands.insert(std::make_pair("sendv",sCommandPrototypeInfo("show senderversion",&CAmTelnetMenuHelper::getSenderversionCommand)));
- mGetCommands.insert(std::make_pair("recv",sCommandPrototypeInfo("show receiverversion ",&CAmTelnetMenuHelper::getReceiverversionCommand)));
- mGetCommands.insert(std::make_pair("..",sCommandPrototypeInfo("one step back in menu tree (back to root folder)",&CAmTelnetMenuHelper::oneStepBackCommand)));
- mGetCommands.insert(std::make_pair("exit",sCommandPrototypeInfo("close telnet session",&CAmTelnetMenuHelper::exitCommand)));
-
- // Info comands
- mInfoCommands.insert(std::make_pair("help",sCommandPrototypeInfo(std::string("show all possible commands"),&CAmTelnetMenuHelper::helpCommand)));
- mInfoCommands.insert(std::make_pair("sysprop",sCommandPrototypeInfo("show all systemproperties",&CAmTelnetMenuHelper::infoSystempropertiesCommand)));
- mInfoCommands.insert(std::make_pair("..",sCommandPrototypeInfo("one step back in menu tree (back to root folder)",&CAmTelnetMenuHelper::oneStepBackCommand)));
- mInfoCommands.insert(std::make_pair("exit",sCommandPrototypeInfo("close telnet session",&CAmTelnetMenuHelper::exitCommand)));
+ // ROOT commands
+
+ mRootCommands.clear();
+
+ mRootCommands.insert(std::make_pair("help", sCommandPrototypeInfo("show all possible commands", &CAmTelnetMenuHelper::helpCommand)));
+ mRootCommands.insert(std::make_pair("list", sCommandPrototypeInfo("Go into 'list'-submenu", &CAmTelnetMenuHelper::rootListCommand)));
+ mRootCommands.insert(std::make_pair("info", sCommandPrototypeInfo("Go into 'info'-submenu", &CAmTelnetMenuHelper::rootInfoCommand)));
+ mRootCommands.insert(std::make_pair("set", sCommandPrototypeInfo("Go into 'set'-submenu", &CAmTelnetMenuHelper::rootSetCommand)));
+ mRootCommands.insert(std::make_pair("get", sCommandPrototypeInfo("Go into 'get'-submenu", &CAmTelnetMenuHelper::rootGetCommand)));
+ mRootCommands.insert(std::make_pair("exit", sCommandPrototypeInfo("quit telnet session", &CAmTelnetMenuHelper::exitCommand)));
+
+ // List commands
+ mListCommands.insert(std::make_pair("help", sCommandPrototypeInfo(std::string("show all possible commands"), &CAmTelnetMenuHelper::helpCommand)));
+ mListCommands.insert(std::make_pair("conn", sCommandPrototypeInfo("list all connections", &CAmTelnetMenuHelper::listConnectionsCommand)));
+ mListCommands.insert(std::make_pair("sources", sCommandPrototypeInfo("list all available sources", &CAmTelnetMenuHelper::listSourcesCommand)));
+ mListCommands.insert(std::make_pair("sinks", sCommandPrototypeInfo("list all available sinks", &CAmTelnetMenuHelper::listSinksCommands)));
+ mListCommands.insert(std::make_pair("crfaders", sCommandPrototypeInfo("list all crossfaders", &CAmTelnetMenuHelper::listCrossfaders)));
+ mListCommands.insert(std::make_pair("domains", sCommandPrototypeInfo("list all domains", &CAmTelnetMenuHelper::listDomainsCommand)));
+ mListCommands.insert(std::make_pair("gws", sCommandPrototypeInfo("list all gateways", &CAmTelnetMenuHelper::listGatewaysCommand)));
+ mListCommands.insert(std::make_pair("..", sCommandPrototypeInfo("one step back in menu tree (back to root folder)", &CAmTelnetMenuHelper::oneStepBackCommand)));
+ mListCommands.insert(std::make_pair("exit", sCommandPrototypeInfo("close telnet session", &CAmTelnetMenuHelper::exitCommand)));
+
+ // Set commands
+ mSetCommands.insert(std::make_pair("help", sCommandPrototypeInfo(std::string("show all possible commands"), &CAmTelnetMenuHelper::helpCommand)));
+ mSetCommands.insert(std::make_pair("..", sCommandPrototypeInfo("one step back in menu tree (back to root folder)", &CAmTelnetMenuHelper::oneStepBackCommand)));
+ mSetCommands.insert(std::make_pair("exit", sCommandPrototypeInfo("close telnet session", &CAmTelnetMenuHelper::exitCommand)));
+ mSetCommands.insert(std::make_pair("conn", sCommandPrototypeInfo("use 'conn sourceId sinkId' to connect a source and a sink", &CAmTelnetMenuHelper::setConnection)));
+ mSetCommands.insert(std::make_pair("routing", sCommandPrototypeInfo("use 'routing sourceId sinkId' to get all\n\t possible routes between a sourceID and a sinkID", &CAmTelnetMenuHelper::setRoutingCommand)));
+ mSetCommands.insert(std::make_pair("disc", sCommandPrototypeInfo("use 'disc connectionID' to disconnect \n\t this connection", &CAmTelnetMenuHelper::setDisconnectConnId)));
+
+ // Get commands
+ mGetCommands.insert(std::make_pair("help", sCommandPrototypeInfo(std::string("show all possible commands"), &CAmTelnetMenuHelper::helpCommand)));
+ mGetCommands.insert(std::make_pair("routing", sCommandPrototypeInfo("show current routing", &CAmTelnetMenuHelper::getRoutingCommand)));
+ mGetCommands.insert(std::make_pair("sendv", sCommandPrototypeInfo("show senderversion", &CAmTelnetMenuHelper::getSenderversionCommand)));
+ mGetCommands.insert(std::make_pair("recv", sCommandPrototypeInfo("show receiverversion ", &CAmTelnetMenuHelper::getReceiverversionCommand)));
+ mGetCommands.insert(std::make_pair("..", sCommandPrototypeInfo("one step back in menu tree (back to root folder)", &CAmTelnetMenuHelper::oneStepBackCommand)));
+ mGetCommands.insert(std::make_pair("exit", sCommandPrototypeInfo("close telnet session", &CAmTelnetMenuHelper::exitCommand)));
+
+ // Info comands
+ mInfoCommands.insert(std::make_pair("help", sCommandPrototypeInfo(std::string("show all possible commands"), &CAmTelnetMenuHelper::helpCommand)));
+ mInfoCommands.insert(std::make_pair("sysprop", sCommandPrototypeInfo("show all systemproperties", &CAmTelnetMenuHelper::infoSystempropertiesCommand)));
+ mInfoCommands.insert(std::make_pair("..", sCommandPrototypeInfo("one step back in menu tree (back to root folder)", &CAmTelnetMenuHelper::oneStepBackCommand)));
+ mInfoCommands.insert(std::make_pair("exit", sCommandPrototypeInfo("close telnet session", &CAmTelnetMenuHelper::exitCommand)));
}
/****************************************************************************/
void CAmTelnetMenuHelper::setTelnetServer(TelnetServer* iTelnetServer)
/****************************************************************************/
{
- mTelenetServer = iTelnetServer;
+ mTelenetServer = iTelnetServer;
}
/****************************************************************************/
void CAmTelnetMenuHelper::newSocketConnection(int filedescriptor)
/****************************************************************************/
{
- EMainState state = eRootState;
- std::map<int,EMainState>::iterator it;
- std::stringstream welcome;
+ EMainState state = eRootState;
+ std::map<int, EMainState>::iterator it;
+ std::stringstream welcome;
- it = mCurrentMainStateMap.find(filedescriptor);
- if( it != mCurrentMainStateMap.end())
- {
- // socket connection already exists, delete entry and go back to root state
- mCurrentMainStateMap.erase(it);
- }
+ it = mCurrentMainStateMap.find(filedescriptor);
+ if (it != mCurrentMainStateMap.end())
+ {
+ // socket connection already exists, delete entry and go back to root state
+ mCurrentMainStateMap.erase(it);
+ }
- it = mCurrentMainStateMap.begin();
+ it = mCurrentMainStateMap.begin();
- // insert new socket connection
- mCurrentMainStateMap.insert(it,std::make_pair<int,EMainState>(filedescriptor,state));
+ // insert new socket connection
+ mCurrentMainStateMap.insert(it, std::make_pair<int, EMainState>(filedescriptor, state));
- // Send welcome message
- welcome << "Welcome to GENIVI AudioManager " << DAEMONVERSION << "\n>";
- send(filedescriptor,welcome.str().c_str(),welcome.str().size(),0);
+ // Send welcome message
+ welcome << "Welcome to GENIVI AudioManager " << DAEMONVERSION << "\n>";
+ send(filedescriptor, welcome.str().c_str(), welcome.str().size(), 0);
}
/****************************************************************************/
void CAmTelnetMenuHelper::socketConnectionsClosed(int filedescriptor)
/****************************************************************************/
{
- std::map<int,EMainState>::iterator it;
-
- it = mCurrentMainStateMap.find(filedescriptor);
- if( it != mCurrentMainStateMap.end())
- {
- mCurrentMainStateMap.erase(it);
- }
- else
- {
- // connection not found
- }
+ std::map<int, EMainState>::iterator it;
+
+ it = mCurrentMainStateMap.find(filedescriptor);
+ if (it != mCurrentMainStateMap.end())
+ {
+ mCurrentMainStateMap.erase(it);
+ }
+ else
+ {
+ // connection not found
+ }
}
/****************************************************************************/
void CAmTelnetMenuHelper::enterCmdQueue(std::queue<std::string> & CmdQueue, int & filedescriptor)
/****************************************************************************/
{
- std::map<int,EMainState>::iterator it;
- std::string cmd;
- tCommandMap::iterator cmditer;
-
- // find current filedescriptor to get the current state of the telnet session
- it = mCurrentMainStateMap.find(filedescriptor);
- while(!CmdQueue.empty())
- {
- cmd = CmdQueue.front();
-
- // Now remove the first command, it's stored in 'cmd'
- CmdQueue.pop();
- // telnet session found. depending on the current state, different commands are available
- switch(it->second)
- {
- case eRootState:
+ std::map<int, EMainState>::iterator it;
+ std::string cmd;
+ tCommandMap::iterator cmditer;
+
+ // find current filedescriptor to get the current state of the telnet session
+ it = mCurrentMainStateMap.find(filedescriptor);
+ while (!CmdQueue.empty())
+ {
+ cmd = CmdQueue.front();
+
+ // Now remove the first command, it's stored in 'cmd'
+ CmdQueue.pop();
+ // telnet session found. depending on the current state, different commands are available
+ switch (it->second)
+ {
+ case eRootState:
cmditer = mRootCommands.find(cmd);
- if(mRootCommands.end() != cmditer)
- cmditer->second.CommandPrototype(CmdQueue,filedescriptor);
+ if (mRootCommands.end() != cmditer)
+ cmditer->second.CommandPrototype(CmdQueue, filedescriptor);
else
- sendError(filedescriptor,"Command not found\n");
+ sendError(filedescriptor, "Command not found\n");
break;
- case eListState:
+ case eListState:
cmditer = mListCommands.find(cmd);
- if(mListCommands.end() != cmditer)
- cmditer->second.CommandPrototype(CmdQueue,filedescriptor);
+ if (mListCommands.end() != cmditer)
+ cmditer->second.CommandPrototype(CmdQueue, filedescriptor);
else
- sendError(filedescriptor,"Command not found\n");
+ sendError(filedescriptor, "Command not found\n");
break;
- case eInfoState:
+ case eInfoState:
cmditer = mInfoCommands.find(cmd);
- if(mInfoCommands.end() != cmditer)
- cmditer->second.CommandPrototype(CmdQueue,filedescriptor);
+ if (mInfoCommands.end() != cmditer)
+ cmditer->second.CommandPrototype(CmdQueue, filedescriptor);
else
- sendError(filedescriptor,"Command not found\n");
+ sendError(filedescriptor, "Command not found\n");
break;
- case eGetState:
+ case eGetState:
cmditer = mGetCommands.find(cmd);
- if(mGetCommands.end() != cmditer)
- cmditer->second.CommandPrototype(CmdQueue,filedescriptor);
+ if (mGetCommands.end() != cmditer)
+ cmditer->second.CommandPrototype(CmdQueue, filedescriptor);
else
- sendError(filedescriptor,"Command not found\n");
+ sendError(filedescriptor, "Command not found\n");
break;
- case eSetState:
+ case eSetState:
cmditer = mSetCommands.find(cmd);
- if(mSetCommands.end() != cmditer)
- cmditer->second.CommandPrototype(CmdQueue,filedescriptor);
+ if (mSetCommands.end() != cmditer)
+ cmditer->second.CommandPrototype(CmdQueue, filedescriptor);
else
- sendError(filedescriptor,"Command not found\n");
+ sendError(filedescriptor, "Command not found\n");
break;
- default:
+ default:
break;
- }
- }
+ }
+ }
- sendCurrentCmdPrompt(filedescriptor);
+ sendCurrentCmdPrompt(filedescriptor);
}
/****************************************************************************/
void CAmTelnetMenuHelper::sendError(int & filedescriptor, std::string error_string)
/****************************************************************************/
{
- send(filedescriptor,error_string.c_str(),error_string.size(),0);
+ send(filedescriptor, error_string.c_str(), error_string.size(), 0);
}
/****************************************************************************/
void CAmTelnetMenuHelper::sendTelnetLine(int & filedescriptor, std::stringstream &line)
/****************************************************************************/
{
- send(filedescriptor,line.str().c_str(),line.str().size(),0);
+ send(filedescriptor, line.str().c_str(), line.str().size(), 0);
}
/****************************************************************************/
void CAmTelnetMenuHelper::sendCurrentCmdPrompt(int & filedescriptor)
/****************************************************************************/
{
- std::map<int,EMainState>::iterator it;
- std::stringstream outputstream;
- outputstream << std::endl;
-
- it = mCurrentMainStateMap.find(filedescriptor);
- if( it != mCurrentMainStateMap.end())
- {
- switch(it->second)
- {
- case eRootState:
- outputstream << "\\>";
+ std::map<int, EMainState>::iterator it;
+ std::stringstream outputstream;
+ outputstream << std::endl;
+
+ it = mCurrentMainStateMap.find(filedescriptor);
+ if (it != mCurrentMainStateMap.end())
+ {
+ switch (it->second)
+ {
+ case eRootState:
+ outputstream << "\\>";
break;
- case eListState:
- outputstream << "\\List>";
+ case eListState:
+ outputstream << "\\List>";
break;
- case eGetState:
- outputstream << "\\Get>";
+ case eGetState:
+ outputstream << "\\Get>";
break;
- case eSetState:
- outputstream << "\\Set>";
+ case eSetState:
+ outputstream << "\\Set>";
break;
- case eInfoState:
- outputstream << "\\Info>";
+ case eInfoState:
+ outputstream << "\\Info>";
break;
- default:
+ default:
break;
- }
+ }
- send(filedescriptor,outputstream.str().c_str(),outputstream.str().size(),0);
+ send(filedescriptor, outputstream.str().c_str(), outputstream.str().size(), 0);
- }
- else
- {
- // connection not found
- }
+ }
+ else
+ {
+ // connection not found
+ }
}
/****************************************************************************/
void CAmTelnetMenuHelper::exitCommand(std::queue<std::string> & CmdQueue, int & filedescriptor)
/****************************************************************************/
{
- instance->exitCommandExec(CmdQueue,filedescriptor);
+ instance->exitCommandExec(CmdQueue, filedescriptor);
}
/****************************************************************************/
void CAmTelnetMenuHelper::oneStepBackCommandExec(std::queue<std::string> & CmdQueue, int & filedescriptor)
/****************************************************************************/
{
- std::map<int,EMainState>::iterator it;
- it = mCurrentMainStateMap.find(filedescriptor);
- if( it != mCurrentMainStateMap.end())
- {
- if(DEBUG_ON)std::cout << "old state: " << it->second;
- switch(it->second)
- {
- case eRootState:
+ (void) CmdQueue;
+ std::map<int, EMainState>::iterator it;
+ it = mCurrentMainStateMap.find(filedescriptor);
+ if (it != mCurrentMainStateMap.end())
+ {
+ if (DEBUG_ON)
+ std::cout << "old state: " << it->second;
+ switch (it->second)
+ {
+ case eRootState:
it->second = eRootState;
break;
- case eListState:
- it->second = eRootState;;
+ case eListState:
+ it->second = eRootState;
+ ;
break;
- case eGetState:
- it->second = eRootState;;
+ case eGetState:
+ it->second = eRootState;
+ ;
break;
- case eSetState:
- it->second = eRootState;;
+ case eSetState:
+ it->second = eRootState;
+ ;
break;
- case eInfoState:
- it->second = eRootState;;
+ case eInfoState:
+ it->second = eRootState;
+ ;
break;
- default:
+ default:
it->second = eRootState;
break;
- }
- if(DEBUG_ON)std::cout << "new state: " << it->second << std::endl;
- }
+ }
+ if (DEBUG_ON)
+ std::cout << "new state: " << it->second << std::endl;
+ }
}
/****************************************************************************/
void CAmTelnetMenuHelper::oneStepBackCommand(std::queue<std::string> & CmdQueue, int & filedescriptor)
/****************************************************************************/
{
- instance->oneStepBackCommandExec(CmdQueue,filedescriptor);
+ instance->oneStepBackCommandExec(CmdQueue, filedescriptor);
}
/****************************************************************************/
void CAmTelnetMenuHelper::exitCommandExec(std::queue<std::string> & CmdQueue, int & filedescriptor)
/****************************************************************************/
{
- std::map<int,EMainState>::iterator it;
- std::stringstream line;
- std::stringstream output;
-
- // Sending a last message to the client
- output << "Your wish is my command ... bye!" << std::endl;
- sendTelnetLine(filedescriptor,output);
-
-
- tCommandMap::iterator iter;
- it = mCurrentMainStateMap.find(filedescriptor);
- if( it != mCurrentMainStateMap.end())
- {
- if(DEBUG_ON)std::cout << "removing client connection " << filedescriptor << std::endl;
-
- if(NULL != mTelenetServer)
- {
- mTelenetServer->disconnectClient(filedescriptor);
- mCurrentMainStateMap.erase(it);
- }
- else
- {
- // ASSERT mTelenetServer == NULL
- if(DEBUG_ON)std::cout << "mTelenetServer";
- }
- }
+ (void) CmdQueue;
+ std::map<int, EMainState>::iterator it;
+ std::stringstream line;
+ std::stringstream output;
+
+ // Sending a last message to the client
+ output << "Your wish is my command ... bye!" << std::endl;
+ sendTelnetLine(filedescriptor, output);
+
+ tCommandMap::iterator iter;
+ it = mCurrentMainStateMap.find(filedescriptor);
+ if (it != mCurrentMainStateMap.end())
+ {
+ if (DEBUG_ON)
+ std::cout << "removing client connection " << filedescriptor << std::endl;
+
+ if (NULL != mTelenetServer)
+ {
+ mTelenetServer->disconnectClient(filedescriptor);
+ mCurrentMainStateMap.erase(it);
+ }
+ else
+ {
+ // ASSERT mTelenetServer == NULL
+ if (DEBUG_ON)
+ std::cout << "mTelenetServer";
+ }
+ }
}
/****************************************************************************/
void CAmTelnetMenuHelper::helpCommand(std::queue<std::string> & CmdQueue, int & filedescriptor)
/****************************************************************************/
{
- instance->helpCommandExec(CmdQueue,filedescriptor);
+ instance->helpCommandExec(CmdQueue, filedescriptor);
}
/****************************************************************************/
void CAmTelnetMenuHelper::helpCommandExec(std::queue<std::string> & CmdQueue, int & filedescriptor)
/****************************************************************************/
{
- std::map<int,EMainState>::iterator it;
- std::stringstream line;
- tCommandMap::iterator cmdIter;
- it = mCurrentMainStateMap.find(filedescriptor);
- if( it != mCurrentMainStateMap.end())
- {
- line << "###################################################" << std::endl;
- line << "###### The following commands are supported: ######"<< std::endl;
- line << "###################################################" << std::endl << std::endl;
- switch(it->second)
- {
- case eRootState:
+ (void) CmdQueue;
+ std::map<int, EMainState>::iterator it;
+ std::stringstream line;
+ tCommandMap::iterator cmdIter;
+ it = mCurrentMainStateMap.find(filedescriptor);
+ if (it != mCurrentMainStateMap.end())
+ {
+ line << "###################################################" << std::endl;
+ line << "###### The following commands are supported: ######" << std::endl;
+ line << "###################################################" << std::endl << std::endl;
+ switch (it->second)
+ {
+ case eRootState:
cmdIter = mRootCommands.begin();
- while(cmdIter != mRootCommands.end())
+ while (cmdIter != mRootCommands.end())
{
- line << cmdIter->first << "\t- " << cmdIter->second.info << std::endl;
- cmdIter++;
+ line << cmdIter->first << "\t- " << cmdIter->second.info << std::endl;
+ cmdIter++;
}
break;
- case eListState:
+ case eListState:
cmdIter = mListCommands.begin();
- while(cmdIter != mListCommands.end())
+ while (cmdIter != mListCommands.end())
{
- line << cmdIter->first << "\t- " << cmdIter->second.info << std::endl;
- cmdIter++;
+ line << cmdIter->first << "\t- " << cmdIter->second.info << std::endl;
+ cmdIter++;
}
break;
- case eGetState:
+ case eGetState:
cmdIter = mGetCommands.begin();
- while(cmdIter != mGetCommands.end())
+ while (cmdIter != mGetCommands.end())
{
- line << cmdIter->first << "\t- " << cmdIter->second.info << std::endl;
- cmdIter++;
+ line << cmdIter->first << "\t- " << cmdIter->second.info << std::endl;
+ cmdIter++;
}
break;
- case eSetState:
+ case eSetState:
cmdIter = mSetCommands.begin();
- while(cmdIter != mSetCommands.end())
+ while (cmdIter != mSetCommands.end())
{
- line << cmdIter->first << "\t- " << cmdIter->second.info << std::endl;
- cmdIter++;
+ line << cmdIter->first << "\t- " << cmdIter->second.info << std::endl;
+ cmdIter++;
}
break;
- case eInfoState:
+ case eInfoState:
cmdIter = mInfoCommands.begin();
- while(cmdIter != mInfoCommands.end())
+ while (cmdIter != mInfoCommands.end())
{
- line << cmdIter->first << "\t- " << cmdIter->second.info << std::endl;
- cmdIter++;
+ line << cmdIter->first << "\t- " << cmdIter->second.info << std::endl;
+ cmdIter++;
}
break;
- default:
+ default:
break;
- }
- sendTelnetLine(filedescriptor,line);
- }
+ }
+ sendTelnetLine(filedescriptor, line);
+ }
}
/****************************************************************************/
void CAmTelnetMenuHelper::rootGetCommand(std::queue<std::string> & CmdQueue, int & filedescriptor)
/****************************************************************************/
{
- instance->rootGetCommandExec(CmdQueue,filedescriptor);
+ instance->rootGetCommandExec(CmdQueue, filedescriptor);
}
/****************************************************************************/
void CAmTelnetMenuHelper::rootGetCommandExec(std::queue<std::string> & CmdQueue, int & filedescriptor)
/****************************************************************************/
{
- std::map<int,EMainState>::iterator it;
- it = mCurrentMainStateMap.find(filedescriptor);
- if( it != mCurrentMainStateMap.end())
- {
- it->second = eGetState;
- }
+ (void) CmdQueue;
+ std::map<int, EMainState>::iterator it;
+ it = mCurrentMainStateMap.find(filedescriptor);
+ if (it != mCurrentMainStateMap.end())
+ {
+ it->second = eGetState;
+ }
}
/****************************************************************************/
void CAmTelnetMenuHelper::rootSetCommand(std::queue<std::string> & CmdQueue, int & filedescriptor)
/****************************************************************************/
{
- instance->rootSetCommandExec(CmdQueue,filedescriptor);
+ instance->rootSetCommandExec(CmdQueue, filedescriptor);
}
/****************************************************************************/
void CAmTelnetMenuHelper::rootSetCommandExec(std::queue<std::string> & CmdQueue, int & filedescriptor)
/****************************************************************************/
{
- std::map<int,EMainState>::iterator it;
- it = mCurrentMainStateMap.find(filedescriptor);
- if( it != mCurrentMainStateMap.end())
- {
- it->second = eSetState;
- }
+ (void) CmdQueue;
+ std::map<int, EMainState>::iterator it;
+ it = mCurrentMainStateMap.find(filedescriptor);
+ if (it != mCurrentMainStateMap.end())
+ {
+ it->second = eSetState;
+ }
}
/****************************************************************************/
void CAmTelnetMenuHelper::rootListCommand(std::queue<std::string> & CmdQueue, int & filedescriptor)
/****************************************************************************/
{
- instance->rootListCommandExec(CmdQueue,filedescriptor);
+ instance->rootListCommandExec(CmdQueue, filedescriptor);
}
/****************************************************************************/
void CAmTelnetMenuHelper::rootListCommandExec(std::queue<std::string> & CmdQueue, int & filedescriptor)
/****************************************************************************/
{
- std::map<int,EMainState>::iterator it;
- it = mCurrentMainStateMap.find(filedescriptor);
- if( it != mCurrentMainStateMap.end())
- {
- it->second = eListState;
- }
+ (void) CmdQueue;
+ std::map<int, EMainState>::iterator it;
+ it = mCurrentMainStateMap.find(filedescriptor);
+ if (it != mCurrentMainStateMap.end())
+ {
+ it->second = eListState;
+ }
}
/****************************************************************************/
void CAmTelnetMenuHelper::rootInfoCommand(std::queue<std::string> & CmdQueue, int & filedescriptor)
/****************************************************************************/
{
- instance->rootInfoCommandExec(CmdQueue,filedescriptor);
+ instance->rootInfoCommandExec(CmdQueue, filedescriptor);
}
/****************************************************************************/
void CAmTelnetMenuHelper::rootInfoCommandExec(std::queue<std::string> & CmdQueue, int & filedescriptor)
/****************************************************************************/
{
- std::map<int,EMainState>::iterator it;
- it = mCurrentMainStateMap.find(filedescriptor);
- if( it != mCurrentMainStateMap.end())
- {
- it->second = eInfoState;
- }
+ (void) CmdQueue;
+ std::map<int, EMainState>::iterator it;
+ it = mCurrentMainStateMap.find(filedescriptor);
+ if (it != mCurrentMainStateMap.end())
+ {
+ it->second = eInfoState;
+ }
}
/****************************************************************************/
void CAmTelnetMenuHelper::listConnectionsCommand(std::queue<std::string> & CmdQueue, int & filedescriptor)
/****************************************************************************/
{
- instance->listConnectionsCommandExec(CmdQueue,filedescriptor);
+ instance->listConnectionsCommandExec(CmdQueue, filedescriptor);
}
/****************************************************************************/
void CAmTelnetMenuHelper::listConnectionsCommandExec(std::queue<std::string> & CmdQueue, int & filedescriptor)
/****************************************************************************/
{
- std::vector<am_Connection_s> listConnections;
- std::stringstream line;
+ (void) CmdQueue;
+ std::vector<am_Connection_s> listConnections;
+ std::stringstream line;
- mDatabasehandler->getListConnections(listConnections);
+ mDatabasehandler->getListConnections(listConnections);
- line << "\tCurrent connections: " << listConnections.size() << std::endl;
+ line << "\tCurrent connections: " << listConnections.size() << std::endl;
- sendTelnetLine(filedescriptor,line);
+ sendTelnetLine(filedescriptor, line);
- std::vector<am_Connection_s>::iterator it(listConnections.begin());
- while(it != listConnections.end())
- {
- line.str("");
- line << "\tID: " << it->connectionID
- << "\tSrcID: " << it->sourceID
- << "\tSinkID: " << it->sinkID
- << "\tFormat: " << it->connectionFormat
- << "\tdelay: " << it->delay
- << std::endl;
+ std::vector<am_Connection_s>::iterator it(listConnections.begin());
+ while (it != listConnections.end())
+ {
+ line.str("");
+ line << "\tID: " << it->connectionID << "\tSrcID: " << it->sourceID << "\tSinkID: " << it->sinkID << "\tFormat: " << it->connectionFormat << "\tdelay: " << it->delay << std::endl;
- sendTelnetLine(filedescriptor,line);
- it++;
- }
+ sendTelnetLine(filedescriptor, line);
+ it++;
+ }
}
/****************************************************************************/
void CAmTelnetMenuHelper::listSourcesCommand(std::queue<std::string> & CmdQueue, int & filedescriptor)
/****************************************************************************/
{
- instance->listSourcesCommandExec(CmdQueue,filedescriptor);
+ instance->listSourcesCommandExec(CmdQueue, filedescriptor);
}
/****************************************************************************/
void CAmTelnetMenuHelper::listSourcesCommandExec(std::queue<std::string> & CmdQueue, int & filedescriptor)
/****************************************************************************/
{
- std::vector<am_Source_s> listSources;
- std::stringstream line;
-
- mDatabasehandler->getListSources(listSources);
-
- line << "\tCurrent sources: " << listSources.size();
- sendTelnetLine(filedescriptor,line);
-
- std::vector<am_Source_s>::iterator it(listSources.begin());
- while(it != listSources.end())
- {
- line.str("");
- line << "\tID: " << it->sourceID
- << "\tDomainID: " << it->domainID
- << "\tName: " << it->name
- << "\tState: " << it->sourceState
- << "\tVolume: " << it->volume
- << std::endl;
-
- sendTelnetLine(filedescriptor,line);
- it++;
- }
+ (void) CmdQueue;
+ std::vector<am_Source_s> listSources;
+ std::stringstream line;
+
+ mDatabasehandler->getListSources(listSources);
+
+ line << "\tCurrent sources: " << listSources.size();
+ sendTelnetLine(filedescriptor, line);
+
+ std::vector<am_Source_s>::iterator it(listSources.begin());
+ while (it != listSources.end())
+ {
+ line.str("");
+ line << "\tID: " << it->sourceID << "\tDomainID: " << it->domainID << "\tName: " << it->name << "\tState: " << it->sourceState << "\tVolume: " << it->volume << std::endl;
+
+ sendTelnetLine(filedescriptor, line);
+ it++;
+ }
}
/****************************************************************************/
void CAmTelnetMenuHelper::listSinksCommands(std::queue<std::string> & CmdQueue, int & filedescriptor)
/****************************************************************************/
{
- instance->listSinksCommandsExec(CmdQueue,filedescriptor);
+ instance->listSinksCommandsExec(CmdQueue, filedescriptor);
}
/****************************************************************************/
void CAmTelnetMenuHelper::listSinksCommandsExec(std::queue<std::string> & CmdQueue, int & filedescriptor)
/****************************************************************************/
{
- std::vector<am_Sink_s> listSinks;
- std::stringstream line;
-
- mDatabasehandler->getListSinks(listSinks);
-
- line << "\tCurrent sinks: " << listSinks.size() << std::endl;
- sendTelnetLine(filedescriptor,line);
-
- std::vector<am_Sink_s>::iterator it(listSinks.begin());
- while(it != listSinks.end())
- {
- line.str("");
- line << "\tID: " << it->sinkID
- << "\tDomainID: " << it->domainID
- << "\tName: " << it->name
- << "\tAvailable: " << it->available.availability
- << "\tVolume: " << it->volume
- << std::endl;
-
- sendTelnetLine(filedescriptor,line);
- it++;
- }
+ (void) CmdQueue;
+ std::vector<am_Sink_s> listSinks;
+ std::stringstream line;
+
+ mDatabasehandler->getListSinks(listSinks);
+
+ line << "\tCurrent sinks: " << listSinks.size() << std::endl;
+ sendTelnetLine(filedescriptor, line);
+
+ std::vector<am_Sink_s>::iterator it(listSinks.begin());
+ while (it != listSinks.end())
+ {
+ line.str("");
+ line << "\tID: " << it->sinkID << "\tDomainID: " << it->domainID << "\tName: " << it->name << "\tAvailable: " << it->available.availability << "\tVolume: " << it->volume << std::endl;
+
+ sendTelnetLine(filedescriptor, line);
+ it++;
+ }
}
/****************************************************************************/
void CAmTelnetMenuHelper::listCrossfaders(std::queue<std::string> & CmdQueue, int & filedescriptor)
/****************************************************************************/
{
- instance->listCrossfadersExec(CmdQueue,filedescriptor);
+ instance->listCrossfadersExec(CmdQueue, filedescriptor);
}
/****************************************************************************/
void CAmTelnetMenuHelper::listCrossfadersExec(std::queue<std::string> & CmdQueue, int & filedescriptor)
/****************************************************************************/
{
- std::vector<am_Crossfader_s> listCrossfaders;
- std::stringstream line;
-
- mDatabasehandler->getListCrossfaders(listCrossfaders);
-
- line << "\tCurrent crossfaders: " << listCrossfaders.size();
- sendTelnetLine(filedescriptor,line);
-
- std::vector<am_Crossfader_s>::iterator it(listCrossfaders.begin());
- while(it != listCrossfaders.end())
- {
- line.str("");
- line << "\tID: " << it->crossfaderID
- << "\tName: " << it->name
- << "\tSourceID: " << it->sourceID
- << std::endl;
-
- sendTelnetLine(filedescriptor,line);
- it++;
- }
+ (void) CmdQueue;
+ std::vector<am_Crossfader_s> listCrossfaders;
+ std::stringstream line;
+
+ mDatabasehandler->getListCrossfaders(listCrossfaders);
+
+ line << "\tCurrent crossfaders: " << listCrossfaders.size();
+ sendTelnetLine(filedescriptor, line);
+
+ std::vector<am_Crossfader_s>::iterator it(listCrossfaders.begin());
+ while (it != listCrossfaders.end())
+ {
+ line.str("");
+ line << "\tID: " << it->crossfaderID << "\tName: " << it->name << "\tSourceID: " << it->sourceID << std::endl;
+
+ sendTelnetLine(filedescriptor, line);
+ it++;
+ }
}
/****************************************************************************/
void CAmTelnetMenuHelper::listDomainsCommand(std::queue<std::string> & CmdQueue, int & filedescriptor)
/****************************************************************************/
{
- instance->listDomainsCommandExec(CmdQueue,filedescriptor);
+ instance->listDomainsCommandExec(CmdQueue, filedescriptor);
}
/****************************************************************************/
void CAmTelnetMenuHelper::listDomainsCommandExec(std::queue<std::string> & CmdQueue, int & filedescriptor)
/****************************************************************************/
{
- std::vector<am_Domain_s> listDomains;
- std::stringstream line;
-
- mDatabasehandler->getListDomains(listDomains);
-
- line << "\tCurrent domains: " << listDomains.size()<<std::endl;
- sendTelnetLine(filedescriptor,line);
-
- std::vector<am_Domain_s>::iterator it(listDomains.begin());
- while(it != listDomains.end())
- {
- line.str("");
- line << "\tID: " << it->domainID
- << "\tName: " << it->name
- << "\tBusname: " << it->busname
- << "\tNodename: " << it->nodename
- << "\tState: " << static_cast<int>(it->state)
- << std::endl;
-
- sendTelnetLine(filedescriptor,line);
- it++;
- }
+ (void) CmdQueue;
+ std::vector<am_Domain_s> listDomains;
+ std::stringstream line;
+
+ mDatabasehandler->getListDomains(listDomains);
+
+ line << "\tCurrent domains: " << listDomains.size() << std::endl;
+ sendTelnetLine(filedescriptor, line);
+
+ std::vector<am_Domain_s>::iterator it(listDomains.begin());
+ while (it != listDomains.end())
+ {
+ line.str("");
+ line << "\tID: " << it->domainID << "\tName: " << it->name << "\tBusname: " << it->busname << "\tNodename: " << it->nodename << "\tState: " << static_cast<int>(it->state) << std::endl;
+
+ sendTelnetLine(filedescriptor, line);
+ it++;
+ }
}
/****************************************************************************/
void CAmTelnetMenuHelper::listGatewaysCommand(std::queue<std::string> & CmdQueue, int & filedescriptor)
/****************************************************************************/
{
- instance->listGatewaysCommandExec(CmdQueue,filedescriptor);
+ instance->listGatewaysCommandExec(CmdQueue, filedescriptor);
}
/****************************************************************************/
void CAmTelnetMenuHelper::listGatewaysCommandExec(std::queue<std::string> & CmdQueue, int & filedescriptor)
/****************************************************************************/
{
- std::vector<am_Gateway_s> listGateways;
- std::stringstream line;
-
- mDatabasehandler->getListGateways(listGateways);
-
- line << "\tCurrent gateways: " << listGateways.size();
- sendTelnetLine(filedescriptor,line);
-
- std::vector<am_Gateway_s>::iterator it(listGateways.begin());
- while(it != listGateways.end())
- {
- line.str("");
- line << "\tID: " << it->gatewayID
- << "\tName: " << it->name
- << "\tSourceID: " << it->sourceID
- << "\tSinkID: " << it->sinkID
- << std::endl;
-
- sendTelnetLine(filedescriptor,line);
- it++;
- }
+ (void) CmdQueue;
+ std::vector<am_Gateway_s> listGateways;
+ std::stringstream line;
+
+ mDatabasehandler->getListGateways(listGateways);
+
+ line << "\tCurrent gateways: " << listGateways.size();
+ sendTelnetLine(filedescriptor, line);
+
+ std::vector<am_Gateway_s>::iterator it(listGateways.begin());
+ while (it != listGateways.end())
+ {
+ line.str("");
+ line << "\tID: " << it->gatewayID << "\tName: " << it->name << "\tSourceID: " << it->sourceID << "\tSinkID: " << it->sinkID << std::endl;
+
+ sendTelnetLine(filedescriptor, line);
+ it++;
+ }
}
/****************************************************************************/
void CAmTelnetMenuHelper::getRoutingCommand(std::queue<std::string> & CmdQueue, int & filedescriptor)
/****************************************************************************/
{
- instance->getRoutingCommandExec(CmdQueue,filedescriptor);
+ instance->getRoutingCommandExec(CmdQueue, filedescriptor);
}
/****************************************************************************/
void CAmTelnetMenuHelper::getRoutingCommandExec(std::queue<std::string> & CmdQueue, int & filedescriptor)
/****************************************************************************/
{
- //TODO: fill with function
+ (void) CmdQueue;
+ (void) filedescriptor;
+ //TODO: fill with function
}
/****************************************************************************/
void CAmTelnetMenuHelper::getSenderversionCommand(std::queue<std::string> & CmdQueue, int & filedescriptor)
/****************************************************************************/
{
- instance->getSenderversionCommandExec(CmdQueue,filedescriptor);
+ instance->getSenderversionCommandExec(CmdQueue, filedescriptor);
}
/****************************************************************************/
void CAmTelnetMenuHelper::getSenderversionCommandExec(std::queue<std::string> & CmdQueue, int & filedescriptor)
/****************************************************************************/
{
- std::stringstream line;
+ (void) CmdQueue;
+ std::stringstream line;
- line << "\tSender versions:" << std::endl
- << "\tCtrl: " << mControlSender->getInterfaceVersion() << " | "
- << "Cmd: " << mCommandSender->getInterfaceVersion() << " | "
- << "Routing: " << mRoutingSender->getInterfaceVersion() << std::endl;
+ line << "\tSender versions:" << std::endl << "\tCtrl: " << mControlSender->getInterfaceVersion() << " | " << "Cmd: " << mCommandSender->getInterfaceVersion() << " | " << "Routing: " << mRoutingSender->getInterfaceVersion() << std::endl;
- sendTelnetLine(filedescriptor,line);
+ sendTelnetLine(filedescriptor, line);
}
/****************************************************************************/
void CAmTelnetMenuHelper::getReceiverversionCommand(std::queue<std::string> & CmdQueue, int & filedescriptor)
/****************************************************************************/
{
- instance->getReceiverversionCommandExec(CmdQueue,filedescriptor);
+ instance->getReceiverversionCommandExec(CmdQueue, filedescriptor);
}
/****************************************************************************/
void CAmTelnetMenuHelper::getReceiverversionCommandExec(std::queue<std::string> & CmdQueue, int & filedescriptor)
/****************************************************************************/
{
- std::stringstream line;
+ (void) CmdQueue;
+ std::stringstream line;
- line << "\tReceiver versions:" << std::endl
- << "\tCtrl: " << mControlReceiver->getInterfaceVersion() << " | "
- << "Cmd: " << mCommandReceiver->getInterfaceVersion() << " | "
- << "Routing: " << mRoutingReceiver->getInterfaceVersion() << std::endl;
+ line << "\tReceiver versions:" << std::endl << "\tCtrl: " << mControlReceiver->getInterfaceVersion() << " | " << "Cmd: " << mCommandReceiver->getInterfaceVersion() << " | " << "Routing: " << mRoutingReceiver->getInterfaceVersion() << std::endl;
- sendTelnetLine(filedescriptor,line);
+ sendTelnetLine(filedescriptor, line);
}
@@ -784,106 +758,106 @@ void CAmTelnetMenuHelper::getReceiverversionCommandExec(std::queue<std::string>
void CAmTelnetMenuHelper::infoSystempropertiesCommand(std::queue<std::string> & CmdQueue, int & filedescriptor)
/****************************************************************************/
{
- instance->infoSystempropertiesCommandExec(CmdQueue,filedescriptor);
+ instance->infoSystempropertiesCommandExec(CmdQueue, filedescriptor);
}
/****************************************************************************/
void CAmTelnetMenuHelper::infoSystempropertiesCommandExec(std::queue<std::string> & CmdQueue, int & filedescriptor)
/****************************************************************************/
{
- std::vector<am_SystemProperty_s> listSystemProperties;
- std::vector<am_SystemProperty_s>::iterator it;
- std::stringstream line;
-
- mDatabasehandler->getListSystemProperties(listSystemProperties);
-
- line << "\tSystemproperties: ";
- sendTelnetLine(filedescriptor,line);
-
- for(it = listSystemProperties.begin(); it < listSystemProperties.end(); it++ )
- {
- line.str("");
- line << "\tType: " << it->type << " Value: " << it->value << std::endl;
- sendTelnetLine(filedescriptor,line);
- }
+ (void) CmdQueue;
+ std::vector<am_SystemProperty_s> listSystemProperties;
+ std::vector<am_SystemProperty_s>::iterator it;
+ std::stringstream line;
+
+ mDatabasehandler->getListSystemProperties(listSystemProperties);
+
+ line << "\tSystemproperties: ";
+ sendTelnetLine(filedescriptor, line);
+
+ for (it = listSystemProperties.begin(); it < listSystemProperties.end(); it++)
+ {
+ line.str("");
+ line << "\tType: " << it->type << " Value: " << it->value << std::endl;
+ sendTelnetLine(filedescriptor, line);
+ }
}
/****************************************************************************/
void CAmTelnetMenuHelper::setRoutingCommand(std::queue<std::string> & CmdQueue, int & filedescriptor)
/****************************************************************************/
{
- instance->setRoutingCommandExec(CmdQueue,filedescriptor);
+ instance->setRoutingCommandExec(CmdQueue, filedescriptor);
}
/****************************************************************************/
void CAmTelnetMenuHelper::setRoutingCommandExec(std::queue<std::string> & CmdQueue, int & filedescriptor)
/****************************************************************************/
{
- std::stringstream output;
- std::vector<am_Route_s> routingList;
-
- am_sourceID_t sourceID = 0;
- am_sinkID_t sinkID = 0;
-
- bool error = false;
- am_Error_e rError = E_OK;
-
-
- if(CmdQueue.size() >= 2)
- {
- std::istringstream istream_sourceID(CmdQueue.front());
- CmdQueue.pop();
- std::istringstream istream_sinkID(CmdQueue.front());
- CmdQueue.pop();
-
- if(!(istream_sourceID >> sourceID))
- error = true;
- if(!(istream_sinkID >> sinkID))
- error = true;
-
- if(error)
- {
- sendError(filedescriptor,"Error parsing sourcID and sinkID");
- return;
- }
-
- if(DEBUG_ON)std::cout << "setRoutingCommandExec(sourceID: " << sourceID << ",sinkID: " << sinkID << ")" << std::endl;
-
- rError = mRouter->getRoute(true,sourceID,sinkID,routingList);
-
- if(E_OK == rError)
- {
- std::vector<am_Route_s>::iterator rlIter = routingList.begin();
- for(int rlCnt = 1;rlIter < routingList.end();rlIter++)
- {
- output << "#" << rlCnt << " ";
-
- std::vector<am_RoutingElement_s>::iterator reIter = rlIter->route.begin();
- for(;reIter < rlIter->route.end();reIter++)
+ std::stringstream output;
+ std::vector<am_Route_s> routingList;
+
+ am_sourceID_t sourceID = 0;
+ am_sinkID_t sinkID = 0;
+
+ bool error = false;
+ am_Error_e rError = E_OK;
+
+ if (CmdQueue.size() >= 2)
+ {
+ std::istringstream istream_sourceID(CmdQueue.front());
+ CmdQueue.pop();
+ std::istringstream istream_sinkID(CmdQueue.front());
+ CmdQueue.pop();
+
+ if (!(istream_sourceID >> sourceID))
+ error = true;
+ if (!(istream_sinkID >> sinkID))
+ error = true;
+
+ if (error)
+ {
+ sendError(filedescriptor, "Error parsing sourcID and sinkID");
+ return;
+ }
+
+ if (DEBUG_ON)
+ std::cout << "setRoutingCommandExec(sourceID: " << sourceID << ",sinkID: " << sinkID << ")" << std::endl;
+
+ rError = mRouter->getRoute(true, sourceID, sinkID, routingList);
+
+ if (E_OK == rError)
+ {
+ std::vector<am_Route_s>::iterator rlIter = routingList.begin();
+ for (int rlCnt = 1; rlIter < routingList.end(); rlIter++)
{
- reIter->connectionFormat;
- reIter->domainID;
- output << ">(" << reIter->sourceID << ")->--[D:"<< reIter->domainID <<"][F:"<< reIter->connectionFormat <<"]-->-(" << reIter->sinkID<< ")" << std::endl;
- }
-
- rlCnt++;
- }
+ output << "#" << rlCnt << " ";
- sendTelnetLine(filedescriptor,output);
- }
- else
- {
- sendError(filedescriptor,"Error getting route");
- }
+ std::vector<am_RoutingElement_s>::iterator reIter = rlIter->route.begin();
+ for (; reIter < rlIter->route.end(); reIter++)
+ {
+ reIter->connectionFormat;
+ reIter->domainID;
+ output << ">(" << reIter->sourceID << ")->--[D:" << reIter->domainID << "][F:" << reIter->connectionFormat << "]-->-(" << reIter->sinkID << ")" << std::endl;
+ }
- }
- else
- {
- CmdQueue.pop();
- output << "Not enough arguments to set routing. Please enter sourceID and sinkID after command" << std::endl;
- return;
- }
+ rlCnt++;
+ }
+ sendTelnetLine(filedescriptor, output);
+ }
+ else
+ {
+ sendError(filedescriptor, "Error getting route");
+ }
+
+ }
+ else
+ {
+ CmdQueue.pop();
+ output << "Not enough arguments to set routing. Please enter sourceID and sinkID after command" << std::endl;
+ return;
+ }
}
@@ -891,292 +865,281 @@ void CAmTelnetMenuHelper::setRoutingCommandExec(std::queue<std::string> & CmdQue
void CAmTelnetMenuHelper::setConnection(std::queue<std::string> & CmdQueue, int & filedescriptor)
/****************************************************************************/
{
- instance->setConnectionExec(CmdQueue,filedescriptor);
+ instance->setConnectionExec(CmdQueue, filedescriptor);
}
/****************************************************************************/
void CAmTelnetMenuHelper::setConnectionExec(std::queue<std::string> & CmdQueue, int & filedescriptor)
/****************************************************************************/
{
- std::stringstream output;
-
- am_sourceID_t sourceID = 0;
- am_sinkID_t sinkID = 0;
- am_mainConnectionID_t connID = 0;
-
- bool error = false;
- am_Error_e rError = E_OK;
-
- if(CmdQueue.size() >= 2)
- {
- std::istringstream istream_sourceID(CmdQueue.front());
- CmdQueue.pop();
-
- std::istringstream istream_sinkID(CmdQueue.front());
- CmdQueue.pop();
-
- if(!(istream_sourceID >> sourceID))
- error = true;
-
- if(!(istream_sinkID >> sinkID))
- error = true;
-
- if(error)
- {
- sendError(filedescriptor,"Error parsing sinkID and/or sourceID");
- return;
- }
-
- // Try to set up connection
- rError = mCommandReceiver->connect(sourceID,sinkID,connID);
-
- if(E_OK == rError)
- {
- output << "ConnID: " << connID << "\tSrc: " << sourceID << " ---> Sink: " << sinkID << std::endl;
- sendTelnetLine(filedescriptor,output);
- }
- else
- {
- sendError(filedescriptor,"Error connecting sourceID and sinkID");
- }
-
- }
- else
- {
- CmdQueue.pop();
- sendError(filedescriptor,"Not enough arguments to set routing. Please enter sourceID and sinkID after command");
- return;
- }
+ std::stringstream output;
+
+ am_sourceID_t sourceID = 0;
+ am_sinkID_t sinkID = 0;
+ am_mainConnectionID_t connID = 0;
+
+ bool error = false;
+ am_Error_e rError = E_OK;
+
+ if (CmdQueue.size() >= 2)
+ {
+ std::istringstream istream_sourceID(CmdQueue.front());
+ CmdQueue.pop();
+
+ std::istringstream istream_sinkID(CmdQueue.front());
+ CmdQueue.pop();
+
+ if (!(istream_sourceID >> sourceID))
+ error = true;
+
+ if (!(istream_sinkID >> sinkID))
+ error = true;
+
+ if (error)
+ {
+ sendError(filedescriptor, "Error parsing sinkID and/or sourceID");
+ return;
+ }
+
+ // Try to set up connection
+ rError = mCommandReceiver->connect(sourceID, sinkID, connID);
+
+ if (E_OK == rError)
+ {
+ output << "ConnID: " << connID << "\tSrc: " << sourceID << " ---> Sink: " << sinkID << std::endl;
+ sendTelnetLine(filedescriptor, output);
+ }
+ else
+ {
+ sendError(filedescriptor, "Error connecting sourceID and sinkID");
+ }
+
+ }
+ else
+ {
+ CmdQueue.pop();
+ sendError(filedescriptor, "Not enough arguments to set routing. Please enter sourceID and sinkID after command");
+ return;
+ }
}
/****************************************************************************/
void CAmTelnetMenuHelper::setDisconnectConnId(std::queue<std::string> & CmdQueue, int & filedescriptor)
/****************************************************************************/
{
- instance->setDisconnectConnIdExec(CmdQueue,filedescriptor);
+ instance->setDisconnectConnIdExec(CmdQueue, filedescriptor);
}
/****************************************************************************/
void CAmTelnetMenuHelper::setDisconnectConnIdExec(std::queue<std::string> & CmdQueue, int & filedescriptor)
/****************************************************************************/
{
- std::stringstream output;
-
- am_mainConnectionID_t connID = 0;
-
- bool error = false;
- am_Error_e rError = E_OK;
-
- if(CmdQueue.size() >= 1)
- {
- std::istringstream istream_connID(CmdQueue.front());
- CmdQueue.pop();
-
- if(!(istream_connID >> connID))
- error = true;
-
- if(error)
- {
- sendError(filedescriptor,"Error parsing connID");
- return;
- }
-
- // Try to disconnect connection id
- rError = mCommandReceiver->disconnect(connID);
-
- if(E_OK == rError)
- {
- output << "ConnID " << connID << " closed successfully! " << std::endl;
- sendTelnetLine(filedescriptor,output);
- }
- else
- {
- sendError(filedescriptor,"Error disconnecting connectionID");
- }
- }
- else
- {
- sendError(filedescriptor,"Not enough arguments to disconnect a Main Connection, please enter 'connectionID' after command");
- return;
- }
+ std::stringstream output;
+
+ am_mainConnectionID_t connID = 0;
+
+ bool error = false;
+ am_Error_e rError = E_OK;
+
+ if (CmdQueue.size() >= 1)
+ {
+ std::istringstream istream_connID(CmdQueue.front());
+ CmdQueue.pop();
+
+ if (!(istream_connID >> connID))
+ error = true;
+
+ if (error)
+ {
+ sendError(filedescriptor, "Error parsing connID");
+ return;
+ }
+
+ // Try to disconnect connection id
+ rError = mCommandReceiver->disconnect(connID);
+
+ if (E_OK == rError)
+ {
+ output << "ConnID " << connID << " closed successfully! " << std::endl;
+ sendTelnetLine(filedescriptor, output);
+ }
+ else
+ {
+ sendError(filedescriptor, "Error disconnecting connectionID");
+ }
+ }
+ else
+ {
+ sendError(filedescriptor, "Not enough arguments to disconnect a Main Connection, please enter 'connectionID' after command");
+ return;
+ }
}
/****************************************************************************/
void CAmTelnetMenuHelper::setSourceSoundProperties(std::queue<std::string> & CmdQueue, int & filedescriptor)
/****************************************************************************/
{
- instance->setConnectionExec(CmdQueue,filedescriptor);
+ instance->setConnectionExec(CmdQueue, filedescriptor);
}
/****************************************************************************/
void CAmTelnetMenuHelper::setSourceSoundPropertiesExec(std::queue<std::string> & CmdQueue, int & filedescriptor)
/****************************************************************************/
{
- std::stringstream output;
- am_sinkID_t sourceID;
- am_MainSoundProperty_s soundProperty;
- unsigned int tmpType = 0;
- bool error = false;
-
- if(CmdQueue.size() >= 3)
- {
- std::istringstream istream_sourceID(CmdQueue.front());
- CmdQueue.pop();
-
- std::istringstream istream_type(CmdQueue.front());
- CmdQueue.pop();
-
- std::istringstream istream_value(CmdQueue.front());
- CmdQueue.pop();
-
- if(!(istream_type >> tmpType))
- error = true;
-
- if(tmpType < MSP_MAX)
- soundProperty.type = static_cast<am_MainSoundPropertyType_e>(tmpType);
- else
- error = true;
-
- if(!(istream_value >> soundProperty.value))
- error = true;
-
- if(!(istream_sourceID >> sourceID))
- error = true;
-
- if(error)
- {
- sendError(filedescriptor,"Error parsing MainSinkSoundProperty 'type', 'value' or 'sourceID'");
- return;
- }
-
- if(E_OK == mCommandReceiver->setMainSourceSoundProperty(soundProperty,sourceID))
- {
- output << "MainSourceSoundProperty set: " << soundProperty.type << "->" << soundProperty.value << std::endl;
- sendTelnetLine(filedescriptor,output);
- }
- else
- {
- sendError(filedescriptor,"Error setMainSourceSoundProperty");
- }
- }
- else
- {
- sendError(filedescriptor,"Not enough arguments to set MainSourceSoundProperty, please enter 'sourceID', 'type' and 'value' after command");
- return;
- }
+ std::stringstream output;
+ am_sinkID_t sourceID;
+ am_MainSoundProperty_s soundProperty;
+ unsigned int tmpType = 0;
+ bool error = false;
+
+ if (CmdQueue.size() >= 3)
+ {
+ std::istringstream istream_sourceID(CmdQueue.front());
+ CmdQueue.pop();
+
+ std::istringstream istream_type(CmdQueue.front());
+ CmdQueue.pop();
+
+ std::istringstream istream_value(CmdQueue.front());
+ CmdQueue.pop();
+
+ if (!(istream_type >> tmpType))
+ error = true;
+
+ if (tmpType < MSP_MAX)
+ soundProperty.type = static_cast<am_MainSoundPropertyType_e>(tmpType);
+ else
+ error = true;
+
+ if (!(istream_value >> soundProperty.value))
+ error = true;
+
+ if (!(istream_sourceID >> sourceID))
+ error = true;
+
+ if (error)
+ {
+ sendError(filedescriptor, "Error parsing MainSinkSoundProperty 'type', 'value' or 'sourceID'");
+ return;
+ }
+
+ if (E_OK == mCommandReceiver->setMainSourceSoundProperty(soundProperty, sourceID))
+ {
+ output << "MainSourceSoundProperty set: " << soundProperty.type << "->" << soundProperty.value << std::endl;
+ sendTelnetLine(filedescriptor, output);
+ }
+ else
+ {
+ sendError(filedescriptor, "Error setMainSourceSoundProperty");
+ }
+ }
+ else
+ {
+ sendError(filedescriptor, "Not enough arguments to set MainSourceSoundProperty, please enter 'sourceID', 'type' and 'value' after command");
+ return;
+ }
}
/****************************************************************************/
void CAmTelnetMenuHelper::setSinkSoundProperties(std::queue<std::string> & CmdQueue, int & filedescriptor)
/****************************************************************************/
{
- instance->setConnectionExec(CmdQueue,filedescriptor);
+ instance->setConnectionExec(CmdQueue, filedescriptor);
}
/****************************************************************************/
void CAmTelnetMenuHelper::setSinkSoundPropertiesExec(std::queue<std::string> & CmdQueue, int & filedescriptor)
/****************************************************************************/
{
- std::stringstream output;
- am_sinkID_t sinkID;
- am_MainSoundProperty_s soundProperty;
- unsigned int tmpType = 0;
- bool error = false;
-
- if(CmdQueue.size() >= 3)
- {
- std::istringstream istream_sinkID(CmdQueue.front());
- CmdQueue.pop();
-
- std::istringstream istream_type(CmdQueue.front());
- CmdQueue.pop();
-
- std::istringstream istream_value(CmdQueue.front());
- CmdQueue.pop();
-
- if(!(istream_type >> tmpType))
- error = true;
-
- if(tmpType < MSP_MAX)
- soundProperty.type = static_cast<am_MainSoundPropertyType_e>(tmpType);
- else
- error = true;
-
- if(!(istream_value >> soundProperty.value))
- error = true;
-
- if(!(istream_sinkID >> sinkID))
- error = true;
-
- if(error)
- {
- sendError(filedescriptor,"Error parsing MainSinkSoundProperty 'type', 'value' or 'sinkID'");
- return;
- }
-
- if(E_OK == mCommandReceiver->setMainSinkSoundProperty(soundProperty,sinkID))
- {
- output << "MainSinkSoundProperty set: " << soundProperty.type << "->" << soundProperty.value << std::endl;
- sendTelnetLine(filedescriptor,output);
- }
- else
- {
- sendError(filedescriptor,"Error setMainSinkSoundProperty");
- }
- }
- else
- {
- sendError(filedescriptor,"Not enough arguments to set MainSinkSoundProperty, please enter 'sinkID', 'type' and 'value' after command");
- return;
- }
+ std::stringstream output;
+ am_sinkID_t sinkID;
+ am_MainSoundProperty_s soundProperty;
+ unsigned int tmpType = 0;
+ bool error = false;
+
+ if (CmdQueue.size() >= 3)
+ {
+ std::istringstream istream_sinkID(CmdQueue.front());
+ CmdQueue.pop();
+
+ std::istringstream istream_type(CmdQueue.front());
+ CmdQueue.pop();
+
+ std::istringstream istream_value(CmdQueue.front());
+ CmdQueue.pop();
+
+ if (!(istream_type >> tmpType))
+ error = true;
+
+ if (tmpType < MSP_MAX)
+ soundProperty.type = static_cast<am_MainSoundPropertyType_e>(tmpType);
+ else
+ error = true;
+
+ if (!(istream_value >> soundProperty.value))
+ error = true;
+
+ if (!(istream_sinkID >> sinkID))
+ error = true;
+
+ if (error)
+ {
+ sendError(filedescriptor, "Error parsing MainSinkSoundProperty 'type', 'value' or 'sinkID'");
+ return;
+ }
+
+ if (E_OK == mCommandReceiver->setMainSinkSoundProperty(soundProperty, sinkID))
+ {
+ output << "MainSinkSoundProperty set: " << soundProperty.type << "->" << soundProperty.value << std::endl;
+ sendTelnetLine(filedescriptor, output);
+ }
+ else
+ {
+ sendError(filedescriptor, "Error setMainSinkSoundProperty");
+ }
+ }
+ else
+ {
+ sendError(filedescriptor, "Not enough arguments to set MainSinkSoundProperty, please enter 'sinkID', 'type' and 'value' after command");
+ return;
+ }
}
-
/****************************************************************************/
void CAmTelnetMenuHelper::listPluginsCommand(std::queue<std::string> & CmdQueue, int & filedescriptor)
/****************************************************************************/
{
- instance->listPluginsCommandExec(CmdQueue,filedescriptor);
+ instance->listPluginsCommandExec(CmdQueue, filedescriptor);
}
/****************************************************************************/
void CAmTelnetMenuHelper::listPluginsCommandExec(std::queue<std::string> & CmdQueue, int & filedescriptor)
/****************************************************************************/
{
- std::vector<std::string> PlugInNames;
- std::vector<std::string>::iterator iter;
- std::stringstream output;
- am_Error_e rError = E_OK;
+ (void) CmdQueue;
+ std::vector<std::string> PlugInNames;
+ std::vector<std::string>::iterator iter;
+ std::stringstream output;
+ am_Error_e rError = E_OK;
+ rError = mCommandSender->getListPlugins(PlugInNames);
- rError = mCommandSender->getListPlugins(PlugInNames);
+ output << "CommandSender Plugins loaded: " << PlugInNames.size() << std::endl;
- output << "CommandSender Plugins loaded: " << PlugInNames.size() << std::endl;
+ for (iter = PlugInNames.begin(); iter < PlugInNames.end(); iter++)
+ {
+ output << iter->c_str() << std::endl;
+ }
- for(iter = PlugInNames.begin(); iter < PlugInNames.end(); iter++ )
- {
- output << iter->c_str() << std::endl;
- }
+ rError = mRoutingSender->getListPlugins(PlugInNames);
- rError = mRoutingSender->getListPlugins(PlugInNames);
+ output << std::endl << "RoutingSender Plugins loaded: " << PlugInNames.size() << std::endl;
- output << std::endl << "RoutingSender Plugins loaded: " << PlugInNames.size() << std::endl;
+ for (iter = PlugInNames.begin(); iter < PlugInNames.end(); iter++)
+ {
+ output << iter->c_str() << std::endl;
+ }
- for(iter = PlugInNames.begin(); iter < PlugInNames.end(); iter++ )
- {
- output << iter->c_str() << std::endl;
- }
-
- sendTelnetLine(filedescriptor,output);
+ sendTelnetLine(filedescriptor, output);
}
-
-
-
-
-
-
-
-
-
-
diff --git a/AudioManagerDaemon/src/CommandSender.cpp b/AudioManagerDaemon/src/CommandSender.cpp
index 810eec4..d2cc1ca 100644
--- a/AudioManagerDaemon/src/CommandSender.cpp
+++ b/AudioManagerDaemon/src/CommandSender.cpp
@@ -32,8 +32,6 @@ using namespace am;
#define REQUIRED_INTERFACE_VERSION 1
-DLT_IMPORT_CONTEXT(AudioManager)
-
//!< macro to call all interfaces
#define CALL_ALL_INTERFACES(...) \
std::vector<CommandSendInterface*>::iterator iter = mListInterfaces.begin(); \
diff --git a/AudioManagerDaemon/src/ControlReceiver.cpp b/AudioManagerDaemon/src/ControlReceiver.cpp
index b32ffdd..b352d0d 100644
--- a/AudioManagerDaemon/src/ControlReceiver.cpp
+++ b/AudioManagerDaemon/src/ControlReceiver.cpp
@@ -66,8 +66,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)
{
- mRouter->getRoute(onlyfree, sourceID, sinkID, returnList);
- return E_NOT_USED;
+ return mRouter->getRoute(onlyfree, sourceID, sinkID, returnList);
}
am_Error_e ControlReceiver::connect(am_Handle_s & handle, am_connectionID_t & connectionID, const am_ConnectionFormat_e format, const am_sourceID_t sourceID, const am_sinkID_t sinkID)
@@ -99,7 +98,7 @@ am_Error_e ControlReceiver::disconnect(am_Handle_s & handle, const am_connection
am_Error_e ControlReceiver::crossfade(am_Handle_s & handle, const am_HotSink_e hotSource, const am_crossfaderID_t crossfaderID, const am_RampType_e rampType, const am_time_t rampTime)
{
- logInfo("ControlReceiver::crossfade got called, hotSource=",hotSource,"crossfaderID=",crossfaderID,"rampType=",rampType,"rampTime=",rampTime);
+ logInfo("ControlReceiver::crossfade got called, hotSource=", hotSource, "crossfaderID=", crossfaderID, "rampType=", rampType, "rampTime=", rampTime);
if (!mDatabaseHandler->existcrossFader(crossfaderID))
return E_NON_EXISTENT;
@@ -108,7 +107,7 @@ am_Error_e ControlReceiver::crossfade(am_Handle_s & handle, const am_HotSink_e h
am_Error_e ControlReceiver::setSourceState(am_Handle_s & handle, const am_sourceID_t sourceID, const am_SourceState_e state)
{
- logInfo("ControlReceiver::setSourceState got called, sourceID=",sourceID,"state=",state);
+ logInfo("ControlReceiver::setSourceState got called, sourceID=", sourceID, "state=", state);
am_SourceState_e sourceState;
if (mDatabaseHandler->getSoureState(sourceID, sourceState) != E_OK)
@@ -120,7 +119,7 @@ am_Error_e ControlReceiver::setSourceState(am_Handle_s & handle, const am_source
am_Error_e ControlReceiver::setSinkVolume(am_Handle_s & handle, const am_sinkID_t sinkID, const am_volume_t volume, const am_RampType_e ramp, const am_time_t time)
{
- logInfo("ControlReceiver::setSinkVolume got called, sinkID=",sinkID,"volume=",volume,"ramp=",ramp, "time=",time);
+ logInfo("ControlReceiver::setSinkVolume got called, sinkID=", sinkID, "volume=", volume, "ramp=", ramp, "time=", time);
am_volume_t tempVolume;
if (mDatabaseHandler->getSinkVolume(sinkID, tempVolume) != E_OK)
@@ -132,7 +131,7 @@ am_Error_e ControlReceiver::setSinkVolume(am_Handle_s & handle, const am_sinkID_
am_Error_e ControlReceiver::setSourceVolume(am_Handle_s & handle, const am_sourceID_t sourceID, const am_volume_t volume, const am_RampType_e rampType, const am_time_t time)
{
- logInfo("ControlReceiver::setSourceVolume got called, sourceID=",sourceID,"volume=",volume,"ramp=",rampType,"time=",time);
+ logInfo("ControlReceiver::setSourceVolume got called, sourceID=", sourceID, "volume=", volume, "ramp=", rampType, "time=", time);
am_volume_t tempVolume;
if (mDatabaseHandler->getSourceVolume(sourceID, tempVolume) != E_OK)
@@ -144,7 +143,7 @@ am_Error_e ControlReceiver::setSourceVolume(am_Handle_s & handle, const am_sourc
am_Error_e ControlReceiver::setSinkSoundProperty(am_Handle_s & handle, const am_sinkID_t sinkID, const am_SoundProperty_s & soundProperty)
{
- logInfo("ControlReceiver::setSinkSoundProperty got called, sinkID=",sinkID,"soundProperty.Type=",soundProperty.type,"soundProperty.value=",soundProperty.value);
+ logInfo("ControlReceiver::setSinkSoundProperty got called, sinkID=", sinkID, "soundProperty.Type=", soundProperty.type, "soundProperty.value=", soundProperty.value);
uint16_t value;
if (mDatabaseHandler->getSinkSoundPropertyValue(sinkID, soundProperty.type, value) != E_OK)
@@ -156,7 +155,7 @@ am_Error_e ControlReceiver::setSinkSoundProperty(am_Handle_s & handle, const am_
am_Error_e ControlReceiver::setSinkSoundProperties(am_Handle_s & handle, const am_sinkID_t sinkID, const std::vector<am_SoundProperty_s> & listSoundProperties)
{
- logInfo("ControlReceiver::setSinkSoundProperties got called, sinkID=",sinkID);
+ logInfo("ControlReceiver::setSinkSoundProperties got called, sinkID=", sinkID);
uint16_t value;
bool noChange = true;
@@ -175,7 +174,7 @@ am_Error_e ControlReceiver::setSinkSoundProperties(am_Handle_s & handle, const a
am_Error_e ControlReceiver::setSourceSoundProperty(am_Handle_s & handle, const am_sourceID_t sourceID, const am_SoundProperty_s & soundProperty)
{
- logInfo("ControlReceiver::setSourceSoundProperty got called, sourceID=",sourceID,"soundProperty.Type=",soundProperty.type,"soundProperty.value=",soundProperty.value);
+ logInfo("ControlReceiver::setSourceSoundProperty got called, sourceID=", sourceID, "soundProperty.Type=", soundProperty.type, "soundProperty.value=", soundProperty.value);
uint16_t value;
if (mDatabaseHandler->getSourceSoundPropertyValue(sourceID, soundProperty.type, value) != E_OK)
@@ -187,7 +186,7 @@ am_Error_e ControlReceiver::setSourceSoundProperty(am_Handle_s & handle, const a
am_Error_e ControlReceiver::setSourceSoundProperties(am_Handle_s & handle, const am_sourceID_t sourceID, const std::vector<am_SoundProperty_s> & listSoundProperties)
{
- logInfo("ControlReceiver::setSourceSoundProperties got called, sourceID=",sourceID);
+ logInfo("ControlReceiver::setSourceSoundProperties got called, sourceID=", sourceID);
uint16_t value;
bool noChange = true;
@@ -206,7 +205,7 @@ am_Error_e ControlReceiver::setSourceSoundProperties(am_Handle_s & handle, const
am_Error_e ControlReceiver::setDomainState(const am_domainID_t domainID, const am_DomainState_e domainState)
{
- logInfo("ControlReceiver::setDomainState got called, domainID=",domainID,"domainState=",domainState);
+ logInfo("ControlReceiver::setDomainState got called, domainID=", domainID, "domainState=", domainState);
am_DomainState_e tempState = DS_MIN;
if (mDatabaseHandler->getDomainState(domainID, tempState) != E_OK)
@@ -218,7 +217,7 @@ am_Error_e ControlReceiver::setDomainState(const am_domainID_t domainID, const a
am_Error_e ControlReceiver::abortAction(const am_Handle_s handle)
{
- logInfo("ControlReceiver::abortAction got called, handle.type=",handle.handle,"handle.handleType=",handle.handleType);
+ logInfo("ControlReceiver::abortAction got called, handle.type=", handle.handle, "handle.handleType=", handle.handleType);
return mRoutingSender->asyncAbort(handle);
}
@@ -268,9 +267,9 @@ am_Error_e ControlReceiver::enterSystemPropertiesListDB(const std::vector<am_Sys
return mDatabaseHandler->enterSystemProperties(listSystemProperties);
}
-am_Error_e ControlReceiver::changeMainConnectionRouteDB(const am_mainConnectionID_t mainconnectionID, const am_Route_s & route)
+am_Error_e ControlReceiver::changeMainConnectionRouteDB(const am_mainConnectionID_t mainconnectionID, const std::vector<am_connectionID_t>& listConnectionID)
{
- return mDatabaseHandler->changeMainConnectionRouteDB(mainconnectionID, route);
+ return mDatabaseHandler->changeMainConnectionRouteDB(mainconnectionID, listConnectionID);
}
am_Error_e ControlReceiver::changeMainConnectionStateDB(const am_mainConnectionID_t mainconnectionID, const am_ConnectionState_e connectionState)
@@ -358,6 +357,21 @@ am_Error_e ControlReceiver::getSinkClassInfoDB(const am_sinkID_t sinkID, am_Sink
return mDatabaseHandler->getSinkClassInfoDB(sinkID, sinkClass);
}
+am_Error_e ControlReceiver::getSinkInfoDB(const am_sinkID_t sinkID, am_Sink_s & sinkData) const
+{
+ return mDatabaseHandler->getSinkInfoDB(sinkID, sinkData);
+}
+
+am_Error_e ControlReceiver::getSourceInfoDB(const am_sourceID_t sourceID, am_Source_s & sourceData) const
+{
+ return mDatabaseHandler->getSourceInfoDB(sourceID, sourceData);
+}
+
+am_Error_e ControlReceiver::getMainConnectionInfoDB(const am_mainConnectionID_t mainConnectionID, am_MainConnection_s & mainConnectionData) const
+{
+ return mDatabaseHandler->getMainConnectionInfoDB(mainConnectionID, mainConnectionData);
+}
+
am_Error_e ControlReceiver::getGatewayInfoDB(const am_gatewayID_t gatewayID, am_Gateway_s & gatewayData) const
{
return mDatabaseHandler->getGatewayInfoDB(gatewayID, gatewayData);
diff --git a/AudioManagerDaemon/src/DatabaseHandler.cpp b/AudioManagerDaemon/src/DatabaseHandler.cpp
index 1082c25..5f7ee1d 100644
--- a/AudioManagerDaemon/src/DatabaseHandler.cpp
+++ b/AudioManagerDaemon/src/DatabaseHandler.cpp
@@ -176,17 +176,18 @@ am_Error_e DatabaseHandler::enterDomainDB(const am_Domain_s & domainData, am_dom
am_Error_e DatabaseHandler::enterMainConnectionDB(const am_MainConnection_s & mainConnectionData, am_mainConnectionID_t & connectionID)
{
- assert(mainConnectionData.connectionID==0);
+ assert(mainConnectionData.mainConnectionID==0);
assert(mainConnectionData.connectionState>=CS_MIN && mainConnectionData.connectionState<=CS_MAX);
- assert(mainConnectionData.route.sinkID!=0);
- assert(mainConnectionData.route.sourceID!=0);
+ assert(mainConnectionData.sinkID!=0);
+ assert(mainConnectionData.sourceID!=0);
sqlite3_stmt* query = NULL;
int eCode = 0;
+ int16_t delay = 0;
std::string command = "INSERT INTO " + std::string(MAINCONNECTION_TABLE) + "(sourceID, sinkID, connectionState, delay) VALUES (?,?,?,-1)";
sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
- sqlite3_bind_int(query, 1, mainConnectionData.route.sourceID);
- sqlite3_bind_int(query, 2, mainConnectionData.route.sinkID);
+ sqlite3_bind_int(query, 1, mainConnectionData.sourceID);
+ sqlite3_bind_int(query, 2, mainConnectionData.sinkID);
sqlite3_bind_int(query, 3, mainConnectionData.connectionState);
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
@@ -203,21 +204,16 @@ am_Error_e DatabaseHandler::enterMainConnectionDB(const am_MainConnection_s & ma
connectionID = sqlite3_last_insert_rowid(mDatabase);
- //now check the connectionTable for all connections in the route. IF a particular route is not found, we return with error
- std::vector<uint16_t> listOfConnections;
- int16_t delay = 0;
- command = "SELECT connectionID, delay FROM " + std::string(CONNECTION_TABLE) + (" WHERE sourceID=? AND sinkID=? AND connectionFormat=?");
+ //now check the connectionTable for all connections in the route. IF connectionID exist
+ command = "SELECT delay FROM " + std::string(CONNECTION_TABLE) + (" WHERE connectionID=?");
sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
- std::vector<am_RoutingElement_s>::const_iterator elementIterator = mainConnectionData.route.route.begin();
- for (; elementIterator < mainConnectionData.route.route.end(); ++elementIterator)
+ std::vector<am_connectionID_t>::const_iterator elementIterator = mainConnectionData.listConnectionID.begin();
+ for (; elementIterator < mainConnectionData.listConnectionID.end(); ++elementIterator)
{
- sqlite3_bind_int(query, 1, elementIterator->sourceID);
- sqlite3_bind_int(query, 2, elementIterator->sinkID);
- sqlite3_bind_int(query, 3, elementIterator->connectionFormat);
+ sqlite3_bind_int(query, 1, *elementIterator);
if ((eCode = sqlite3_step(query)) == SQLITE_ROW)
{
- listOfConnections.push_back(sqlite3_column_int(query, 0));
int16_t temp_delay = sqlite3_column_int(query, 1);
if (temp_delay != -1 && delay != -1)
delay += temp_delay;
@@ -227,7 +223,6 @@ am_Error_e DatabaseHandler::enterMainConnectionDB(const am_MainConnection_s & ma
else
{
logError("DatabaseHandler::enterMainConnectionDB did not find route for MainConnection:", eCode);
-
return E_DATABASE_ERROR;
}
sqlite3_reset(query);
@@ -245,8 +240,8 @@ am_Error_e DatabaseHandler::enterMainConnectionDB(const am_MainConnection_s & ma
command = "INSERT INTO MainConnectionRoute" + i2s(connectionID) + "(connectionID) VALUES (?)";
sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
- std::vector<uint16_t>::iterator listConnectionIterator = listOfConnections.begin();
- for (; listConnectionIterator < listOfConnections.end(); ++listConnectionIterator)
+ std::vector<am_connectionID_t>::const_iterator listConnectionIterator(mainConnectionData.listConnectionID.begin());
+ for (; listConnectionIterator < mainConnectionData.listConnectionID.end(); ++listConnectionIterator)
{
sqlite3_bind_int(query, 1, *listConnectionIterator);
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
@@ -263,7 +258,7 @@ am_Error_e DatabaseHandler::enterMainConnectionDB(const am_MainConnection_s & ma
return E_DATABASE_ERROR;
}
- logInfo("DatabaseHandler::enterMainConnectionDB entered new mainConnection with sourceID", mainConnectionData.route.sourceID, "sinkID:", mainConnectionData.route.sinkID, "delay:", delay, "assigned ID:", connectionID);
+ logInfo("DatabaseHandler::enterMainConnectionDB entered new mainConnection with sourceID", mainConnectionData.sourceID, "sinkID:", mainConnectionData.sinkID, "delay:", delay, "assigned ID:", connectionID);
if (mDatabaseObserver)
{
@@ -832,7 +827,7 @@ am_Error_e DatabaseHandler::enterSourceDB(const am_Source_s & sourceData, am_sou
return E_OK;
}
-am_Error_e DatabaseHandler::changeMainConnectionRouteDB(const am_mainConnectionID_t mainconnectionID, const am_Route_s & route)
+am_Error_e DatabaseHandler::changeMainConnectionRouteDB(const am_mainConnectionID_t mainconnectionID, const std::vector<am_connectionID_t>& listConnectionID)
{
assert(mainconnectionID!=0);
if (!existMainConnection(mainconnectionID))
@@ -843,20 +838,16 @@ am_Error_e DatabaseHandler::changeMainConnectionRouteDB(const am_mainConnectionI
int eCode = 0;
std::string command;
- std::vector<uint16_t> listOfConnections;
int16_t delay = 0;
- command = "SELECT connectionID, delay FROM " + std::string(CONNECTION_TABLE) + (" WHERE sourceID=? AND sinkID=? AND connectionFormat=?");
+ command = "SELECT delay FROM " + std::string(CONNECTION_TABLE) + (" WHERE connectionID=?");
sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
- std::vector<am_RoutingElement_s>::const_iterator elementIterator = route.route.begin();
- for (; elementIterator < route.route.end(); ++elementIterator)
+ std::vector<am_connectionID_t>::const_iterator elementIterator = listConnectionID.begin();
+ for (; elementIterator < listConnectionID.end(); ++elementIterator)
{
- sqlite3_bind_int(query, 1, elementIterator->sourceID);
- sqlite3_bind_int(query, 2, elementIterator->sinkID);
- sqlite3_bind_int(query, 3, elementIterator->connectionFormat);
+ sqlite3_bind_int(query, 1, *elementIterator);
if ((eCode = sqlite3_step(query)) == SQLITE_ROW)
{
- listOfConnections.push_back(sqlite3_column_int(query, 0));
int16_t temp_delay = sqlite3_column_int(query, 1);
if (temp_delay != -1 && delay != -1)
delay += temp_delay;
@@ -885,8 +876,8 @@ am_Error_e DatabaseHandler::changeMainConnectionRouteDB(const am_mainConnectionI
command = "INSERT INTO MainConnectionRoute" + i2s(mainconnectionID) + "(connectionID) VALUES (?)";
sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
- std::vector<uint16_t>::iterator listConnectionIterator = listOfConnections.begin();
- for (; listConnectionIterator < listOfConnections.end(); ++listConnectionIterator)
+ std::vector<am_connectionID_t>::const_iterator listConnectionIterator(listConnectionID.begin());
+ for (; listConnectionIterator != listConnectionID.end(); ++listConnectionIterator)
{
sqlite3_bind_int(query, 1, *listConnectionIterator);
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
@@ -1393,11 +1384,8 @@ am_Error_e DatabaseHandler::removeConnection(const am_connectionID_t connectionI
assert(connectionID!=0);
std::string command = "DELETE from " + std::string(CONNECTION_TABLE) + " WHERE connectionID=" + i2s(connectionID);
- std::string command1 = "DROP table SourceClassProperties" + i2s(connectionID);
if (!sqQuery(command))
return E_DATABASE_ERROR;
- if (!sqQuery(command1))
- return E_DATABASE_ERROR;
logInfo("DatabaseHandler::removeConnection removed:", connectionID);
return E_OK;
}
@@ -1477,6 +1465,246 @@ am_Error_e DatabaseHandler::getSourceClassInfoDB(const am_sourceID_t sourceID, a
return E_OK;
}
+am_Error_e DatabaseHandler::getSinkInfoDB(const am_sinkID_t sinkID, am_Sink_s & sinkData) const
+{
+
+ assert(sinkID!=0);
+
+ if (!existSink(sinkID))
+ {
+ return E_NON_EXISTENT;
+ }
+
+ sqlite3_stmt* query = NULL, *qConnectionFormat = NULL, *qSoundProperty = NULL, *qMAinSoundProperty = NULL;
+ int eCode = 0;
+ am_ConnectionFormat_e tempConnectionFormat;
+ am_SoundProperty_s tempSoundProperty;
+ am_MainSoundProperty_s tempMainSoundProperty;
+ 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);
+ sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+
+ if ((eCode = sqlite3_step(query)) == SQLITE_ROW)
+ {
+ sinkData.name = std::string((const char*) sqlite3_column_text(query, 0));
+ sinkData.domainID = sqlite3_column_int(query, 1);
+ sinkData.sinkClassID = sqlite3_column_int(query, 2);
+ sinkData.volume = sqlite3_column_int(query, 3);
+ sinkData.visible = sqlite3_column_int(query, 4);
+ sinkData.available.availability = (am_Availablility_e) sqlite3_column_int(query, 5);
+ sinkData.available.availabilityReason = (am_AvailabilityReason_e) sqlite3_column_int(query, 6);
+ sinkData.muteState = (am_MuteState_e) sqlite3_column_int(query, 7);
+ sinkData.mainVolume = sqlite3_column_int(query, 8);
+ sinkData.sinkID = sqlite3_column_int(query, 9);
+
+ //read out the connectionFormats
+ std::string commandConnectionFormat = "SELECT soundFormat FROM SinkConnectionFormat" + i2s(sinkID);
+ sqlite3_prepare_v2(mDatabase, commandConnectionFormat.c_str(), -1, &qConnectionFormat, NULL);
+ while ((eCode = sqlite3_step(qConnectionFormat)) == SQLITE_ROW)
+ {
+ tempConnectionFormat = (am_ConnectionFormat_e) sqlite3_column_int(qConnectionFormat, 0);
+ sinkData.listConnectionFormats.push_back(tempConnectionFormat);
+ }
+
+ if ((eCode = sqlite3_finalize(qConnectionFormat)) != SQLITE_OK)
+ {
+ logError("DatabaseHandler::getSinkInfoDB SQLITE Finalize error code:", eCode);
+
+ return E_DATABASE_ERROR;
+ }
+
+ //read out sound properties
+ std::string commandSoundProperty = "SELECT soundPropertyType, value FROM SinkSoundProperty" + i2s(sinkID);
+ sqlite3_prepare_v2(mDatabase, commandSoundProperty.c_str(), -1, &qSoundProperty, NULL);
+ while ((eCode = sqlite3_step(qSoundProperty)) == SQLITE_ROW)
+ {
+ tempSoundProperty.type = (am_SoundPropertyType_e) sqlite3_column_int(qSoundProperty, 0);
+ tempSoundProperty.value = sqlite3_column_int(qSoundProperty, 1);
+ sinkData.listSoundProperties.push_back(tempSoundProperty);
+ }
+
+ if ((eCode = sqlite3_finalize(qSoundProperty)) != SQLITE_OK)
+ {
+ logError("DatabaseHandler::getSinkInfoDB SQLITE Finalize error code:", eCode);
+
+ return E_DATABASE_ERROR;
+ }
+
+ //read out MainSoundProperties
+ std::string commandMainSoundProperty = "SELECT soundPropertyType, value FROM SinkMainSoundProperty" + i2s(sinkID);
+ sqlite3_prepare_v2(mDatabase, 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);
+ }
+
+ if ((eCode = sqlite3_finalize(qMAinSoundProperty)) != SQLITE_OK)
+ {
+ logError("DatabaseHandler::getSinkInfoDB SQLITE Finalize error code:", eCode);
+
+ return E_DATABASE_ERROR;
+ }
+ }
+
+ else if (eCode != SQLITE_DONE)
+ {
+ logError("DatabaseHandler::getSinkInfoDB SQLITE error code:", eCode);
+
+ return E_DATABASE_ERROR;
+ }
+
+ if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
+ {
+ logError("DatabaseHandler::getSinkInfoDB SQLITE Finalize error code:", eCode);
+
+ return E_DATABASE_ERROR;
+ }
+
+ return E_OK;
+}
+
+am_Error_e DatabaseHandler::getSourceInfoDB(const am_sourceID_t sourceID, am_Source_s & sourceData) const
+{
+ assert(sourceID!=0);
+
+ if (!existSource(sourceID))
+ {
+ return E_NON_EXISTENT;
+ }
+
+ sqlite3_stmt* query = NULL, *qConnectionFormat = NULL, *qSoundProperty = NULL, *qMAinSoundProperty = NULL;
+ int eCode = 0;
+ am_ConnectionFormat_e tempConnectionFormat;
+ am_SoundProperty_s tempSoundProperty;
+ am_MainSoundProperty_s tempMainSoundProperty;
+ 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);
+ sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+
+ if ((eCode = sqlite3_step(query)) == SQLITE_ROW)
+ {
+ sourceData.name = std::string((const char*) sqlite3_column_text(query, 0));
+ sourceData.domainID = sqlite3_column_int(query, 1);
+ sourceData.sourceClassID = sqlite3_column_int(query, 2);
+ sourceData.sourceState = (am_SourceState_e) sqlite3_column_int(query, 3);
+ sourceData.volume = sqlite3_column_int(query, 4);
+ sourceData.visible = sqlite3_column_int(query, 5);
+ sourceData.available.availability = (am_Availablility_e) sqlite3_column_int(query, 6);
+ sourceData.available.availabilityReason = (am_AvailabilityReason_e) sqlite3_column_int(query, 7);
+ sourceData.interruptState = (am_InterruptState_e) sqlite3_column_int(query, 8);
+ sourceData.sourceID = sqlite3_column_int(query, 9);
+
+ //read out the connectionFormats
+ std::string commandConnectionFormat = "SELECT soundFormat FROM SourceConnectionFormat" + i2s(sourceID);
+ sqlite3_prepare_v2(mDatabase, commandConnectionFormat.c_str(), -1, &qConnectionFormat, NULL);
+ while ((eCode = sqlite3_step(qConnectionFormat)) == SQLITE_ROW)
+ {
+ tempConnectionFormat = (am_ConnectionFormat_e) sqlite3_column_int(qConnectionFormat, 0);
+ sourceData.listConnectionFormats.push_back(tempConnectionFormat);
+ }
+
+ if ((eCode = sqlite3_finalize(qConnectionFormat)) != SQLITE_OK)
+ {
+ logError("DatabaseHandler::getListSources SQLITE Finalize error code:", eCode);
+
+ return E_DATABASE_ERROR;
+ }
+
+ //read out sound properties
+ std::string commandSoundProperty = "SELECT soundPropertyType, value FROM SourceSoundProperty" + i2s(sourceID);
+ sqlite3_prepare_v2(mDatabase, commandSoundProperty.c_str(), -1, &qSoundProperty, NULL);
+ while ((eCode = sqlite3_step(qSoundProperty)) == SQLITE_ROW)
+ {
+ tempSoundProperty.type = (am_SoundPropertyType_e) sqlite3_column_int(qSoundProperty, 0);
+ tempSoundProperty.value = sqlite3_column_int(qSoundProperty, 1);
+ sourceData.listSoundProperties.push_back(tempSoundProperty);
+ }
+
+ if ((eCode = sqlite3_finalize(qSoundProperty)) != SQLITE_OK)
+ {
+ logError("DatabaseHandler::getSourceInfoDB SQLITE Finalize error code:", eCode);
+
+ return E_DATABASE_ERROR;
+ }
+
+ //read out MainSoundProperties
+ std::string commandMainSoundProperty = "SELECT soundPropertyType, value FROM SourceMainSoundProperty" + i2s(sourceID);
+ sqlite3_prepare_v2(mDatabase, 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);
+ }
+
+ if ((eCode = sqlite3_finalize(qMAinSoundProperty)) != SQLITE_OK)
+ {
+ logError("DatabaseHandler::getSourceInfoDB SQLITE Finalize error code:", eCode);
+
+ return E_DATABASE_ERROR;
+ }
+ }
+ else if (eCode != SQLITE_DONE)
+ {
+ logError("DatabaseHandler::getSourceInfoDB SQLITE error code:", eCode);
+
+ return E_DATABASE_ERROR;
+ }
+
+ if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
+ {
+ logError("DatabaseHandler::getSourceInfoDB SQLITE Finalize error code:", eCode);
+
+ return E_DATABASE_ERROR;
+ }
+
+ return E_OK;
+}
+
+am_Error_e am::DatabaseHandler::getMainConnectionInfoDB(const am_mainConnectionID_t mainConnectionID, am_MainConnection_s & mainConnectionData) const
+{
+ assert(mainConnectionID!=0);
+ if (!existMainConnection(mainConnectionID))
+ {
+ return E_NON_EXISTENT;
+ }
+ sqlite3_stmt *query = NULL, *query1 = NULL;
+ int eCode = 0;
+ am_MainConnection_s temp;
+ std::string command = "SELECT mainConnectionID, sourceID, sinkID, connectionState, delay FROM " + std::string(MAINCONNECTION_TABLE) + " WHERE mainConnectionID=" + i2s(mainConnectionID);
+ std::string command1 = "SELECT connectionID FROM MainConnectionRoute";
+ sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+
+ while ((eCode = sqlite3_step(query)) == SQLITE_ROW)
+ {
+ mainConnectionData.mainConnectionID = sqlite3_column_int(query, 0);
+ mainConnectionData.sourceID = sqlite3_column_int(query, 1);
+ mainConnectionData.sinkID = sqlite3_column_int(query, 2);
+ mainConnectionData.connectionState = (am_ConnectionState_e) sqlite3_column_int(query, 3);
+ mainConnectionData.delay = sqlite3_column_int(query, 4);
+ std::string statement = command1 + i2s(mainConnectionID);
+ sqlite3_prepare_v2(mDatabase, statement.c_str(), -1, &query1, NULL);
+ while ((eCode = sqlite3_step(query1)) == SQLITE_ROW)
+ {
+ mainConnectionData.listConnectionID.push_back(sqlite3_column_int(query1, 0));
+ }
+ }
+
+ if (eCode != SQLITE_DONE)
+ {
+ logError("DatabaseHandler::getMainConnectionInfoDB SQLITE error code:", eCode);
+ return E_DATABASE_ERROR;
+ }
+
+ if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
+ {
+ logError("DatabaseHandler::getMainConnectionInfoDB SQLITE Finalize error code:", eCode);
+ return E_DATABASE_ERROR;
+ }
+
+ return E_OK;
+}
+
am_Error_e DatabaseHandler::changeSinkClassInfoDB(const am_SinkClass_s& sinkClass)
{
assert(sinkClass.sinkClassID!=0);
@@ -1893,39 +2121,25 @@ am_Error_e DatabaseHandler::getListGatewaysOfDomain(const am_domainID_t domainID
am_Error_e DatabaseHandler::getListMainConnections(std::vector<am_MainConnection_s> & listMainConnections) const
{
listMainConnections.clear();
- sqlite3_stmt *query = NULL, *query1 = NULL, *query2 = NULL;
+ sqlite3_stmt *query = NULL, *query1 = NULL;
int eCode = 0;
am_MainConnection_s temp;
- am_RoutingElement_s tempRoute;
-
std::string command = "SELECT mainConnectionID, sourceID, sinkID, connectionState, delay FROM " + std::string(MAINCONNECTION_TABLE);
std::string command1 = "SELECT connectionID FROM MainConnectionRoute";
- std::string command2 = "SELECT sourceID, sinkID, connectionFormat FROM " + std::string(CONNECTION_TABLE) + " WHERE connectionID=?";
sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
- sqlite3_prepare_v2(mDatabase, command2.c_str(), -1, &query2, NULL);
while ((eCode = sqlite3_step(query)) == SQLITE_ROW)
{
- temp.connectionID = sqlite3_column_int(query, 0);
- temp.route.sourceID = sqlite3_column_int(query, 1);
- temp.route.sinkID = sqlite3_column_int(query, 2);
+ temp.mainConnectionID = sqlite3_column_int(query, 0);
+ temp.sourceID = sqlite3_column_int(query, 1);
+ temp.sinkID = sqlite3_column_int(query, 2);
temp.connectionState = (am_ConnectionState_e) sqlite3_column_int(query, 3);
temp.delay = sqlite3_column_int(query, 4);
- std::string statement = command1 + i2s(temp.connectionID);
+ std::string statement = command1 + i2s(temp.mainConnectionID);
sqlite3_prepare_v2(mDatabase, statement.c_str(), -1, &query1, NULL);
while ((eCode = sqlite3_step(query1)) == SQLITE_ROW)
{
- int k = sqlite3_column_int(query1, 0);
- sqlite3_bind_int(query2, 1, k);
- while ((eCode = sqlite3_step(query2)) == SQLITE_ROW)
- {
- tempRoute.sourceID = sqlite3_column_int(query2, 0);
- tempRoute.sinkID = sqlite3_column_int(query2, 1);
- tempRoute.connectionFormat = (am_ConnectionFormat_e) sqlite3_column_int(query2, 2);
- getDomainOfSource(tempRoute.sourceID, tempRoute.domainID);
- temp.route.route.push_back(tempRoute);
- }
- sqlite3_reset(query2);
+ temp.listConnectionID.push_back(sqlite3_column_int(query1, 0));
}
listMainConnections.push_back(temp);
}
diff --git a/AudioManagerDaemon/src/SocketHandler.cpp b/AudioManagerDaemon/src/SocketHandler.cpp
index fa7fee4..d9fdc3a 100644
--- a/AudioManagerDaemon/src/SocketHandler.cpp
+++ b/AudioManagerDaemon/src/SocketHandler.cpp
@@ -219,7 +219,8 @@ void SocketHandler::stop_listening()
* @param callback the callback that shall be called if the filedescriptor poll succeeded
* @return E_OK if the descriptor was added, E_NON_EXISTENT if the fd is not valid
*/
-am_Error_e SocketHandler::addFDPoll(const int fd, const int16_t event, shPollPrepare *prepare, shPollFired *fired, shPollCheck *check, shPollDispatch *dispatch, void* userData, sh_pollHandle_t& handle)
+
+am_Error_e SocketHandler::addFDPoll(const int fd, const short event, shPollPrepare *prepare, shPollFired *fired, shPollCheck *check, shPollDispatch *dispatch, void *userData, sh_pollHandle_t & handle)
{
if (!fdIsValid(fd))
return E_NON_EXISTENT;
@@ -386,7 +387,7 @@ am_Error_e SocketHandler::stopTimer(const sh_timerHandle_t handle)
* @param event the event flags
* @return E_OK on succsess, E_NON_EXISTENT if fd was not found
*/
-am_Error_e SocketHandler::updateEventFlags(const sh_pollHandle_t handle, const int16_t events)
+am_Error_e SocketHandler::updateEventFlags(const sh_pollHandle_t handle, const short events)
{
mListPoll_t::iterator iterator = mListPoll.begin();
diff --git a/AudioManagerDaemon/src/TelnetServer.cpp b/AudioManagerDaemon/src/TelnetServer.cpp
index e879066..059a147 100644
--- a/AudioManagerDaemon/src/TelnetServer.cpp
+++ b/AudioManagerDaemon/src/TelnetServer.cpp
@@ -118,6 +118,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);
@@ -162,6 +164,8 @@ void TelnetServer::disconnectClient(int filedescriptor)
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
@@ -176,6 +180,7 @@ void TelnetServer::receiveData(const pollfd pollfd, const sh_pollHandle_t handle
bool TelnetServer::dispatchData(const sh_pollHandle_t handle, void *userData)
{
+ (void) userData;
std::vector<connection_s>::iterator iterator=mListConnections.begin();
for(;iterator!=mListConnections.end();++iterator)
{
@@ -225,6 +230,7 @@ bool TelnetServer::check(const sh_pollHandle_t handle, void *userData)
void am::TelnetServer::sliceCommand(const std::string & string, std::string & command, std::queue<std::string> & MsgQueue)
{
+ (void) command;
std::stringstream stream(string);
std::istream_iterator<std::string> begin(stream);
std::istream_iterator<std::string> end;
diff --git a/AudioManagerDaemon/src/main.cpp b/AudioManagerDaemon/src/main.cpp
index 82bac88..ad0e3b8 100644
--- a/AudioManagerDaemon/src/main.cpp
+++ b/AudioManagerDaemon/src/main.cpp
@@ -33,7 +33,7 @@
//todo: there is a bug in the visible flags of sinks and sources. fix it.
//todo: make sure all configurations are tested
//todo: clean up startup sequences controller, command and routing interfaces----
-//todo: add getMainConnectionData in commandreceive interface to retrieve infos about mainconnections
+
#include <config.h>
#include <SocketHandler.h>
#ifdef WITH_DBUS_WRAPPER
diff --git a/AudioManagerDaemon/test/CommonFunctions.cpp b/AudioManagerDaemon/test/CommonFunctions.cpp
index 30c8725..10245d7 100644
--- a/AudioManagerDaemon/test/CommonFunctions.cpp
+++ b/AudioManagerDaemon/test/CommonFunctions.cpp
@@ -300,14 +300,6 @@ void CommonFunctions::createConnection(am_Connection_s & connection) const
connection.connectionFormat = CF_ANALOG;
}
-void CommonFunctions::createMainConnection(am_MainConnection_s & mainConnection, am_Route_s route) const
-{
- mainConnection.connectionID = 0;
- mainConnection.connectionState = CS_CONNECTED;
- mainConnection.route = route;
- mainConnection.delay = -1;
-}
-
std::vector<bool> CommonFunctions::getStandardConvertionMatrix()
{
std::vector<bool> convMatrix;
diff --git a/AudioManagerDaemon/test/CommonFunctions.h b/AudioManagerDaemon/test/CommonFunctions.h
index 7bc7e04..6e5a996 100644
--- a/AudioManagerDaemon/test/CommonFunctions.h
+++ b/AudioManagerDaemon/test/CommonFunctions.h
@@ -51,7 +51,6 @@ public:
void createDomain(am_Domain_s& domain) const;
void createGateway(am_Gateway_s& gateway);
void createConnection(am_Connection_s& connection) const;
- void createMainConnection(am_MainConnection_s& mainConnection, am_Route_s route) const;
void connectionList2RoutingList(std::vector<am_RoutingElement_s>& routingList, const std::vector<am_Connection_s>& connectionList);
struct sortBySinkID
diff --git a/AudioManagerDaemon/test/database/databaseTest.cpp b/AudioManagerDaemon/test/database/databaseTest.cpp
index 58bd0e7..caaac76 100644
--- a/AudioManagerDaemon/test/database/databaseTest.cpp
+++ b/AudioManagerDaemon/test/database/databaseTest.cpp
@@ -40,7 +40,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 equalRoutingElement(const am_RoutingElement_s a, const am_RoutingElement_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);
@@ -72,7 +72,7 @@ void databasetest::createMainConnectionSetup()
am_Connection_s connection;
am_Source_s source;
am_Sink_s sink;
- std::vector<am_Connection_s> connectionList;
+ std::vector<am_connectionID_t> connectionList;
//we create 9 sources and sinks:
EXPECT_CALL(pMockInterface,cbNumberOfSourcesChanged()).Times(9);
@@ -82,12 +82,7 @@ void databasetest::createMainConnectionSetup()
{
am_sinkID_t forgetSink;
am_sourceID_t forgetSource;
- am_connectionID_t forgetConnection;
-
- pCF.createConnection(connection);
- connection.sinkID = i;
- connection.sourceID = i;
- connectionList.push_back(connection);
+ am_connectionID_t connectionID;
pCF.createSink(sink);
sink.sinkID = i;
@@ -98,38 +93,36 @@ void databasetest::createMainConnectionSetup()
source.name = "source" + int2string(i);
source.domainID = 4;
- ASSERT_EQ(E_OK,pDatabaseHandler.enterSinkDB(sink,forgetSink))
- << "ERROR: database error";
- ASSERT_EQ(E_OK,pDatabaseHandler.enterSourceDB(source,forgetSource))
- << "ERROR: database error";
- ASSERT_EQ(E_OK,pDatabaseHandler.enterConnectionDB(connection,forgetConnection))
- << "ERROR: database error";
- ASSERT_EQ(E_OK, pDatabaseHandler.changeConnectionFinal(forgetConnection));
- }
+ connection.sinkID = i;
+ connection.sourceID = i;
+ connection.delay = -1;
+ connection.connectionFormat = CF_ANALOG;
+ connection.connectionID = 0;
- //fill the route
- std::vector<am_RoutingElement_s> routingList;
- pCF.connectionList2RoutingList(routingList, connectionList);
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(sink,forgetSink));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(source,forgetSource));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterConnectionDB(connection,connectionID));
+ ASSERT_EQ(E_OK, pDatabaseHandler.changeConnectionFinal(connectionID));
+ connectionList.push_back(connectionID);
- //create the Route
- am_Route_s route;
- route.route = routingList;
- route.sinkID = 1;
- route.sourceID = 1;
+ }
//create a mainConnection
am_MainConnection_s mainConnection;
am_mainConnectionID_t mainConnectionID;
std::vector<am_MainConnection_s> mainConnectionList;
- pCF.createMainConnection(mainConnection, route);
+ mainConnection.listConnectionID = connectionList;
+ mainConnection.mainConnectionID = 0;
+ mainConnection.sinkID = 1;
+ mainConnection.sourceID = 1;
+ mainConnection.connectionState = CS_CONNECTED;
+ mainConnection.delay = -1;
//enter mainconnection in database
EXPECT_CALL(pMockInterface,cbNumberOfMainConnectionsChanged()).Times(1);
EXPECT_CALL(pMockInterface,cbMainConnectionStateChanged(_,_)).Times(1);
- ASSERT_EQ(E_OK,pDatabaseHandler.enterMainConnectionDB(mainConnection,mainConnectionID))
- << "ERROR: database error";
- ASSERT_NE(0,mainConnectionID)
- << "ERROR: connectionID zero";
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterMainConnectionDB(mainConnection,mainConnectionID));
+ ASSERT_NE(0, mainConnectionID);
//read out the mainconnections and check if they are equal to the data written.
ASSERT_EQ(E_OK, pDatabaseHandler.getListMainConnections(mainConnectionList));
@@ -137,9 +130,9 @@ void databasetest::createMainConnectionSetup()
std::vector<am_MainConnection_s>::iterator listIterator = mainConnectionList.begin();
for (; listIterator < mainConnectionList.end(); ++listIterator)
{
- if (listIterator->connectionID == mainConnectionID)
+ if (listIterator->mainConnectionID == mainConnectionID)
{
- equal = equal && (listIterator->connectionState == mainConnection.connectionState) && (listIterator->route.sinkID == mainConnection.route.sinkID) && (listIterator->route.sourceID == mainConnection.route.sourceID) && (listIterator->delay == mainConnection.delay) && (std::equal(listIterator->route.route.begin(), listIterator->route.route.end(), routingList.begin(), equalRoutingElement));
+ equal = equal && (listIterator->connectionState == mainConnection.connectionState) && (listIterator->sinkID == mainConnection.sinkID) && (listIterator->sourceID == mainConnection.sourceID) && (listIterator->delay == mainConnection.delay) && (std::equal(listIterator->listConnectionID.begin(), listIterator->listConnectionID.end(), connectionList.begin()));
}
}
ASSERT_EQ(true, equal);
@@ -153,6 +146,209 @@ void databasetest::TearDown()
{
}
+TEST_F(databasetest,getMainConnectionInfo)
+{
+ //fill the connection database
+ am_Connection_s connection;
+ am_Source_s source;
+ am_Sink_s sink;
+ std::vector<am_connectionID_t> connectionList;
+
+ //we create 9 sources and sinks:
+ EXPECT_CALL(pMockInterface,cbNumberOfSourcesChanged()).Times(9);
+ EXPECT_CALL(pMockInterface,cbNumberOfSinksChanged()).Times(9);
+
+ for (uint16_t i = 1; i < 10; i++)
+ {
+ am_sinkID_t forgetSink;
+ am_sourceID_t forgetSource;
+ am_connectionID_t connectionID;
+
+ pCF.createSink(sink);
+ sink.sinkID = i;
+ sink.name = "sink" + int2string(i);
+ sink.domainID = 4;
+ pCF.createSource(source);
+ source.sourceID = i;
+ source.name = "source" + int2string(i);
+ source.domainID = 4;
+
+ connection.sinkID = i;
+ connection.sourceID = i;
+ connection.delay = -1;
+ connection.connectionFormat = CF_ANALOG;
+ connection.connectionID = 0;
+
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(sink,forgetSink));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(source,forgetSource));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterConnectionDB(connection,connectionID));
+ ASSERT_EQ(E_OK, pDatabaseHandler.changeConnectionFinal(connectionID));
+ connectionList.push_back(connectionID);
+
+ }
+
+ //create a mainConnection
+ am_MainConnection_s mainConnection;
+ am_mainConnectionID_t mainConnectionID;
+ std::vector<am_MainConnection_s> mainConnectionList;
+ mainConnection.listConnectionID = connectionList;
+ mainConnection.mainConnectionID = 0;
+ mainConnection.sinkID = 1;
+ mainConnection.sourceID = 1;
+ mainConnection.connectionState = CS_CONNECTED;
+ mainConnection.delay = -1;
+
+ //enter mainconnection in database
+ EXPECT_CALL(pMockInterface,cbNumberOfMainConnectionsChanged()).Times(1);
+ EXPECT_CALL(pMockInterface,cbMainConnectionStateChanged(_,_)).Times(1);
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterMainConnectionDB(mainConnection,mainConnectionID));
+ ASSERT_NE(0, mainConnectionID);
+
+ //read out the mainconnections and check if they are equal to the data written.
+ ASSERT_EQ(E_OK, pDatabaseHandler.getListMainConnections(mainConnectionList));
+ bool equal = true;
+ std::vector<am_MainConnection_s>::iterator listIterator = mainConnectionList.begin();
+ for (; listIterator < mainConnectionList.end(); ++listIterator)
+ {
+ if (listIterator->mainConnectionID == mainConnectionID)
+ {
+ equal = equal && (listIterator->connectionState == mainConnection.connectionState) && (listIterator->sinkID == mainConnection.sinkID) && (listIterator->sourceID == mainConnection.sourceID) && (listIterator->delay == mainConnection.delay) && (std::equal(listIterator->listConnectionID.begin(), listIterator->listConnectionID.end(), connectionList.begin()));
+ }
+ }ASSERT_EQ(true, equal);
+
+ am_MainConnection_s mainConnectionT;
+ ASSERT_EQ(E_OK, pDatabaseHandler.getMainConnectionInfoDB(mainConnectionID,mainConnectionT));
+ ASSERT_TRUE( (mainConnection.connectionState==mainConnectionT.connectionState) && (mainConnection.delay==mainConnectionT.delay) && (std::equal(mainConnection.listConnectionID.begin(),mainConnection.listConnectionID.end(),mainConnectionT.listConnectionID.begin())) && (mainConnection.sinkID==mainConnectionT.sinkID) && (mainConnection.sourceID==mainConnectionT.sourceID) && (mainConnectionID==mainConnectionT.mainConnectionID));
+
+}
+
+TEST_F(databasetest,getSinKInfo)
+{
+ //fill the connection database
+ am_Sink_s staticSink, firstDynamicSink, secondDynamicSink;
+ am_sinkID_t staticSinkID, firstDynamicSinkID, secondDynamicSinkID;
+ std::vector<am_Sink_s> sinkList;
+
+ pCF.createSink(staticSink);
+ staticSink.sinkID = 4;
+
+ EXPECT_CALL(pMockInterface,cbNumberOfSinksChanged()).Times(3);
+ ASSERT_EQ(E_OK,pDatabaseHandler.enterSinkDB(staticSink,staticSinkID))
+ << "ERROR: database error";
+ ASSERT_EQ(staticSink.sinkID,staticSinkID)
+ << "ERROR: ID not the one given in staticSink";
+
+ pCF.createSink(firstDynamicSink);
+ firstDynamicSink.name = "firstdynamic";
+ ASSERT_EQ(E_OK,pDatabaseHandler.enterSinkDB(firstDynamicSink,firstDynamicSinkID))
+ << "ERROR: database error";
+ ASSERT_EQ(firstDynamicSinkID,DYNAMIC_ID_BOUNDARY)
+ << "ERROR: ID not the one given in firstDynamicSink";
+
+ pCF.createSink(secondDynamicSink);
+ secondDynamicSink.name = "seconddynamic";
+
+ ASSERT_EQ(E_OK,pDatabaseHandler.enterSinkDB(secondDynamicSink,secondDynamicSinkID))
+ << "ERROR: database error";
+ ASSERT_NEAR(secondDynamicSinkID,DYNAMIC_ID_BOUNDARY,10)
+ << "ERROR: ID not the one given in secondDynamicSink";
+
+ //now read back and check the returns agains the given values
+ ASSERT_EQ(E_OK,pDatabaseHandler.getListSinks(sinkList))
+ << "ERROR: database error";
+ bool equal = true;
+
+ std::vector<am_Sink_s>::iterator listIterator = sinkList.begin();
+ for (; listIterator < sinkList.end(); ++listIterator)
+ {
+ if (listIterator->sinkID == staticSinkID)
+ {
+ equal = equal && pCF.compareSink(listIterator, staticSink);
+ }
+
+ if (listIterator->sinkID == firstDynamicSinkID)
+ {
+ equal = equal && pCF.compareSink(listIterator, firstDynamicSink);
+ }
+
+ if (listIterator->sinkID == secondDynamicSinkID)
+ {
+ equal = equal && pCF.compareSink(listIterator, secondDynamicSink);
+ }
+ }ASSERT_EQ(true, equal);
+
+ 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));
+
+}
+
+TEST_F(databasetest,getSourceInfo)
+{
+ //fill the connection database
+ am_Source_s staticSource, firstDynamicSource, secondDynamicSource;
+ am_sourceID_t staticSourceID, firstDynamicSourceID, secondDynamicSourceID;
+ std::vector<am_Source_s> sourceList;
+
+ pCF.createSource(staticSource);
+ staticSource.sourceID = 4;
+ staticSource.name = "Static";
+
+ EXPECT_CALL(pMockInterface,cbNumberOfSourcesChanged()).Times(3);
+ ASSERT_EQ(E_OK,pDatabaseHandler.enterSourceDB(staticSource,staticSourceID))
+ << "ERROR: database error";
+ ASSERT_EQ(staticSource.sourceID,staticSourceID)
+ << "ERROR: ID not the one given in staticSource";
+
+ pCF.createSource(firstDynamicSource);
+ firstDynamicSource.name = "firstDynamicSource";
+
+ ASSERT_EQ(E_OK,pDatabaseHandler.enterSourceDB(firstDynamicSource,firstDynamicSourceID))
+ << "ERROR: database error";
+ ASSERT_EQ(firstDynamicSourceID,DYNAMIC_ID_BOUNDARY)
+ << "ERROR: ID not the one given in firstDynamicSink";
+
+ pCF.createSource(secondDynamicSource);
+ secondDynamicSource.name = "secondDynamicSource";
+
+ ASSERT_EQ(E_OK,pDatabaseHandler.enterSourceDB(secondDynamicSource,secondDynamicSourceID))
+ << "ERROR: database error";
+ ASSERT_NEAR(secondDynamicSourceID,DYNAMIC_ID_BOUNDARY,10)
+ << "ERROR: ID not the one given in secondDynamicSink";
+
+ //now read back and check the returns agains the given values
+ ASSERT_EQ(E_OK,pDatabaseHandler.getListSources(sourceList))
+ << "ERROR: database error";
+ bool equal = true;
+
+ std::vector<am_Source_s>::iterator listIterator = sourceList.begin();
+ for (; listIterator < sourceList.end(); ++listIterator)
+ {
+ if (listIterator->sourceID == staticSourceID)
+ {
+ equal = equal && pCF.compareSource(listIterator, staticSource);
+ }
+
+ if (listIterator->sourceID == firstDynamicSourceID)
+ {
+ equal = equal && pCF.compareSource(listIterator, firstDynamicSource);
+ }
+
+ if (listIterator->sourceID == secondDynamicSourceID)
+ {
+ equal = equal && pCF.compareSource(listIterator, secondDynamicSource);
+ }
+ pCF.compareSource(listIterator, secondDynamicSource);
+
+ }ASSERT_EQ(true, equal);
+
+ 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));
+
+}
+
TEST_F(databasetest, peekSourceID)
{
EXPECT_CALL(pMockInterface,cbNumberOfSourceClassesChanged()).Times(1);
@@ -260,9 +456,9 @@ TEST_F(databasetest,crossfadersGetFromDomain)
sinkB.name = "sinkB";
pCF.createSource(source);
ASSERT_EQ(E_OK, pDatabaseHandler.enterDomainDB(domain,domainID));
- source.domainID=domainID;
- sinkA.domainID=domainID;
- sinkB.domainID=domainID;
+ source.domainID = domainID;
+ sinkA.domainID = domainID;
+ sinkB.domainID = domainID;
ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(source,sourceID));
ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(sinkA,sinkAID));
@@ -279,7 +475,7 @@ TEST_F(databasetest,crossfadersGetFromDomain)
std::vector<am_crossfaderID_t> listCrossfaders;
ASSERT_EQ(E_OK, pDatabaseHandler.enterCrossfaderDB(crossfader,crossfaderID));
- ASSERT_EQ(E_OK,pDatabaseHandler.getListCrossfadersOfDomain(source.domainID,listCrossfaders));
+ ASSERT_EQ(E_OK, pDatabaseHandler.getListCrossfadersOfDomain(source.domainID,listCrossfaders));
ASSERT_EQ(100, listCrossfaders[0]);
}
@@ -466,10 +662,8 @@ TEST_F(databasetest, peekSinkDouble)
TEST_F(databasetest,changeConnectionTimingInformationCheckMainConnection)
{
- am_Connection_s connection;
std::vector<am_Connection_s> connectionList;
std::vector<am_MainConnectionType_s> mainList;
- pCF.createConnection(connection);
//prepare the test, it is one mainconnection, so we expect one callback
createMainConnectionSetup();
@@ -1013,8 +1207,8 @@ TEST_F(databasetest, changeMainConnectionState)
std::vector<am_MainConnection_s> listMainConnections;
createMainConnectionSetup();
EXPECT_CALL(pMockInterface,cbMainConnectionStateChanged(_,_)).Times(1);
- ASSERT_EQ(E_OK,pDatabaseHandler.changeMainConnectionStateDB(1,CS_DISCONNECTING))
- << "ERROR: database error";ASSERT_EQ(E_OK, pDatabaseHandler.getListMainConnections(listMainConnections));
+ ASSERT_EQ(E_OK, pDatabaseHandler.changeMainConnectionStateDB(1,CS_DISCONNECTING));
+ ASSERT_EQ(E_OK, pDatabaseHandler.getListMainConnections(listMainConnections));
ASSERT_EQ(CS_DISCONNECTING, listMainConnections[0].connectionState);
}
@@ -1064,7 +1258,7 @@ TEST_F(databasetest,changeMainConnectionRoute)
am_Connection_s connection;
am_Source_s source;
am_Sink_s sink;
- std::vector<am_Connection_s> connectionList;
+ std::vector<am_connectionID_t> listConnectionID;
EXPECT_CALL(pMockInterface,cbNumberOfSourcesChanged()).Times(9);
EXPECT_CALL(pMockInterface,cbNumberOfSinksChanged()).Times(9);
@@ -1072,13 +1266,13 @@ TEST_F(databasetest,changeMainConnectionRoute)
{
am_sinkID_t forgetSink;
am_sourceID_t forgetSource;
- am_connectionID_t forgetConnection;
+ am_connectionID_t connectionID;
- pCF.createConnection(connection);
connection.sinkID = i + 20;
connection.sourceID = i + 20;
connection.delay = -1;
- connectionList.push_back(connection);
+ connection.connectionFormat = CF_ANALOG;
+ connection.connectionID = 0;
pCF.createSink(sink);
sink.sinkID = i + 20;
@@ -1089,31 +1283,17 @@ TEST_F(databasetest,changeMainConnectionRoute)
source.name = "source" + int2string(i + 30);
source.domainID = 4;
- ASSERT_EQ(E_OK,pDatabaseHandler.enterSinkDB(sink,forgetSink))
- << "ERROR: database error";
- ASSERT_EQ(E_OK,pDatabaseHandler.enterSourceDB(source,forgetSource))
- << "ERROR: database error";
- ASSERT_EQ(E_OK,pDatabaseHandler.enterConnectionDB(connection,forgetConnection))
- << "ERROR: database error";
- ASSERT_EQ(E_OK,pDatabaseHandler.getListMainConnections(originalList))
- << "ERROR: database error";
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(sink,forgetSink));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(source,forgetSource));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterConnectionDB(connection,connectionID));
+ listConnectionID.push_back(connectionID);
+ ASSERT_EQ(E_OK, pDatabaseHandler.getListMainConnections(originalList));
}
- //fill the route
- std::vector<am_RoutingElement_s> routingList;
- pCF.connectionList2RoutingList(routingList, connectionList);
-
- //create the Route
- am_Route_s route;
- route.route = routingList;
- route.sinkID = 2;
- route.sourceID = 2;
-
- ASSERT_EQ(E_OK, pDatabaseHandler.changeMainConnectionRouteDB(1,route));
- ASSERT_EQ(E_OK,pDatabaseHandler.getListMainConnections(newList))
- << "ERROR: database error";ASSERT_TRUE(std::equal(newList[0].route.route.begin(),newList[0].route.route.end(),routingList.begin(),equalRoutingElement));
- ASSERT_FALSE(std::equal(newList[0].route.route.begin(),newList[0].route.route.end(),originalList[0].route.route.begin(),equalRoutingElement));
+ ASSERT_EQ(E_OK, pDatabaseHandler.changeMainConnectionRouteDB(1,listConnectionID));
+ ASSERT_EQ(E_OK, pDatabaseHandler.getListMainConnections(newList));
+ ASSERT_FALSE(std::equal(newList[0].listConnectionID.begin(),newList[0].listConnectionID.end(),originalList[0].listConnectionID.begin()));
}
TEST_F(databasetest,changeMainSinkVolume)
@@ -1227,16 +1407,15 @@ TEST_F(databasetest,getMainSinks)
TEST_F(databasetest,getVisibleMainConnections)
{
createMainConnectionSetup();
- am_MainConnection_s mainConnection;
- am_Route_s route;
- pCF.createMainConnection(mainConnection, route);
- std::vector<am_MainConnectionType_s> visibleMainConnection;
- ASSERT_EQ(E_OK, pDatabaseHandler.getListVisibleMainConnections(visibleMainConnection));
- ASSERT_TRUE(1==visibleMainConnection[0].mainConnectionID);
- ASSERT_TRUE(mainConnection.connectionState==visibleMainConnection[0].connectionState);
- ASSERT_TRUE(mainConnection.delay==visibleMainConnection[0].delay);
- ASSERT_TRUE(1==visibleMainConnection[0].sinkID);
- ASSERT_TRUE(1==visibleMainConnection[0].sourceID);
+ std::vector<am_MainConnectionType_s> listVisibleMainConnections;
+ std::vector<am_MainConnection_s> listMainConnections;
+ ASSERT_EQ(E_OK, pDatabaseHandler.getListVisibleMainConnections(listVisibleMainConnections));
+ ASSERT_EQ(E_OK, pDatabaseHandler.getListMainConnections(listMainConnections));
+ ASSERT_EQ(listMainConnections[0].mainConnectionID, listVisibleMainConnections[0].mainConnectionID);
+ ASSERT_EQ(listMainConnections[0].connectionState, listVisibleMainConnections[0].connectionState);
+ ASSERT_EQ(listMainConnections[0].delay, listVisibleMainConnections[0].delay);
+ ASSERT_EQ(listMainConnections[0].sinkID, listVisibleMainConnections[0].sinkID);
+ ASSERT_EQ(listMainConnections[0].sourceID, listVisibleMainConnections[0].sourceID);
}
TEST_F(databasetest,getListSourcesOfDomain)
diff --git a/CHANGELOG b/CHANGELOG
index bfc4fdb..154a849 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,9 @@
+commit e124310a45e6e7798a077fa44ef3ee518193b2cf
+Author: christian mueller <christian.ei.mueller@bmw.de>
+
+ * modify RoutingSender Async to match with TestHMI
+ * modify ControlSenderPlugin to have dummy behaviour
+
commit 2ddacca29eccd4192add2b17ad6af357b52ea29b
Author: Frank Herchet <frank.fh.herchet@bmw.de>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fa32b52..464ba4f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -57,7 +57,7 @@ OPTION( WITH_PPOLL
"libc supports ppoll" ON)
OPTION( WITH_TELNET
- "build with Telnetserver" ON)
+ "build with Telnetserver (can only work with SocketHandler)" ON)
OPTION ( USE_BUILD_LIBS
"build with default library path = build path" ON)
diff --git a/PluginCommandInterfaceDbus/src/DBusCommandSender.cpp b/PluginCommandInterfaceDbus/src/DBusCommandSender.cpp
index 460382f..ec53a82 100644
--- a/PluginCommandInterfaceDbus/src/DBusCommandSender.cpp
+++ b/PluginCommandInterfaceDbus/src/DBusCommandSender.cpp
@@ -80,6 +80,7 @@ am_Error_e DbusCommandSender::startupInterface(CommandReceiveInterface* commandr
assert(mDBusWrapper!=NULL);
DBusConnection * connection;
mDBusWrapper->getDBusConnection(connection);
+ assert(connection!=NULL);
mDBUSMessageHandler.setDBusConnection(connection);
return (E_OK);
}
diff --git a/PluginControlInterface/include/ControlSender.h b/PluginControlInterface/include/ControlSender.h
index bd8d88f..ace61a6 100644
--- a/PluginControlInterface/include/ControlSender.h
+++ b/PluginControlInterface/include/ControlSender.h
@@ -94,6 +94,20 @@ private:
std::vector<handleStatus> listHandleStaus;
};
+ struct mainVolumeSet
+ {
+ am_sinkID_t sinkID;
+ am_Handle_s handle;
+ am_mainVolume_t mainVolume;
+ };
+
+ struct mainSinkSoundPropertySet
+ {
+ am_sinkID_t sinkID;
+ am_Handle_s handle;
+ am_MainSoundProperty_s mainSoundProperty;
+ };
+
class findHandle
{
handleStatus mHandle;
@@ -132,13 +146,16 @@ private:
}
bool operator()(const am_MainConnection_s& mainConnection)
{
- if (mMainConnection.connectionID == mainConnection.connectionID)
+ if (mMainConnection.mainConnectionID == mainConnection.mainConnectionID)
return true;
return false;
}
};
std::vector<mainConnectionSet> mListOpenConnections;
+ std::vector<mainConnectionSet> mListOpenDisconnections;
+ std::vector<mainVolumeSet> mListOpenVolumeChanges;
+ std::vector<mainSinkSoundPropertySet> mListMainSoundPropertyChanges;
};
#endif /* CONTROLSENDER_H_ */
diff --git a/PluginControlInterface/src/ControlSender.cpp b/PluginControlInterface/src/ControlSender.cpp
index 4592459..9df8232 100644
--- a/PluginControlInterface/src/ControlSender.cpp
+++ b/PluginControlInterface/src/ControlSender.cpp
@@ -41,7 +41,10 @@ extern "C" void destroyControlPluginInterface(ControlSendInterface* controlSendI
}
ControlSenderPlugin::ControlSenderPlugin() :
- mControlReceiveInterface(NULL), mListOpenConnections()
+ mControlReceiveInterface(NULL), //
+ mListOpenConnections(), //
+ mListOpenDisconnections(), //
+ mListOpenVolumeChanges()
{
}
@@ -72,8 +75,8 @@ void ControlSenderPlugin::hookAllPluginsLoaded()
am_Error_e ControlSenderPlugin::hookUserConnectionRequest(const am_sourceID_t sourceID, const am_sinkID_t sinkID, am_mainConnectionID_t & mainConnectionID)
{
std::vector<am_Route_s> listRoutes;
+ std::vector<am_connectionID_t> listConnectionIDs;
am_Handle_s handle;
- am_connectionID_t connectionID;
mControlReceiveInterface->getRoute(true, sourceID, sinkID, listRoutes);
if (listRoutes.empty())
return E_NOT_POSSIBLE;
@@ -82,17 +85,19 @@ am_Error_e ControlSenderPlugin::hookUserConnectionRequest(const am_sourceID_t so
std::vector<am_RoutingElement_s>::iterator it(listRoutes[0].route.begin());
for (; it != listRoutes[0].route.end(); ++it)
{
+ am_connectionID_t connectionID;
mControlReceiveInterface->connect(handle, connectionID, it->connectionFormat, it->sourceID, it->sinkID);
handleStatus status;
status.handle = handle;
status.status = false;
listHandleStaus.push_back(status);
+ listConnectionIDs.push_back(connectionID);
}
am_MainConnection_s mainConnectionData;
- mainConnectionData.connectionID = 0;
+ mainConnectionData.mainConnectionID = 0;
mainConnectionData.connectionState = CS_CONNECTING;
mainConnectionData.delay = 0;
- mainConnectionData.route = listRoutes[0];
+ mainConnectionData.listConnectionID = listConnectionIDs;
mControlReceiveInterface->enterMainConnectionDB(mainConnectionData, mainConnectionID);
mainConnectionSet set;
set.connectionID = mainConnectionID;
@@ -103,27 +108,48 @@ am_Error_e ControlSenderPlugin::hookUserConnectionRequest(const am_sourceID_t so
am_Error_e ControlSenderPlugin::hookUserDisconnectionRequest(const am_mainConnectionID_t connectionID)
{
-// //first check if there is a connectionID like that
-// std::vector<am_MainConnection_s> listMainConnections;
-// mControlReceiveInterface->getListMainConnections(listMainConnections);
-// std::vector<am_MainConnection_s>::iterator it(listMainConnections.begin());
-// am_MainConnection_s mainConnection;
-// mainConnection=connectionID;
-// if(listMainConnections.end()==(it=std::find(listMainConnections.begin(),listMainConnections.end(),checkMainConnectionID(mainConnection))))
-// return E_NON_EXISTENT;
-//
-// std::vector<am_RoutingElement_s>::iterator routeIterator(it->route.route.begin());
-// for(;routeIterator!=it->route.route.end();++routeIterator)
-// {
-// mControlReceiveInterface->disconnect(handle,routeIterator->)
-// }
+ //first check if there is a connectionID like that
+ am_MainConnection_s mainConnection;
+ am_Error_e error;
+ if ((error = mControlReceiveInterface->getMainConnectionInfoDB(connectionID, mainConnection)) != E_OK)
+ {
+ return error;
+ }
+
+ std::vector<am_connectionID_t>::iterator it(mainConnection.listConnectionID.begin());
+ std::vector<handleStatus> listHandleStaus;
+ for (; it != mainConnection.listConnectionID.end(); ++it)
+ {
+ handleStatus status;
+ status.status = false;
+ mControlReceiveInterface->disconnect(status.handle, *it);
+ listHandleStaus.push_back(status);
+ }
+ mainConnectionSet set;
+ set.connectionID = connectionID;
+ set.listHandleStaus = listHandleStaus;
+ mListOpenConnections.push_back(set);
+ return E_OK;
}
am_Error_e ControlSenderPlugin::hookUserSetMainSinkSoundProperty(const am_sinkID_t sinkID, const am_MainSoundProperty_s & soundProperty)
{
- (void) sinkID;
- (void) soundProperty;
- return E_NOT_USED;
+ if (sinkID==0) return E_NON_EXISTENT;
+
+ mainSinkSoundPropertySet set;
+ set.sinkID = sinkID;
+ set.mainSoundProperty = soundProperty;
+ am_SoundProperty_s sp;
+ //I know this is bad - just for the reference, ok?
+ sp.type = static_cast<am_SoundPropertyType_e>(soundProperty.type);
+ sp.value = soundProperty.value;
+ am_Error_e error;
+ if ((error = mControlReceiveInterface->setSinkSoundProperty(set.handle, sinkID, sp)) != E_OK)
+ {
+ return error;
+ }
+ mListMainSoundPropertyChanges.push_back(set);
+ return E_OK;
}
am_Error_e ControlSenderPlugin::hookUserSetMainSourceSoundProperty(const am_sourceID_t sourceID, const am_MainSoundProperty_s & soundProperty)
@@ -141,16 +167,34 @@ am_Error_e ControlSenderPlugin::hookUserSetSystemProperty(const am_SystemPropert
am_Error_e ControlSenderPlugin::hookUserVolumeChange(const am_sinkID_t SinkID, const am_mainVolume_t newVolume)
{
- (void) SinkID;
- (void) newVolume;
- return E_NOT_USED;
+ assert(SinkID!=0);
+ mainVolumeSet set;
+ set.sinkID = SinkID;
+ set.mainVolume = newVolume;
+ am_Error_e error;
+ if ((error = mControlReceiveInterface->setSinkVolume(set.handle, SinkID, newVolume, RAMP_DIRECT, 20)) != E_OK)
+ {
+ return error;
+ }
+ mListOpenVolumeChanges.push_back(set);
+ return E_OK;
}
am_Error_e ControlSenderPlugin::hookUserVolumeStep(const am_sinkID_t SinkID, const int16_t increment)
{
- (void) SinkID;
- (void) increment;
- return E_NOT_USED;
+ assert(SinkID!=0);
+ mainVolumeSet set;
+ set.sinkID = SinkID;
+ am_Error_e error;
+ am_Sink_s sink;
+ mControlReceiveInterface->getSinkInfoDB(SinkID, sink);
+ set.mainVolume = sink.volume + increment;
+ if ((error = mControlReceiveInterface->setSinkVolume(set.handle, SinkID, set.mainVolume, RAMP_DIRECT, 20)) != E_OK)
+ {
+ return error;
+ }
+ mListOpenVolumeChanges.push_back(set);
+ return E_OK;
}
am_Error_e ControlSenderPlugin::hookUserSetSinkMuteState(const am_sinkID_t sinkID, const am_MuteState_e muteState)
@@ -288,13 +332,13 @@ void ControlSenderPlugin::cbAckConnect(const am_Handle_s handle, const am_Error_
{
std::vector<handleStatus>::iterator hit;
handleStatus status;
- status.status=true;
- status.handle=handle;
+ status.status = true;
+ status.handle = handle;
hit = std::find_if(it->listHandleStaus.begin(), it->listHandleStaus.end(), findHandle(status));
if (hit == it->listHandleStaus.end())
continue;
- hit->status=true;
- if (it->listHandleStaus.end()==std::find_if(it->listHandleStaus.begin(),it->listHandleStaus.end(),checkHandle(status)))
+ hit->status = true;
+ if (it->listHandleStaus.end() == std::find_if(it->listHandleStaus.begin(), it->listHandleStaus.end(), checkHandle(status)))
{
mControlReceiveInterface->changeMainConnectionStateDB(it->connectionID, CS_CONNECTED);
mListOpenConnections.erase(it);
@@ -305,8 +349,26 @@ void ControlSenderPlugin::cbAckConnect(const am_Handle_s handle, const am_Error_
void ControlSenderPlugin::cbAckDisconnect(const am_Handle_s handle, const am_Error_e errorID)
{
- (void) handle;
(void) errorID;
+ //\todo:error checking
+ std::vector<mainConnectionSet>::iterator it(mListOpenDisconnections.begin());
+ for (; it != mListOpenDisconnections.end(); ++it)
+ {
+ std::vector<handleStatus>::iterator hit;
+ handleStatus status;
+ status.status = true;
+ status.handle = handle;
+ hit = std::find_if(it->listHandleStaus.begin(), it->listHandleStaus.end(), findHandle(status));
+ if (hit == it->listHandleStaus.end())
+ continue;
+ hit->status = true;
+ if (it->listHandleStaus.end() == std::find_if(it->listHandleStaus.begin(), it->listHandleStaus.end(), checkHandle(status)))
+ {
+ mControlReceiveInterface->removeMainConnectionDB(it->connectionID);
+ mListOpenDisconnections.erase(it);
+ break;
+ }
+ }
}
void ControlSenderPlugin::cbAckCrossFade(const am_Handle_s handle, const am_HotSink_e hostsink, const am_Error_e error)
@@ -320,7 +382,15 @@ void ControlSenderPlugin::cbAckSetSinkVolumeChange(const am_Handle_s handle, con
{
(void) error;
(void) volume;
- (void) handle;
+ //\todo:error checking
+ std::vector<mainVolumeSet>::iterator it(mListOpenVolumeChanges.begin());
+ for (; it != mListOpenVolumeChanges.end(); ++it)
+ {
+ if (handle.handle == it->handle.handle)
+ {
+ mControlReceiveInterface->changeSinkMainVolumeDB(it->mainVolume, it->sinkID);
+ }
+ }
}
void ControlSenderPlugin::cbAckSetSourceVolumeChange(const am_Handle_s handle, const am_volume_t voulme, const am_Error_e error)
@@ -345,7 +415,15 @@ void ControlSenderPlugin::cbAckSetSourceSoundProperty(const am_Handle_s handle,
void ControlSenderPlugin::cbAckSetSinkSoundProperty(const am_Handle_s handle, const am_Error_e error)
{
(void) error;
- (void) handle;
+ //\todo:error checking
+ std::vector<mainSinkSoundPropertySet>::iterator it(mListMainSoundPropertyChanges.begin());
+ for (; it != mListMainSoundPropertyChanges.end(); ++it)
+ {
+ if (handle.handle == it->handle.handle)
+ {
+ mControlReceiveInterface->changeMainSinkSoundPropertyDB(it->mainSoundProperty, it->sinkID);
+ }
+ }
}
void ControlSenderPlugin::cbAckSetSourceSoundProperties(const am_Handle_s handle, const am_Error_e error)
diff --git a/includes/audiomanagertypes.h b/includes/audiomanagertypes.h
index 6c39ad8..e0a6c21 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_C4520781_52CF_4636_BE82_37A28F483C93__INCLUDED_)
-#define EA_C4520781_52CF_4636_BE82_37A28F483C93__INCLUDED_
+#if !defined(EA_2D7F1C82_8717_47ce_B755_51DDED15BC18__INCLUDED_)
+#define EA_2D7F1C82_8717_47ce_B755_51DDED15BC18__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 26-Jan-2012 6:00:48 PM
+ * @created 10-Feb-2012 1:31:00 PM
*/
typedef uint16_t am_domainID_t;
/**
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:48 PM
+ * @created 10-Feb-2012 1:31:00 PM
*/
typedef uint16_t am_sourceID_t;
/**
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:48 PM
+ * @created 10-Feb-2012 1:31:00 PM
*/
typedef uint16_t am_sinkID_t;
/**
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:48 PM
+ * @created 10-Feb-2012 1:31:00 PM
*/
typedef uint16_t am_gatewayID_t;
/**
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:48 PM
+ * @created 10-Feb-2012 1:31:00 PM
*/
typedef uint16_t am_crossfaderID_t;
/**
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:48 PM
+ * @created 10-Feb-2012 1:31:00 PM
*/
typedef uint16_t am_connectionID_t;
/**
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:48 PM
+ * @created 10-Feb-2012 1:31:00 PM
*/
typedef uint16_t am_mainConnectionID_t;
/**
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:48 PM
+ * @created 10-Feb-2012 1:31:01 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 26-Jan-2012 6:00:48 PM
+ * @created 10-Feb-2012 1:31:01 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 26-Jan-2012 6:00:48 PM
+ * @created 10-Feb-2012 1:31:01 PM
*/
typedef int16_t am_mainVolume_t;
/**
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:48 PM
+ * @created 10-Feb-2012 1:31:01 PM
*/
typedef uint16_t am_sourceClass_t;
/**
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:48 PM
+ * @created 10-Feb-2012 1:31:01 PM
*/
typedef uint16_t am_sinkClass_t;
@@ -212,7 +212,7 @@ namespace am {
* time in ms!
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:48 PM
+ * @created 10-Feb-2012 1:31:01 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 26-Jan-2012 6:00:48 PM
+ * @created 10-Feb-2012 1:31:01 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 26-Jan-2012 6:00:48 PM
+ * @created 10-Feb-2012 1:31:01 PM
*/
enum am_Availablility_e
{
@@ -243,7 +243,7 @@ namespace am {
* represents the connection state
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:48 PM
+ * @created 10-Feb-2012 1:31:01 PM
*/
enum am_ConnectionState_e
{
@@ -274,7 +274,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:48 PM
+ * @created 10-Feb-2012 1:31:01 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 26-Jan-2012 6:00:48 PM
+ * @created 10-Feb-2012 1:31:01 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 26-Jan-2012 6:00:48 PM
+ * @created 10-Feb-2012 1:31:01 PM
*/
enum am_Error_e
{
@@ -330,7 +330,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:48 PM
+ * @created 10-Feb-2012 1:31:01 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 26-Jan-2012 6:00:48 PM
+ * @created 10-Feb-2012 1:31:01 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 26-Jan-2012 6:00:48 PM
+ * @created 10-Feb-2012 1:31:01 PM
*/
enum am_Handle_e
{
@@ -389,7 +389,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:48 PM
+ * @created 10-Feb-2012 1:31:01 PM
*/
enum am_InterruptState_e
{
@@ -403,7 +403,7 @@ namespace am {
* describes the active sink of a crossfader.
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:49 PM
+ * @created 10-Feb-2012 1:31:01 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 26-Jan-2012 6:00:49 PM
+ * @created 10-Feb-2012 1:31:01 PM
*/
struct am_Availability_s
{
@@ -438,7 +438,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:49 PM
+ * @created 10-Feb-2012 1:31:01 PM
*/
struct am_ClassProperty_s
{
@@ -452,7 +452,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:49 PM
+ * @created 10-Feb-2012 1:31:01 PM
*/
struct am_Crossfader_s
{
@@ -470,7 +470,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:49 PM
+ * @created 10-Feb-2012 1:31:01 PM
*/
struct am_Gateway_s
{
@@ -511,7 +511,7 @@ namespace am {
* This represents one "hopp" in a route
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:49 PM
+ * @created 10-Feb-2012 1:31:01 PM
*/
struct am_RoutingElement_s
{
@@ -527,7 +527,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:49 PM
+ * @created 10-Feb-2012 1:31:02 PM
*/
struct am_Route_s
{
@@ -542,7 +542,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:49 PM
+ * @created 10-Feb-2012 1:31:02 PM
*/
struct am_SoundProperty_s
{
@@ -556,7 +556,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:49 PM
+ * @created 10-Feb-2012 1:31:02 PM
*/
struct am_SystemProperty_s
{
@@ -576,7 +576,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:50 PM
+ * @created 10-Feb-2012 1:31:02 PM
*/
struct am_SinkClass_s
{
@@ -591,7 +591,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:50 PM
+ * @created 10-Feb-2012 1:31:02 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 26-Jan-2012 6:00:50 PM
+ * @created 10-Feb-2012 1:31:02 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 26-Jan-2012 6:00:50 PM
+ * @created 10-Feb-2012 1:31:02 PM
*/
struct am_SinkType_s
{
@@ -645,7 +645,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:50 PM
+ * @created 10-Feb-2012 1:31:03 PM
*/
struct am_Handle_s
{
@@ -659,7 +659,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:50 PM
+ * @created 10-Feb-2012 1:31:03 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 26-Jan-2012 6:00:50 PM
+ * @created 10-Feb-2012 1:31:03 PM
*/
struct am_MainConnectionType_s
{
@@ -691,23 +691,31 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:50 PM
+ * @created 10-Feb-2012 1:31:03 PM
*/
struct am_MainConnection_s
{
public:
- am_mainConnectionID_t connectionID;
+ am_mainConnectionID_t mainConnectionID;
am_ConnectionState_e connectionState;
- am_Route_s route;
+ /**
+ * the sinkID
+ */
+ am_sinkID_t sinkID;
+ /**
+ * the sourceID
+ */
+ am_sourceID_t sourceID;
am_timeSync_t delay;
+ std::vector<am_connectionID_t> listConnectionID;
};
/**
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:51 PM
+ * @created 10-Feb-2012 1:31:03 PM
*/
struct am_Sink_s
{
@@ -731,7 +739,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:51 PM
+ * @created 10-Feb-2012 1:31:03 PM
*/
struct am_Source_s
{
@@ -764,7 +772,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:51 PM
+ * @created 10-Feb-2012 1:31:03 PM
*/
struct am_Domain_s
{
@@ -783,7 +791,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:51 PM
+ * @created 10-Feb-2012 1:31:04 PM
*/
struct am_Connection_s
{
@@ -803,7 +811,7 @@ namespace am {
* soundProperty_t in case of ED_SOURCE_PROPERTY, ED_SINK_PROPERTY
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:51 PM
+ * @created 10-Feb-2012 1:31:04 PM
*/
union am_EarlyData_u
{
@@ -820,7 +828,7 @@ namespace am {
* sinkID in case of ED_SINK_VOLUME, ED_SINK_PROPERTY
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:51 PM
+ * @created 10-Feb-2012 1:31:04 PM
*/
union am_DataType_u
{
@@ -834,7 +842,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:51 PM
+ * @created 10-Feb-2012 1:31:04 PM
*/
struct am_EarlyData_s
{
@@ -846,4 +854,4 @@ namespace am {
};
}
-#endif // !defined(EA_C4520781_52CF_4636_BE82_37A28F483C93__INCLUDED_)
+#endif // !defined(EA_2D7F1C82_8717_47ce_B755_51DDED15BC18__INCLUDED_)
diff --git a/includes/command/CommandReceiveInterface.h b/includes/command/CommandReceiveInterface.h
index 20e4455..257d5d9 100644
--- a/includes/command/CommandReceiveInterface.h
+++ b/includes/command/CommandReceiveInterface.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_6FE1E594_3CEA_4eaa_BAD0_7BB39D3150D2__INCLUDED_)
-#define EA_6FE1E594_3CEA_4eaa_BAD0_7BB39D3150D2__INCLUDED_
+#if !defined(EA_C6A85AF3_95A7_4c37_90ED_CA847BA7F31D__INCLUDED_)
+#define EA_C6A85AF3_95A7_4c37_90ED_CA847BA7F31D__INCLUDED_
#include <vector>
#include <string>
@@ -40,7 +40,7 @@ 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 26-Jan-2012 6:00:52 PM
+ * @created 10-Feb-2012 1:31:04 PM
*/
class CommandReceiveInterface
{
@@ -204,4 +204,4 @@ namespace am {
};
}
-#endif // !defined(EA_6FE1E594_3CEA_4eaa_BAD0_7BB39D3150D2__INCLUDED_)
+#endif // !defined(EA_C6A85AF3_95A7_4c37_90ED_CA847BA7F31D__INCLUDED_)
diff --git a/includes/command/CommandSendInterface.h b/includes/command/CommandSendInterface.h
index f1ec602..bd970d0 100644
--- a/includes/command/CommandSendInterface.h
+++ b/includes/command/CommandSendInterface.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_B298DDFD_7AC9_4a18_BB8C_595921C525B6__INCLUDED_)
-#define EA_B298DDFD_7AC9_4a18_BB8C_595921C525B6__INCLUDED_
+#if !defined(EA_1EBB5273_A222_43b8_B7C9_435405DF9AA2__INCLUDED_)
+#define EA_1EBB5273_A222_43b8_B7C9_435405DF9AA2__INCLUDED_
#include <vector>
#include <string>
@@ -41,7 +41,7 @@ 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 26-Jan-2012 6:00:52 PM
+ * @created 10-Feb-2012 1:31:05 PM
*/
class CommandSendInterface
{
@@ -165,4 +165,4 @@ namespace am {
};
}
-#endif // !defined(EA_B298DDFD_7AC9_4a18_BB8C_595921C525B6__INCLUDED_)
+#endif // !defined(EA_1EBB5273_A222_43b8_B7C9_435405DF9AA2__INCLUDED_)
diff --git a/includes/control/ControlReceiveInterface.h b/includes/control/ControlReceiveInterface.h
index 4a2334c..d01327b 100644
--- a/includes/control/ControlReceiveInterface.h
+++ b/includes/control/ControlReceiveInterface.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_9550F257_23AE_4781_B149_0E4B3A9889AC__INCLUDED_)
-#define EA_9550F257_23AE_4781_B149_0E4B3A9889AC__INCLUDED_
+#if !defined(EA_C0D10ABE_48CA_4a18_9932_CB970D9C3723__INCLUDED_)
+#define EA_C0D10ABE_48CA_4a18_9932_CB970D9C3723__INCLUDED_
#include <vector>
#include <string>
@@ -39,7 +39,7 @@ 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 26-Jan-2012 6:00:52 PM
+ * @created 10-Feb-2012 1:31:05 PM
*/
class ControlReceiveInterface
{
@@ -278,9 +278,9 @@ namespace am {
* @return E_OK on success, E_DATABASE_ERROR on error, E_NON_EXISTENT if mainconnection
*
* @param mainconnectionID
- * @param route
+ * @param listConnectionID
*/
- virtual am_Error_e changeMainConnectionRouteDB(const am_mainConnectionID_t mainconnectionID, const am_Route_s& route) =0;
+ virtual am_Error_e changeMainConnectionRouteDB(const am_mainConnectionID_t mainconnectionID, const std::vector<am_connectionID_t>& listConnectionID) =0;
/**
* changes the mainConnectionState of MainConnection
* @return E_OK on success, E_DATABASE_ERROR on error, E_NON_EXISTENT if mainconnection
@@ -425,6 +425,22 @@ namespace am {
*/
virtual am_Error_e getSinkClassInfoDB(const am_sinkID_t sinkID, am_SinkClass_s& sinkClass) const =0;
/**
+ * returns the sinkData of a sink
+ * @return E_OK on success, E_DATABASE_ERROR on error, E_NON_EXISTENT if sink was not found
+ *
+ * @param sinkID
+ * @param sinkData
+ */
+ virtual am_Error_e getSinkInfoDB(const am_sinkID_t sinkID, am_Sink_s& sinkData) const =0;
+ /**
+ * returns the sourcekData of a source
+ * @return E_OK on success, E_DATABASE_ERROR on error, E_NON_EXISTENT if sink was not found
+ *
+ * @param sourceID
+ * @param sourceData
+ */
+ virtual am_Error_e getSourceInfoDB(const am_sourceID_t sourceID, am_Source_s& sourceData) const =0;
+ /**
* return source and sink of a gateway
* @return E_OK on success, E_DATABASE_ERROR on error, E_NON_EXISTENT if gateway was not found
*
@@ -441,6 +457,14 @@ namespace am {
*/
virtual am_Error_e getCrossfaderInfoDB(const am_crossfaderID_t crossfaderID, am_Crossfader_s& crossfaderData) const =0;
/**
+ * returns sources and the sink of a crossfader
+ * @return E_OK on success, E_DATABASE_ERROR on error, E_NON_EXISTENT if crossfader was not found
+ *
+ * @param mainConnectionID
+ * @param mainConnectionData
+ */
+ virtual am_Error_e getMainConnectionInfoDB(const am_mainConnectionID_t mainConnectionID, am_MainConnection_s& mainConnectionData) const =0;
+ /**
* returns all sinks of a domain
* @return E_OK on success, E_DATABASE_ERROR on error, E_NON_EXISTENT if domain was not found
*
@@ -570,4 +594,4 @@ namespace am {
};
}
-#endif // !defined(EA_9550F257_23AE_4781_B149_0E4B3A9889AC__INCLUDED_)
+#endif // !defined(EA_C0D10ABE_48CA_4a18_9932_CB970D9C3723__INCLUDED_)
diff --git a/includes/control/ControlSendInterface.h b/includes/control/ControlSendInterface.h
index 401d176..2d49593 100644
--- a/includes/control/ControlSendInterface.h
+++ b/includes/control/ControlSendInterface.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_7C94464D_AE95_434a_A108_201C19F97A85__INCLUDED_)
-#define EA_7C94464D_AE95_434a_A108_201C19F97A85__INCLUDED_
+#if !defined(EA_F931365D_53A0_4830_8B3E_29C95C767ADC__INCLUDED_)
+#define EA_F931365D_53A0_4830_8B3E_29C95C767ADC__INCLUDED_
#include <vector>
#include <string>
@@ -40,7 +40,7 @@ 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 26-Jan-2012 6:00:53 PM
+ * @created 10-Feb-2012 1:31:06 PM
*/
class ControlSendInterface
{
@@ -367,4 +367,4 @@ namespace am {
};
}
-#endif // !defined(EA_7C94464D_AE95_434a_A108_201C19F97A85__INCLUDED_)
+#endif // !defined(EA_F931365D_53A0_4830_8B3E_29C95C767ADC__INCLUDED_)
diff --git a/includes/routing/RoutingReceiveInterface.h b/includes/routing/RoutingReceiveInterface.h
index c2438a9..00e4666 100644
--- a/includes/routing/RoutingReceiveInterface.h
+++ b/includes/routing/RoutingReceiveInterface.h
@@ -22,8 +22,8 @@
*
* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
*/
-#if !defined(EA_21C9D5F3_73BF_4121_9A14_1D76799A05A0__INCLUDED_)
-#define EA_21C9D5F3_73BF_4121_9A14_1D76799A05A0__INCLUDED_
+#if !defined(EA_C1FDE688_5CB0_42b2_B2CC_C407D50C2D87__INCLUDED_)
+#define EA_C1FDE688_5CB0_42b2_B2CC_C407D50C2D87__INCLUDED_
#include <vector>
#include <string>
@@ -41,7 +41,7 @@ namespace am {
* Routing Receive sendInterface description. This class implements everything from RoutingAdapter -> Audiomanager
* @author christian
* @version 1.0
- * @created 01-Feb-2012 9:42:02 AM
+ * @created 10-Feb-2012 1:31:06 PM
*/
class RoutingReceiveInterface
{
@@ -248,7 +248,7 @@ namespace am {
virtual am_Error_e deregisterCrossfader(const am_crossfaderID_t crossfaderID) =0;
/**
* this function peeks a sourceclassID. It is used by the RoutingPlugins to determine the SinkClassIDs of a sinkClass.
- * @return E_OK on succes, E_DATABASE_ERROR on error, E_NON_EXISTENT if no sourceclass with name is registered
+ * @return E_OK on succes, E_DATABASE_ERROR on error
*
* @param name
* @param sourceClassID
@@ -256,7 +256,7 @@ namespace am {
virtual am_Error_e peekSourceClassID(const std::string& name, am_sourceClass_t& sourceClassID) =0;
/**
* this function peeks a sourceclassID. It is used by the RoutingPlugins to determine the SinkClassIDs of a sinkClass.
- * @return E_OK on succes, E_DATABASE_ERROR on error, E_NON_EXISTENT if no sourceclass with name is registered
+ * @return E_OK on succes, E_DATABASE_ERROR on error
*
* @param name
* @param sinkClassID
@@ -305,7 +305,8 @@ namespace am {
*/
virtual void hookTimingInformationChanged(const am_connectionID_t connectionID, const am_timeSync_t delay) =0;
/**
- * this function is used to send out all data that has been changed in an early state.
+ * this function is used to send out all data that has been changed in an early state.
+ * @return E_OK on success, E_UNKNOWN on error
*
* @param earlyData
*/
@@ -331,4 +332,4 @@ namespace am {
};
}
-#endif // !defined(EA_21C9D5F3_73BF_4121_9A14_1D76799A05A0__INCLUDED_)
+#endif // !defined(EA_C1FDE688_5CB0_42b2_B2CC_C407D50C2D87__INCLUDED_)
diff --git a/includes/routing/RoutingSendInterface.h b/includes/routing/RoutingSendInterface.h
index 6c73d4e..35c07cd 100644
--- a/includes/routing/RoutingSendInterface.h
+++ b/includes/routing/RoutingSendInterface.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_A00AD21A_AC6F_456e_B4DC_9C6AF4F44C3D__INCLUDED_)
-#define EA_A00AD21A_AC6F_456e_B4DC_9C6AF4F44C3D__INCLUDED_
+#if !defined(EA_E1ED14D4_6A57_4661_8587_FA302E2A9951__INCLUDED_)
+#define EA_E1ED14D4_6A57_4661_8587_FA302E2A9951__INCLUDED_
#include <vector>
#include <string>
@@ -41,7 +41,7 @@ namespace am {
* This class implements everything from Audiomanager -> RoutingAdapter
* @author christian
* @version 1.0
- * @created 01-Feb-2012 9:42:02 AM
+ * @created 10-Feb-2012 1:31:06 PM
*/
class RoutingSendInterface
{
@@ -196,4 +196,4 @@ namespace am {
};
}
-#endif // !defined(EA_A00AD21A_AC6F_456e_B4DC_9C6AF4F44C3D__INCLUDED_)
+#endif // !defined(EA_E1ED14D4_6A57_4661_8587_FA302E2A9951__INCLUDED_)