summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchristian mueller <christian.ei.mueller@bmw.de>2012-04-11 14:38:06 +0200
committerchristian mueller <christian.ei.mueller@bmw.de>2012-05-24 13:40:22 +0200
commitfade50454093e07b0f5739ff4935702d255d0296 (patch)
tree830d7feca0521b0a1612e13e45e51242a64dc6d7
parent31402357e30a0088a4ce3557b20401e76c420cd5 (diff)
downloadaudiomanager-fade50454093e07b0f5739ff4935702d255d0296.tar.gz
* [GAM-59] disconnect does not work with example controller
* if MainConnection exists, new connection will be rejected Signed-off-by: christian mueller <christian.ei.mueller@bmw.de>
-rw-r--r--PluginControlInterface/src/CAmControlSenderBase.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/PluginControlInterface/src/CAmControlSenderBase.cpp b/PluginControlInterface/src/CAmControlSenderBase.cpp
index a0cca6b..4a315b3 100644
--- a/PluginControlInterface/src/CAmControlSenderBase.cpp
+++ b/PluginControlInterface/src/CAmControlSenderBase.cpp
@@ -68,7 +68,16 @@ am_Error_e CAmControlSenderBase::hookUserConnectionRequest(const am_sourceID_t s
am_Handle_s handle;
mControlReceiveInterface->getRoute(true, sourceID, sinkID, listRoutes);
if (listRoutes.empty())
- return E_NOT_POSSIBLE;
+ return (E_NOT_POSSIBLE);
+
+ std::vector<am_MainConnection_s> listAllMainConnections;
+ mControlReceiveInterface->getListMainConnections(listAllMainConnections);
+ std::vector<am_MainConnection_s>::iterator itAll(listAllMainConnections.begin());
+ for(;itAll!=listAllMainConnections.end();++itAll)
+ {
+ if(itAll->sinkID==sinkID && itAll->sourceID==sourceID)
+ return (E_ALREADY_EXISTS);
+ }
std::vector<handleStatus> listHandleStaus;
std::vector<am_RoutingElement_s>::iterator it(listRoutes[0].route.begin());
@@ -119,7 +128,7 @@ am_Error_e CAmControlSenderBase::hookUserDisconnectionRequest(const am_mainConne
mainConnectionSet set;
set.connectionID = connectionID;
set.listHandleStaus = listHandleStaus;
- mListOpenConnections.push_back(set);
+ mListOpenDisconnections.push_back(set);
return E_OK;
}