2 * Copyright (C) 2012, BMW AG
4 * This file is part of GENIVI Project AudioManager.
6 * Contributions are licensed to the GENIVI Alliance under one or more
7 * Contribution License Agreements.
10 * This Source Code Form is subject to the terms of the
11 * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
12 * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
15 * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
17 * \file CAmControlReceiver.cpp
18 * For further information see http://www.genivi.org/.
22 #include "CAmControlReceiver.h"
27 #include "IAmDatabaseHandler.h"
28 #include "CAmRoutingSender.h"
29 #include "CAmCommandSender.h"
30 #include "CAmRouter.h"
31 #include "shared/CAmDltWrapper.h"
32 #include "shared/CAmSocketHandler.h"
34 #include "CAmNodeStateCommunicator.h"
41 CAmControlReceiver::CAmControlReceiver(IAmDatabaseHandler *iDatabaseHandler, CAmRoutingSender *iRoutingSender, CAmCommandSender *iCommandSender, CAmSocketHandler *iSocketHandler, CAmRouter* iRouter, CAmNodeStateCommunicator* iNodeStateCommunicator) :
42 mDatabaseHandler(iDatabaseHandler), //
43 mRoutingSender(iRoutingSender), //
44 mCommandSender(iCommandSender), //
45 mSocketHandler(iSocketHandler), //
47 mNodeStateCommunicator(iNodeStateCommunicator)
49 assert(mDatabaseHandler!=NULL);
50 assert(mRoutingSender!=NULL);
51 assert(mCommandSender!=NULL);
52 assert(mSocketHandler!=NULL);
53 assert(mRouter!=NULL);
54 assert(iNodeStateCommunicator!=NULL);
57 CAmControlReceiver::CAmControlReceiver(IAmDatabaseHandler *iDatabaseHandler, CAmRoutingSender *iRoutingSender, CAmCommandSender *iCommandSender, CAmSocketHandler *iSocketHandler, CAmRouter* iRouter) :
58 mDatabaseHandler(iDatabaseHandler), //
59 mRoutingSender(iRoutingSender), //
60 mCommandSender(iCommandSender), //
61 mSocketHandler(iSocketHandler), //
63 mNodeStateCommunicator(NULL)
65 assert(mDatabaseHandler!=NULL);
66 assert(mRoutingSender!=NULL);
67 assert(mCommandSender!=NULL);
68 assert(mSocketHandler!=NULL);
69 assert(mRouter!=NULL);
72 CAmControlReceiver::~CAmControlReceiver()
76 am_Error_e CAmControlReceiver::getRoute(const bool onlyfree, const am_sourceID_t sourceID, const am_sinkID_t sinkID, std::vector<am_Route_s> & returnList)
78 return (mRouter->getRoute(onlyfree, sourceID, sinkID, returnList));
81 am_Error_e CAmControlReceiver::connect(am_Handle_s & handle, am_connectionID_t & connectionID, const am_CustomConnectionFormat_t format, const am_sourceID_t sourceID, const am_sinkID_t sinkID)
83 logInfo("CAmControlReceiver::connect got called, connectionFormat=", format, "sourceID=", sourceID, "sinkID=", sinkID);
85 am_Connection_s tempConnection;
86 tempConnection.sinkID = sinkID;
87 tempConnection.sourceID = sourceID;
88 tempConnection.connectionFormat = format;
89 tempConnection.connectionID = 0;
90 tempConnection.delay=-1;
92 mDatabaseHandler->enterConnectionDB(tempConnection, connectionID);
93 return (mRoutingSender->asyncConnect(handle, connectionID, sourceID, sinkID, format));
96 am_Error_e CAmControlReceiver::disconnect(am_Handle_s & handle, const am_connectionID_t connectionID)
98 logInfo("CAmControlReceiver::disconnect got called, connectionID=", connectionID);
99 return (mRoutingSender->asyncDisconnect(handle, connectionID));
102 am_Error_e CAmControlReceiver::crossfade(am_Handle_s & handle, const am_HotSink_e hotSource, const am_crossfaderID_t crossfaderID, const am_CustomRampType_t rampType, const am_time_t rampTime)
104 logInfo("CAmControlReceiver::crossfade got called, hotSource=", hotSource, "crossfaderID=", crossfaderID, "rampType=", rampType, "rampTime=", rampTime);
105 return (mRoutingSender->asyncCrossFade(handle, crossfaderID, hotSource, rampType, rampTime));
108 am_Error_e CAmControlReceiver::setSourceState(am_Handle_s & handle, const am_sourceID_t sourceID, const am_SourceState_e state)
110 logInfo("CAmControlReceiver::setSourceState got called, sourceID=", sourceID, "state=", state);
111 return (mRoutingSender->asyncSetSourceState(handle, sourceID, state));
114 am_Error_e CAmControlReceiver::setSinkVolume(am_Handle_s & handle, const am_sinkID_t sinkID, const am_volume_t volume, const am_CustomRampType_t ramp, const am_time_t time)
116 logInfo("CAmControlReceiver::setSinkVolume got called, sinkID=", sinkID, "volume=", volume, "ramp=", ramp, "time=", time);
117 return (mRoutingSender->asyncSetSinkVolume(handle, sinkID, volume, ramp, time));
120 am_Error_e CAmControlReceiver::setSourceVolume(am_Handle_s & handle, const am_sourceID_t sourceID, const am_volume_t volume, const am_CustomRampType_t rampType, const am_time_t time)
122 logInfo("CAmControlReceiver::setSourceVolume got called, sourceID=", sourceID, "volume=", volume, "ramp=", rampType, "time=", time);
123 return (mRoutingSender->asyncSetSourceVolume(handle, sourceID, volume, rampType, time));
126 am_Error_e CAmControlReceiver::setSinkSoundProperty(am_Handle_s & handle, const am_sinkID_t sinkID, const am_SoundProperty_s & soundProperty)
128 logInfo("CAmControlReceiver::setSinkSoundProperty got called, sinkID=", sinkID, "soundProperty.Type=", soundProperty.type, "soundProperty.value=", soundProperty.value);
129 return (mRoutingSender->asyncSetSinkSoundProperty(handle, sinkID, soundProperty));
132 am_Error_e CAmControlReceiver::setSinkSoundProperties(am_Handle_s & handle, const am_sinkID_t sinkID, const std::vector<am_SoundProperty_s> & listSoundProperties)
134 logInfo("CAmControlReceiver::setSinkSoundProperties got called, sinkID=", sinkID);
135 return (mRoutingSender->asyncSetSinkSoundProperties(handle, listSoundProperties, sinkID));
138 am_Error_e CAmControlReceiver::setSourceSoundProperty(am_Handle_s & handle, const am_sourceID_t sourceID, const am_SoundProperty_s & soundProperty)
140 logInfo("CAmControlReceiver::setSourceSoundProperty got called, sourceID=", sourceID, "soundProperty.Type=", soundProperty.type, "soundProperty.value=", soundProperty.value);
141 return (mRoutingSender->asyncSetSourceSoundProperty(handle, sourceID, soundProperty));
144 am_Error_e CAmControlReceiver::setSourceSoundProperties(am_Handle_s & handle, const am_sourceID_t sourceID, const std::vector<am_SoundProperty_s> & listSoundProperties)
146 logInfo("CAmControlReceiver::setSourceSoundProperties got called, sourceID=", sourceID);
147 return (mRoutingSender->asyncSetSourceSoundProperties(handle, listSoundProperties, sourceID));
150 am_Error_e CAmControlReceiver::setDomainState(const am_domainID_t domainID, const am_DomainState_e domainState)
152 logInfo("CAmControlReceiver::setDomainState got called, domainID=", domainID, "domainState=", domainState);
153 return (mRoutingSender->setDomainState(domainID, domainState));
156 am_Error_e CAmControlReceiver::abortAction(const am_Handle_s handle)
158 logInfo("CAmControlReceiver::abortAction got called, handle.type=", handle.handle, "handle.handleType=", handle.handleType);
159 return (mRoutingSender->asyncAbort(handle));
162 am_Error_e CAmControlReceiver::enterDomainDB(const am_Domain_s & domainData, am_domainID_t & domainID)
164 return (mDatabaseHandler->enterDomainDB(domainData, domainID));
167 am_Error_e CAmControlReceiver::enterMainConnectionDB(const am_MainConnection_s & mainConnectionData, am_mainConnectionID_t & connectionID)
169 return (mDatabaseHandler->enterMainConnectionDB(mainConnectionData, connectionID));
172 am_Error_e CAmControlReceiver::enterSinkDB(const am_Sink_s & sinkData, am_sinkID_t & sinkID)
174 return (mDatabaseHandler->enterSinkDB(sinkData, sinkID));
177 am_Error_e CAmControlReceiver::enterCrossfaderDB(const am_Crossfader_s & crossfaderData, am_crossfaderID_t & crossfaderID)
179 return (mDatabaseHandler->enterCrossfaderDB(crossfaderData, crossfaderID));
182 am_Error_e CAmControlReceiver::enterGatewayDB(const am_Gateway_s & gatewayData, am_gatewayID_t & gatewayID)
184 return (mDatabaseHandler->enterGatewayDB(gatewayData, gatewayID));
187 am_Error_e CAmControlReceiver::enterSourceDB(const am_Source_s & sourceData, am_sourceID_t & sourceID)
189 return (mDatabaseHandler->enterSourceDB(sourceData, sourceID));
192 am_Error_e CAmControlReceiver::enterSinkClassDB(const am_SinkClass_s & sinkClass, am_sinkClass_t & sinkClassID)
194 return (mDatabaseHandler->enterSinkClassDB(sinkClass, sinkClassID));
197 am_Error_e CAmControlReceiver::enterSourceClassDB(am_sourceClass_t & sourceClassID, const am_SourceClass_s & sourceClass)
199 return (mDatabaseHandler->enterSourceClassDB(sourceClassID, sourceClass));
202 am_Error_e CAmControlReceiver::enterSystemPropertiesListDB(const std::vector<am_SystemProperty_s> & listSystemProperties)
204 return (mDatabaseHandler->enterSystemProperties(listSystemProperties));
207 am_Error_e CAmControlReceiver::changeMainConnectionRouteDB(const am_mainConnectionID_t mainconnectionID, const std::vector<am_connectionID_t>& listConnectionID)
209 return (mDatabaseHandler->changeMainConnectionRouteDB(mainconnectionID, listConnectionID));
212 am_Error_e CAmControlReceiver::changeMainConnectionStateDB(const am_mainConnectionID_t mainconnectionID, const am_ConnectionState_e connectionState)
214 return (mDatabaseHandler->changeMainConnectionStateDB(mainconnectionID, connectionState));
217 am_Error_e CAmControlReceiver::changeSinkMainVolumeDB(const am_mainVolume_t mainVolume, const am_sinkID_t sinkID)
219 return (mDatabaseHandler->changeSinkMainVolumeDB(mainVolume, sinkID));
222 am_Error_e CAmControlReceiver::changeSinkAvailabilityDB(const am_Availability_s & availability, const am_sinkID_t sinkID)
224 return (mDatabaseHandler->changeSinkAvailabilityDB(availability, sinkID));
227 am_Error_e CAmControlReceiver::changDomainStateDB(const am_DomainState_e domainState, const am_domainID_t domainID)
229 return (mDatabaseHandler->changDomainStateDB(domainState, domainID));
232 am_Error_e CAmControlReceiver::changeSinkMuteStateDB(const am_MuteState_e muteState, const am_sinkID_t sinkID)
234 return (mDatabaseHandler->changeSinkMuteStateDB(muteState, sinkID));
237 am_Error_e CAmControlReceiver::changeMainSinkSoundPropertyDB(const am_MainSoundProperty_s & soundProperty, const am_sinkID_t sinkID)
239 return (mDatabaseHandler->changeMainSinkSoundPropertyDB(soundProperty, sinkID));
242 am_Error_e CAmControlReceiver::changeMainSourceSoundPropertyDB(const am_MainSoundProperty_s & soundProperty, const am_sourceID_t sourceID)
244 return (mDatabaseHandler->changeMainSourceSoundPropertyDB(soundProperty, sourceID));
247 am_Error_e CAmControlReceiver::changeSourceAvailabilityDB(const am_Availability_s & availability, const am_sourceID_t sourceID)
249 return (mDatabaseHandler->changeSourceAvailabilityDB(availability, sourceID));
252 am_Error_e CAmControlReceiver::changeSystemPropertyDB(const am_SystemProperty_s & property)
254 return (mDatabaseHandler->changeSystemPropertyDB(property));
257 am_Error_e CAmControlReceiver::removeMainConnectionDB(const am_mainConnectionID_t mainConnectionID)
259 return (mDatabaseHandler->removeMainConnectionDB(mainConnectionID));
262 am_Error_e CAmControlReceiver::removeSinkDB(const am_sinkID_t sinkID)
264 return (mDatabaseHandler->removeSinkDB(sinkID));
267 am_Error_e CAmControlReceiver::removeSourceDB(const am_sourceID_t sourceID)
269 return (mDatabaseHandler->removeSourceDB(sourceID));
272 am_Error_e CAmControlReceiver::removeGatewayDB(const am_gatewayID_t gatewayID)
274 return (mDatabaseHandler->removeGatewayDB(gatewayID));
277 am_Error_e CAmControlReceiver::removeCrossfaderDB(const am_crossfaderID_t crossfaderID)
279 return (mDatabaseHandler->removeCrossfaderDB(crossfaderID));
282 am_Error_e CAmControlReceiver::removeDomainDB(const am_domainID_t domainID)
284 return (mDatabaseHandler->removeDomainDB(domainID));
287 am_Error_e CAmControlReceiver::getSourceClassInfoDB(const am_sourceID_t sourceID, am_SourceClass_s & classInfo) const
289 return (mDatabaseHandler->getSourceClassInfoDB(sourceID, classInfo));
292 am_Error_e CAmControlReceiver::getSinkClassInfoDB(const am_sinkID_t sinkID, am_SinkClass_s & sinkClass) const
294 return (mDatabaseHandler->getSinkClassInfoDB(sinkID, sinkClass));
297 am_Error_e CAmControlReceiver::getSinkInfoDB(const am_sinkID_t sinkID, am_Sink_s & sinkData) const
299 return (mDatabaseHandler->getSinkInfoDB(sinkID, sinkData));
302 am_Error_e CAmControlReceiver::getSourceInfoDB(const am_sourceID_t sourceID, am_Source_s & sourceData) const
304 return (mDatabaseHandler->getSourceInfoDB(sourceID, sourceData));
307 am_Error_e CAmControlReceiver::getMainConnectionInfoDB(const am_mainConnectionID_t mainConnectionID, am_MainConnection_s & mainConnectionData) const
309 return (mDatabaseHandler->getMainConnectionInfoDB(mainConnectionID, mainConnectionData));
312 am_Error_e CAmControlReceiver::getGatewayInfoDB(const am_gatewayID_t gatewayID, am_Gateway_s & gatewayData) const
314 return (mDatabaseHandler->getGatewayInfoDB(gatewayID, gatewayData));
317 am_Error_e CAmControlReceiver::getCrossfaderInfoDB(const am_crossfaderID_t crossfaderID, am_Crossfader_s & crossfaderData) const
319 return (mDatabaseHandler->getCrossfaderInfoDB(crossfaderID, crossfaderData));
322 am_Error_e CAmControlReceiver::getListSinksOfDomain(const am_domainID_t domainID, std::vector<am_sinkID_t> & listSinkID) const
324 return (mDatabaseHandler->getListSinksOfDomain(domainID, listSinkID));
327 am_Error_e CAmControlReceiver::getListSourcesOfDomain(const am_domainID_t domainID, std::vector<am_sourceID_t> & listSourceID) const
329 return (mDatabaseHandler->getListSourcesOfDomain(domainID, listSourceID));
332 am_Error_e CAmControlReceiver::getListCrossfadersOfDomain(const am_domainID_t domainID, std::vector<am_crossfaderID_t> & listGatewaysID) const
334 return (mDatabaseHandler->getListCrossfadersOfDomain(domainID, listGatewaysID));
337 am_Error_e CAmControlReceiver::getListGatewaysOfDomain(const am_domainID_t domainID, std::vector<am_gatewayID_t> & listGatewaysID) const
339 return (mDatabaseHandler->getListGatewaysOfDomain(domainID, listGatewaysID));
342 am_Error_e CAmControlReceiver::getListMainConnections(std::vector<am_MainConnection_s> & listMainConnections) const
344 return (mDatabaseHandler->getListMainConnections(listMainConnections));
347 am_Error_e CAmControlReceiver::getListDomains(std::vector<am_Domain_s> & listDomains) const
349 return (mDatabaseHandler->getListDomains(listDomains));
352 am_Error_e CAmControlReceiver::getListConnections(std::vector<am_Connection_s> & listConnections) const
354 return (mDatabaseHandler->getListConnections(listConnections));
357 am_Error_e CAmControlReceiver::getListSinks(std::vector<am_Sink_s> & listSinks) const
359 return (mDatabaseHandler->getListSinks(listSinks));
362 am_Error_e CAmControlReceiver::getListSources(std::vector<am_Source_s> & listSources) const
364 return (mDatabaseHandler->getListSources(listSources));
367 am_Error_e CAmControlReceiver::getListSourceClasses(std::vector<am_SourceClass_s> & listSourceClasses) const
369 return (mDatabaseHandler->getListSourceClasses(listSourceClasses));
372 am_Error_e CAmControlReceiver::getListHandles(std::vector<am_Handle_s> & listHandles) const
374 return (mRoutingSender->getListHandles(listHandles));
377 am_Error_e CAmControlReceiver::getListCrossfaders(std::vector<am_Crossfader_s> & listCrossfaders) const
379 return (mDatabaseHandler->getListCrossfaders(listCrossfaders));
382 am_Error_e CAmControlReceiver::getListGateways(std::vector<am_Gateway_s> & listGateways) const
384 return (mDatabaseHandler->getListGateways(listGateways));
387 am_Error_e CAmControlReceiver::getListSinkClasses(std::vector<am_SinkClass_s> & listSinkClasses) const
389 return (mDatabaseHandler->getListSinkClasses(listSinkClasses));
392 am_Error_e CAmControlReceiver::getListSystemProperties(std::vector<am_SystemProperty_s> & listSystemProperties) const
394 return (mDatabaseHandler->getListSystemProperties(listSystemProperties));
397 am_Error_e CAmControlReceiver::changeSinkClassInfoDB(const am_SinkClass_s & classInfo)
399 return (mDatabaseHandler->changeSinkClassInfoDB(classInfo));
402 am_Error_e CAmControlReceiver::changeSourceClassInfoDB(const am_SourceClass_s & classInfo)
404 return(mDatabaseHandler->changeSourceClassInfoDB(classInfo));
407 am_Error_e CAmControlReceiver::removeSinkClassDB(const am_sinkClass_t sinkClassID)
409 return (mDatabaseHandler->removeSinkClassDB(sinkClassID));
412 am_Error_e CAmControlReceiver::removeSourceClassDB(const am_sourceClass_t sourceClassID)
414 return (mDatabaseHandler->removeSourceClassDB(sourceClassID));
417 void CAmControlReceiver::setCommandReady()
419 logInfo("CAmControlReceiver::setCommandReady got called");
420 mCommandSender->setCommandReady();
423 void CAmControlReceiver::setRoutingReady()
425 logInfo("CAmControlReceiver::setRoutingReady got called");
426 mRoutingSender->setRoutingReady();
429 void CAmControlReceiver::confirmControllerReady(const am_Error_e error)
431 //todo: one time implement here system interaction with NSM
433 logError("CAmControlReceiver::confirmControllerReady controller reported error", error);
436 void CAmControlReceiver::confirmControllerRundown(const am_Error_e error)
440 logError("CAmControlReceiver::confirmControllerRundown() exited with error ",error);
441 //we might be blocked here -> so lets better exit right away
442 throw std::runtime_error("controller Confirmed with error");
445 logInfo ("CAmControlReceiver::confirmControllerRundown(), will exit now");
447 //end the mainloop here...
448 mSocketHandler->exit_mainloop();
451 am_Error_e CAmControlReceiver::getSocketHandler(CAmSocketHandler *& socketHandler)
453 socketHandler = mSocketHandler;
457 void CAmControlReceiver::setCommandRundown()
459 logInfo("CAmControlReceiver::setCommandRundown got called");
460 mCommandSender->setCommandRundown();
463 void CAmControlReceiver::setRoutingRundown()
465 logInfo("CAmControlReceiver::setRoutingRundown got called");
466 mRoutingSender->setRoutingRundown();
469 void CAmControlReceiver::getInterfaceVersion(std::string & version) const
471 version = ControlReceiveVersion;
474 am_Error_e CAmControlReceiver::changeSourceDB(const am_sourceID_t sourceID, const am_sourceClass_t sourceClassID, const std::vector<am_SoundProperty_s>& listSoundProperties, const std::vector<am_CustomConnectionFormat_t>& listConnectionFormats, const std::vector<am_MainSoundProperty_s>& listMainSoundProperties)
476 logInfo("CAmControlReceiver::changeSourceDB was called, sourceID", sourceID);
477 return (mDatabaseHandler->changeSourceDB(sourceID,sourceClassID,listSoundProperties,listConnectionFormats,listMainSoundProperties));
480 am_Error_e CAmControlReceiver::changeSinkDB(const am_sinkID_t sinkID, const am_sinkClass_t sinkClassID, const std::vector<am_SoundProperty_s>& listSoundProperties, const std::vector<am_CustomConnectionFormat_t>& listConnectionFormats, const std::vector<am_MainSoundProperty_s>& listMainSoundProperties)
482 logInfo("CAmControlReceiver::changeSinkDB was called with sinkID", sinkID);
483 return (mDatabaseHandler->changeSinkDB(sinkID,sinkClassID,listSoundProperties,listConnectionFormats,listMainSoundProperties));
486 am_Error_e CAmControlReceiver::changeGatewayDB(const am_gatewayID_t gatewayID, const std::vector<am_CustomConnectionFormat_t>& listSourceConnectionFormats, const std::vector<am_CustomConnectionFormat_t>& listSinkConnectionFormats, const std::vector<bool>& convertionMatrix)
488 logInfo("CAmControlReceiver::changeGatewayDB was called with gatewayID", gatewayID);
489 return (mDatabaseHandler->changeGatewayDB(gatewayID,listSourceConnectionFormats,listSinkConnectionFormats,convertionMatrix));
492 am_Error_e CAmControlReceiver::setVolumes(am_Handle_s& handle, const std::vector<am_Volumes_s>& listVolumes)
494 logInfo("CAmControlReceiver::setVolumes got called");
495 return (mRoutingSender->asyncSetVolumes(handle,listVolumes));
498 am_Error_e CAmControlReceiver::setSinkNotificationConfiguration(am_Handle_s& handle, const am_sinkID_t sinkID, const am_NotificationConfiguration_s& notificationConfiguration)
500 logInfo("CAmControlReceiver::setSinkNotificationConfiguration called, sinkID=",sinkID,"notificationConfiguration.type=",notificationConfiguration.type,"notificationConfiguration.status",notificationConfiguration.status,"notificationConfiguration.parameter",notificationConfiguration.parameter);
501 return (mRoutingSender->asyncSetSinkNotificationConfiguration(handle,sinkID,notificationConfiguration));
504 am_Error_e CAmControlReceiver::setSourceNotificationConfiguration(am_Handle_s& handle, const am_sourceID_t sourceID, const am_NotificationConfiguration_s& notificationConfiguration)
506 logInfo("CAmControlReceiver::setSourceNotificationConfiguration called, sourceID=",sourceID,"notificationConfiguration.type=",notificationConfiguration.type,"notificationConfiguration.status",notificationConfiguration.status,"notificationConfiguration.parameter",notificationConfiguration.parameter);
507 return (mRoutingSender->asyncSetSourceNotificationConfiguration(handle,sourceID,notificationConfiguration));
510 void CAmControlReceiver::sendMainSinkNotificationPayload(const am_sinkID_t sinkID, const am_NotificationPayload_s& notificationPayload)
512 logInfo("CAmControlReceiver::sendSinkMainNotificationPayload called, sinkID=",sinkID,"type=",notificationPayload.type,"value=",notificationPayload.value);
513 mCommandSender->cbSinkNotification(sinkID,notificationPayload);
516 void CAmControlReceiver::sendMainSourceNotificationPayload(const am_sourceID_t sourceID, const am_NotificationPayload_s& notificationPayload)
518 logInfo("CAmControlReceiver::sendSourceMainNotificationPayload called, sourceID=",sourceID,"type=",notificationPayload.type,"value=",notificationPayload.value);
519 mCommandSender->cbSourceNotification(sourceID,notificationPayload);
522 am_Error_e CAmControlReceiver::changeMainSinkNotificationConfigurationDB(const am_sinkID_t sinkID, const am_NotificationConfiguration_s& mainNotificationConfiguration)
524 logInfo("CAmControlReceiver::changeMainSinkNotificationConfigurationDB was called with sinkID", sinkID);
525 return (mDatabaseHandler->changeMainSinkNotificationConfigurationDB(sinkID,mainNotificationConfiguration));
528 am_Error_e CAmControlReceiver::changeMainSourceNotificationConfigurationDB(const am_sourceID_t sourceID, const am_NotificationConfiguration_s& mainNotificationConfiguration)
530 logInfo("CAmControlReceiver::changeMainSourceNotificationConfigurationDB was called with sourceID", sourceID);
531 return (mDatabaseHandler->changeMainSourceNotificationConfigurationDB(sourceID,mainNotificationConfiguration));
534 am_Error_e CAmControlReceiver::getRestartReasonPropertyNSM(NsmRestartReason_e& restartReason)
536 if (!mNodeStateCommunicator)
537 return (E_NON_EXISTENT);
539 return (mNodeStateCommunicator->nsmGetRestartReasonProperty(restartReason));
542 return (E_NON_EXISTENT);
546 am_Error_e CAmControlReceiver::getShutdownReasonPropertyNSM(NsmShutdownReason_e& ShutdownReason)
548 if (!mNodeStateCommunicator)
549 return (E_NON_EXISTENT);
551 return (mNodeStateCommunicator->nsmGetShutdownReasonProperty(ShutdownReason));
553 (void)ShutdownReason;
554 return (E_NON_EXISTENT);
559 am_Error_e CAmControlReceiver::getRunningReasonPropertyNSM(NsmRunningReason_e& nsmRunningReason)
561 if (!mNodeStateCommunicator)
562 return (E_NON_EXISTENT);
564 return (mNodeStateCommunicator->nsmGetRunningReasonProperty(nsmRunningReason));
566 (void)nsmRunningReason;
567 return (E_NON_EXISTENT);
572 NsmErrorStatus_e CAmControlReceiver::getNodeStateNSM(NsmNodeState_e& nsmNodeState)
574 if (!mNodeStateCommunicator)
575 return (NsmErrorStatus_Error);
577 return (mNodeStateCommunicator->nsmGetNodeState(nsmNodeState));
580 return (NsmErrorStatus_Error);
584 NsmErrorStatus_e CAmControlReceiver::getSessionStateNSM(const std::string& sessionName, const NsmSeat_e seatID, NsmSessionState_e& sessionState)
586 if (!mNodeStateCommunicator)
587 return (NsmErrorStatus_Error);
589 return (mNodeStateCommunicator->nsmGetSessionState(sessionName,seatID,sessionState));
594 return (NsmErrorStatus_Error);
599 NsmErrorStatus_e CAmControlReceiver::getApplicationModeNSM(NsmApplicationMode_e& applicationMode)
601 if (!mNodeStateCommunicator)
602 return (NsmErrorStatus_Error);
604 return (mNodeStateCommunicator->nsmGetApplicationMode(applicationMode));
606 (void) applicationMode;
607 return (NsmErrorStatus_Error);
612 NsmErrorStatus_e CAmControlReceiver::registerShutdownClientNSM(const uint32_t shutdownMode, const uint32_t timeoutMs)
614 if (!mNodeStateCommunicator)
615 return (NsmErrorStatus_Error);
617 return (mNodeStateCommunicator->nsmRegisterShutdownClient(shutdownMode,timeoutMs));
621 return (NsmErrorStatus_Error);
626 NsmErrorStatus_e CAmControlReceiver::unRegisterShutdownClientNSM(const uint32_t shutdownMode)
628 if (!mNodeStateCommunicator)
629 return (NsmErrorStatus_Error);
631 return (mNodeStateCommunicator->nsmUnRegisterShutdownClient(shutdownMode));
634 return (NsmErrorStatus_Error);
639 am_Error_e CAmControlReceiver::getInterfaceVersionNSM(uint32_t& version)
641 if (!mNodeStateCommunicator)
642 return (E_NON_EXISTENT);
644 return (mNodeStateCommunicator->nsmGetInterfaceVersion(version));
647 return (E_NON_EXISTENT);
652 NsmErrorStatus_e CAmControlReceiver::sendLifecycleRequestCompleteNSM(const uint32_t RequestId, const NsmErrorStatus_e status)
654 if (!mNodeStateCommunicator)
655 return (NsmErrorStatus_Error);
657 return (mNodeStateCommunicator->nsmSendLifecycleRequestComplete(RequestId,status));
661 return (NsmErrorStatus_Error);