ac51be7678453dd9f09fc54decb849570ef39a31
[profile/ivi/audiomanager.git] / AudioManagerDaemon / src / ControlReceiver.cpp
1 /**
2  * Copyright (C) 2011, BMW AG
3  *
4  * GeniviAudioMananger AudioManagerDaemon
5  *
6  * \file ControlReceiver.cpp
7  *
8  * \date 20-Oct-2011 3:42:04 PM
9  * \author Christian Mueller (christian.ei.mueller@bmw.de)
10  *
11  * \section License
12  * GNU Lesser General Public License, version 2.1, with special exception (GENIVI clause)
13  * Copyright (C) 2011, BMW AG Christian Mueller  Christian.ei.mueller@bmw.de
14  *
15  * 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.
16  * 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.
17  * 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>.
18  * 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.
19  * 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.
20  * 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.
21  * 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.
22  *
23  */
24
25 #include <config.h>
26 #include <SocketHandler.h>
27 #include "ControlReceiver.h"
28 #include "DatabaseHandler.h"
29 #include "RoutingSender.h"
30 #include "CommandSender.h"
31 #include "Router.h"
32 #include <assert.h>
33 #include <dlt/dlt.h>
34
35 DLT_IMPORT_CONTEXT(AudioManager)
36
37 using namespace am;
38
39 ControlReceiver::ControlReceiver(DatabaseHandler *iDatabaseHandler, RoutingSender *iRoutingSender, CommandSender *iCommandSender, SocketHandler *iSocketHandler, Router* iRouter) :
40         mDatabaseHandler(iDatabaseHandler), //
41         mRoutingSender(iRoutingSender), //
42         mCommandSender(iCommandSender), //
43         mSocketHandler(iSocketHandler), //
44         mRouter(iRouter)
45 {
46     assert(mDatabaseHandler!=NULL);
47     assert(mRoutingSender!=NULL);
48     assert(mCommandSender!=NULL);
49     assert(mSocketHandler!=NULL);
50     assert(mRouter!=NULL);
51 }
52
53 ControlReceiver::ControlReceiver(DatabaseHandler *iDatabaseHandler, RoutingSender *iRoutingSender, CommandSender *iCommandSender, Router* iRouter) :
54         mDatabaseHandler(iDatabaseHandler), //
55         mRoutingSender(iRoutingSender), //
56         mCommandSender(iCommandSender), //
57         mRouter(iRouter)
58 {
59     assert(mDatabaseHandler!=NULL);
60     assert(mRoutingSender!=NULL);
61     assert(mCommandSender!=NULL);
62     assert(mRouter!=NULL);
63 }
64
65 ControlReceiver::~ControlReceiver()
66 {
67 }
68
69 am_Error_e ControlReceiver::getRoute(const bool onlyfree, const am_sourceID_t sourceID, const am_sinkID_t sinkID, std::vector<am_Route_s> & returnList)
70 {
71     mRouter->getRoute(onlyfree,sourceID,sinkID,returnList);
72     return E_NOT_USED;
73 }
74
75 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)
76 {
77     DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("ControlReceiver::connect got called, connectionFormat"), DLT_INT(format), DLT_STRING("sourceID"), DLT_INT(sourceID), DLT_STRING("sinkID"), DLT_INT(sinkID));
78
79     am_Connection_s tempConnection;
80     tempConnection.sinkID = sinkID;
81     tempConnection.sourceID = sourceID;
82     tempConnection.connectionFormat = format;
83     tempConnection.connectionID = 0;
84
85     //todo: enter function to find out what happends if the same connection is in the course of being build up.
86     if (mDatabaseHandler->existConnection(tempConnection)) return E_ALREADY_EXISTS; //todo:enter the correct connectionID here?
87
88     mDatabaseHandler->enterConnectionDB(tempConnection, connectionID);
89     return mRoutingSender->asyncConnect(handle, connectionID, sourceID, sinkID, format);
90 }
91
92 am_Error_e ControlReceiver::disconnect(am_Handle_s & handle, const am_connectionID_t connectionID)
93 {
94     DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("ControlReceiver::disconnect got called, connectionID="), DLT_INT(connectionID));
95
96     if (!mDatabaseHandler->existConnectionID(connectionID)) return E_NON_EXISTENT; //todo: check with EA model and correct
97     return mRoutingSender->asyncDisconnect(handle, connectionID);
98 }
99
100 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)
101 {
102     DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("ControlReceiver::crossfade got called, hotSource="), DLT_INT(hotSource), DLT_STRING("crossfaderID="), DLT_INT(crossfaderID), DLT_STRING("rampType="), DLT_INT(rampType), DLT_STRING("rampTime="), DLT_INT(rampTime));
103
104     if (!mDatabaseHandler->existcrossFader(crossfaderID)) return E_NON_EXISTENT;
105     return mRoutingSender->asyncCrossFade(handle, crossfaderID, hotSource, rampType, rampTime);
106 }
107
108 am_Error_e ControlReceiver::setSourceState(am_Handle_s & handle, const am_sourceID_t sourceID, const am_SourceState_e state)
109 {
110     DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("ControlReceiver::setSourceState got called, sourceID="), DLT_INT(sourceID), DLT_STRING("state="), DLT_INT(state));
111
112     am_SourceState_e sourceState;
113     if (mDatabaseHandler->getSoureState(sourceID, sourceState) != E_OK) return E_UNKNOWN;
114     if (sourceState == state) return E_NO_CHANGE;
115     return mRoutingSender->asyncSetSourceState(handle, sourceID, state);
116 }
117
118 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)
119 {
120     DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("ControlReceiver::setSinkVolume got called, sinkID="), DLT_INT(sinkID), DLT_STRING("volume="), DLT_INT(volume), DLT_STRING("ramp="), DLT_INT(ramp), DLT_STRING("time="), DLT_INT(time));
121
122     am_volume_t tempVolume;
123     if (mDatabaseHandler->getSinkVolume(sinkID, tempVolume) != E_OK) return E_UNKNOWN;
124     if (tempVolume == volume) return E_NO_CHANGE;
125     return mRoutingSender->asyncSetSinkVolume(handle, sinkID, volume, ramp, time);
126 }
127
128 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)
129 {
130     DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("ControlReceiver::setSourceVolume got called, sourceID="), DLT_INT(sourceID), DLT_STRING("volume="), DLT_INT(volume), DLT_STRING("ramp="), DLT_INT(rampType), DLT_STRING("time="), DLT_INT(time));
131
132     am_volume_t tempVolume;
133     if (mDatabaseHandler->getSourceVolume(sourceID, tempVolume) != E_OK) return E_UNKNOWN;
134     if (tempVolume == volume) return E_NO_CHANGE;
135     return mRoutingSender->asyncSetSourceVolume(handle, sourceID, volume, rampType, time);
136 }
137
138 am_Error_e ControlReceiver::setSinkSoundProperty(am_Handle_s & handle, const am_sinkID_t sinkID, const am_SoundProperty_s & soundProperty)
139 {
140     DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("ControlReceiver::setSinkSoundProperty got called, sinkID="), DLT_INT(sinkID), DLT_STRING("soundProperty.Type="), DLT_INT(soundProperty.type), DLT_STRING("soundProperty.value="), DLT_INT(soundProperty.value));
141
142     uint16_t value;
143     if (mDatabaseHandler->getSinkSoundPropertyValue(sinkID, soundProperty.type, value) != E_OK) return E_UNKNOWN;
144     if (value == soundProperty.value) return E_NO_CHANGE;
145     return mRoutingSender->asyncSetSinkSoundProperty(handle, sinkID, soundProperty);
146 }
147
148 am_Error_e ControlReceiver::setSinkSoundProperties(am_Handle_s & handle, const am_sinkID_t sinkID, const std::vector<am_SoundProperty_s> & listSoundProperties)
149 {
150     DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("ControlReceiver::setSinkSoundProperties got called, sinkID="), DLT_INT(sinkID));
151
152     uint16_t value;
153     bool noChange = true;
154     std::vector<am_SoundProperty_s>::const_iterator it = listSoundProperties.begin();
155     for (; it != listSoundProperties.end(); ++it)
156     {
157         if (mDatabaseHandler->getSinkSoundPropertyValue(sinkID, it->type, value) != E_OK) return (E_UNKNOWN);
158         if (value != it->value) noChange = false;
159     }
160     if (noChange) return (E_NO_CHANGE);
161     return (mRoutingSender->asyncSetSinkSoundProperties(handle, listSoundProperties, sinkID));
162 }
163
164 am_Error_e ControlReceiver::setSourceSoundProperty(am_Handle_s & handle, const am_sourceID_t sourceID, const am_SoundProperty_s & soundProperty)
165 {
166     DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("ControlReceiver::setSourceSoundProperty got called, sourceID="), DLT_INT(sourceID), DLT_STRING("soundProperty.Type="), DLT_INT(soundProperty.type), DLT_STRING("soundProperty.value="), DLT_INT(soundProperty.value));
167
168     uint16_t value;
169     if (mDatabaseHandler->getSourceSoundPropertyValue(sourceID, soundProperty.type, value) != E_OK) return E_UNKNOWN;
170     if (value == soundProperty.value) return E_NO_CHANGE;
171     return mRoutingSender->asyncSetSourceSoundProperty(handle, sourceID, soundProperty);
172 }
173
174 am_Error_e ControlReceiver::setSourceSoundProperties(am_Handle_s & handle, const am_sourceID_t sourceID, const std::vector<am_SoundProperty_s> & listSoundProperties)
175 {
176     DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("ControlReceiver::setSourceSoundProperties got called, sourceID="), DLT_INT(sourceID));
177
178     uint16_t value;
179     bool noChange = true;
180     std::vector<am_SoundProperty_s>::const_iterator it = listSoundProperties.begin();
181     for (; it != listSoundProperties.end(); ++it)
182     {
183         if (mDatabaseHandler->getSourceSoundPropertyValue(sourceID, it->type, value) != E_OK) return (E_UNKNOWN);
184         if (value != it->value) noChange = false;
185     }
186     if (noChange) return (E_NO_CHANGE);
187     return (mRoutingSender->asyncSetSourceSoundProperties(handle, listSoundProperties, sourceID));
188 }
189
190 am_Error_e ControlReceiver::setDomainState(const am_domainID_t domainID, const am_DomainState_e domainState)
191 {
192     DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("ControlReceiver::setDomainState got called, domainID="), DLT_INT(domainID), DLT_STRING("domainState="), DLT_INT(domainState));
193
194     am_DomainState_e tempState = DS_MIN;
195     if (mDatabaseHandler->getDomainState(domainID, tempState) != E_OK) return E_UNKNOWN;
196     if (tempState == domainState) return E_NO_CHANGE;
197     return mRoutingSender->setDomainState(domainID, domainState);
198 }
199
200 am_Error_e ControlReceiver::abortAction(const am_Handle_s handle)
201 {
202     DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("ControlReceiver::abortAction got called, handle.type="), DLT_INT(handle.handle), DLT_STRING("handle.handleType="), DLT_INT(handle.handleType));
203
204     return mRoutingSender->asyncAbort(handle);
205 }
206
207 am_Error_e ControlReceiver::enterDomainDB(const am_Domain_s & domainData, am_domainID_t & domainID)
208 {
209     return mDatabaseHandler->enterDomainDB(domainData, domainID);
210 }
211
212 am_Error_e ControlReceiver::enterMainConnectionDB(const am_MainConnection_s & mainConnectionData, am_mainConnectionID_t & connectionID)
213 {
214     return mDatabaseHandler->enterMainConnectionDB(mainConnectionData, connectionID);
215 }
216
217 am_Error_e ControlReceiver::enterSinkDB(const am_Sink_s & sinkData, am_sinkID_t & sinkID)
218 {
219     return mDatabaseHandler->enterSinkDB(sinkData, sinkID);
220 }
221
222 am_Error_e ControlReceiver::enterCrossfaderDB(const am_Crossfader_s & crossfaderData, am_crossfaderID_t & crossfaderID)
223 {
224     return mDatabaseHandler->enterCrossfaderDB(crossfaderData, crossfaderID);
225 }
226
227 am_Error_e ControlReceiver::enterGatewayDB(const am_Gateway_s & gatewayData, am_gatewayID_t & gatewayID)
228 {
229     return mDatabaseHandler->enterGatewayDB(gatewayData, gatewayID);
230 }
231
232 am_Error_e ControlReceiver::enterSourceDB(const am_Source_s & sourceData, am_sourceID_t & sourceID)
233 {
234     return mDatabaseHandler->enterSourceDB(sourceData, sourceID);
235 }
236
237 am_Error_e ControlReceiver::enterSinkClassDB(const am_SinkClass_s & sinkClass, am_sinkClass_t & sinkClassID)
238 {
239     return mDatabaseHandler->enterSinkClassDB(sinkClass, sinkClassID);
240 }
241
242 am_Error_e ControlReceiver::enterSourceClassDB(am_sourceClass_t & sourceClassID, const am_SourceClass_s & sourceClass)
243 {
244     return mDatabaseHandler->enterSourceClassDB(sourceClassID, sourceClass);
245 }
246
247 am_Error_e ControlReceiver::enterSystemPropertiesListDB(const std::vector<am_SystemProperty_s> & listSystemProperties)
248 {
249     return mDatabaseHandler->enterSystemProperties(listSystemProperties);
250 }
251
252 am_Error_e ControlReceiver::changeMainConnectionRouteDB(const am_mainConnectionID_t mainconnectionID, const am_Route_s & route)
253 {
254     return mDatabaseHandler->changeMainConnectionRouteDB(mainconnectionID, route);
255 }
256
257 am_Error_e ControlReceiver::changeMainConnectionStateDB(const am_mainConnectionID_t mainconnectionID, const am_ConnectionState_e connectionState)
258 {
259     return mDatabaseHandler->changeMainConnectionStateDB(mainconnectionID, connectionState);
260 }
261
262 am_Error_e ControlReceiver::changeSinkMainVolumeDB(const am_mainVolume_t mainVolume, const am_sinkID_t sinkID)
263 {
264     return mDatabaseHandler->changeSinkMainVolumeDB(mainVolume, sinkID);
265 }
266
267 am_Error_e ControlReceiver::changeSinkAvailabilityDB(const am_Availability_s & availability, const am_sinkID_t sinkID)
268 {
269     return mDatabaseHandler->changeSinkAvailabilityDB(availability, sinkID);
270 }
271
272 am_Error_e ControlReceiver::changDomainStateDB(const am_DomainState_e domainState, const am_domainID_t domainID)
273 {
274     return mDatabaseHandler->changDomainStateDB(domainState, domainID);
275 }
276
277 am_Error_e ControlReceiver::changeSinkMuteStateDB(const am_MuteState_e muteState, const am_sinkID_t sinkID)
278 {
279     return mDatabaseHandler->changeSinkMuteStateDB(muteState, sinkID);
280 }
281
282 am_Error_e ControlReceiver::changeMainSinkSoundPropertyDB(const am_MainSoundProperty_s & soundProperty, const am_sinkID_t sinkID)
283 {
284     return mDatabaseHandler->changeMainSinkSoundPropertyDB(soundProperty, sinkID);
285 }
286
287 am_Error_e ControlReceiver::changeMainSourceSoundPropertyDB(const am_MainSoundProperty_s & soundProperty, const am_sourceID_t sourceID)
288 {
289     return mDatabaseHandler->changeMainSinkSoundPropertyDB(soundProperty, sourceID);
290 }
291
292 am_Error_e ControlReceiver::changeSourceAvailabilityDB(const am_Availability_s & availability, const am_sourceID_t sourceID)
293 {
294     return mDatabaseHandler->changeSourceAvailabilityDB(availability, sourceID);
295 }
296
297 am_Error_e ControlReceiver::changeSystemPropertyDB(const am_SystemProperty_s & property)
298 {
299     return mDatabaseHandler->changeSystemPropertyDB(property);
300 }
301
302 am_Error_e ControlReceiver::removeMainConnectionDB(const am_mainConnectionID_t mainConnectionID)
303 {
304     return mDatabaseHandler->removeMainConnectionDB(mainConnectionID);
305 }
306
307 am_Error_e ControlReceiver::removeSinkDB(const am_sinkID_t sinkID)
308 {
309     return mDatabaseHandler->removeSinkDB(sinkID);
310 }
311
312 am_Error_e ControlReceiver::removeSourceDB(const am_sourceID_t sourceID)
313 {
314     return mDatabaseHandler->removeSourceDB(sourceID);
315 }
316
317 am_Error_e ControlReceiver::removeGatewayDB(const am_gatewayID_t gatewayID)
318 {
319     return mDatabaseHandler->removeGatewayDB(gatewayID);
320 }
321
322 am_Error_e ControlReceiver::removeCrossfaderDB(const am_crossfaderID_t crossfaderID)
323 {
324     return mDatabaseHandler->removeCrossfaderDB(crossfaderID);
325 }
326
327 am_Error_e ControlReceiver::removeDomainDB(const am_domainID_t domainID)
328 {
329     return mDatabaseHandler->removeDomainDB(domainID);
330 }
331
332 am_Error_e ControlReceiver::getSourceClassInfoDB(const am_sourceID_t sourceID, am_SourceClass_s & classInfo) const
333 {
334     return mDatabaseHandler->getSourceClassInfoDB(sourceID, classInfo);
335 }
336
337 am_Error_e ControlReceiver::getSinkClassInfoDB(const am_sinkID_t sinkID, am_SinkClass_s & sinkClass) const
338 {
339     return mDatabaseHandler->getSinkClassInfoDB(sinkID, sinkClass);
340 }
341
342 am_Error_e ControlReceiver::getGatewayInfoDB(const am_gatewayID_t gatewayID, am_Gateway_s & gatewayData) const
343 {
344     return mDatabaseHandler->getGatewayInfoDB(gatewayID, gatewayData);
345 }
346
347 am_Error_e ControlReceiver::getCrossfaderInfoDB(const am_crossfaderID_t crossfaderID, am_Crossfader_s & crossfaderData) const
348 {
349     return mDatabaseHandler->getCrossfaderInfoDB(crossfaderID, crossfaderData);
350 }
351
352 am_Error_e ControlReceiver::getListSinksOfDomain(const am_domainID_t domainID, std::vector<am_sinkID_t> & listSinkID) const
353 {
354     return mDatabaseHandler->getListSinksOfDomain(domainID, listSinkID);
355 }
356
357 am_Error_e ControlReceiver::getListSourcesOfDomain(const am_domainID_t domainID, std::vector<am_sourceID_t> & listSourceID) const
358 {
359     return mDatabaseHandler->getListSourcesOfDomain(domainID, listSourceID);
360 }
361
362 am_Error_e ControlReceiver::getListCrossfadersOfDomain(const am_domainID_t domainID, std::vector<am_crossfaderID_t> & listGatewaysID) const
363 {
364     return mDatabaseHandler->getListCrossfadersOfDomain(domainID, listGatewaysID);
365 }
366
367 am_Error_e ControlReceiver::getListGatewaysOfDomain(const am_domainID_t domainID, std::vector<am_gatewayID_t> & listGatewaysID) const
368 {
369     return mDatabaseHandler->getListGatewaysOfDomain(domainID, listGatewaysID);
370 }
371
372 am_Error_e ControlReceiver::getListMainConnections(std::vector<am_MainConnection_s> & listMainConnections) const
373 {
374     return mDatabaseHandler->getListMainConnections(listMainConnections);
375 }
376
377 am_Error_e ControlReceiver::getListDomains(std::vector<am_Domain_s> & listDomains) const
378 {
379     return mDatabaseHandler->getListDomains(listDomains);
380 }
381
382 am_Error_e ControlReceiver::getListConnections(std::vector<am_Connection_s> & listConnections) const
383 {
384     return mDatabaseHandler->getListConnections(listConnections);
385 }
386
387 am_Error_e ControlReceiver::getListSinks(std::vector<am_Sink_s> & listSinks) const
388 {
389     return mDatabaseHandler->getListSinks(listSinks);
390 }
391
392 am_Error_e ControlReceiver::getListSources(std::vector<am_Source_s> & listSources) const
393 {
394     return mDatabaseHandler->getListSources(listSources);
395 }
396
397 am_Error_e ControlReceiver::getListSourceClasses(std::vector<am_SourceClass_s> & listSourceClasses) const
398 {
399     return mDatabaseHandler->getListSourceClasses(listSourceClasses);
400 }
401
402 am_Error_e ControlReceiver::getListHandles(std::vector<am_Handle_s> & listHandles) const
403 {
404     return mRoutingSender->getListHandles(listHandles);
405 }
406
407 am_Error_e ControlReceiver::getListCrossfaders(std::vector<am_Crossfader_s> & listCrossfaders) const
408 {
409     return mDatabaseHandler->getListCrossfaders(listCrossfaders);
410 }
411
412 am_Error_e ControlReceiver::getListGateways(std::vector<am_Gateway_s> & listGateways) const
413 {
414     return mDatabaseHandler->getListGateways(listGateways);
415 }
416
417 am_Error_e ControlReceiver::getListSinkClasses(std::vector<am_SinkClass_s> & listSinkClasses) const
418 {
419     return mDatabaseHandler->getListSinkClasses(listSinkClasses);
420 }
421
422 am_Error_e ControlReceiver::getListSystemProperties(std::vector<am_SystemProperty_s> & listSystemProperties) const
423 {
424     return mDatabaseHandler->getListSystemProperties(listSystemProperties);
425 }
426
427 am_Error_e ControlReceiver::changeSinkClassInfoDB(const am_SinkClass_s & classInfo)
428 {
429     return mDatabaseHandler->changeSinkClassInfoDB(classInfo);
430 }
431
432 am_Error_e ControlReceiver::changeSourceClassInfoDB(const am_SourceClass_s & classInfo)
433 {
434     return mDatabaseHandler->changeSourceClassInfoDB(classInfo);
435 }
436
437 am_Error_e ControlReceiver::removeSinkClassDB(const am_sinkClass_t sinkClassID)
438 {
439     return mDatabaseHandler->removeSinkClassDB(sinkClassID);
440 }
441
442 am_Error_e ControlReceiver::removeSourceClassDB(const am_sourceClass_t sourceClassID)
443 {
444     return mDatabaseHandler->removeSourceClassDB(sourceClassID);
445 }
446
447 void ControlReceiver::setCommandReady()
448 {
449     DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("ControlReceiver::setCommandReady got called"));
450     mCommandSender->cbCommunicationReady();
451 }
452
453 void ControlReceiver::setRoutingReady()
454 {
455     DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("ControlReceiver::setRoutingReady got called"));
456     mRoutingSender->routingInterfacesReady();
457 }
458
459 am_Error_e ControlReceiver::getSocketHandler(SocketHandler *& socketHandler)
460 {
461 #ifdef WITH_SOCKETHANDLER_LOOP
462     socketHandler = mSocketHandler;
463     return E_OK;
464 #else
465     return E_UNKNOWN;
466 #endif
467 }
468
469 uint16_t ControlReceiver::getInterfaceVersion() const
470 {
471     return ControlReceiveVersion;
472 }
473