class CAmCommandSender;
class CAmRouter;
class CAmNodeStateCommunicator;
+class CAmDbusWrapper;
/**
* This class is used to receive all commands from the control interface
class CAmControlReceiver: public IAmControlReceive
{
public:
+
CAmControlReceiver(IAmDatabaseHandler *iDatabaseHandler, CAmRoutingSender *iRoutingSender, CAmCommandSender *iCommandSender, CAmSocketHandler *iSocketHandler, CAmRouter* iRouter, CAmNodeStateCommunicator* iNodeStateCommunicator);
CAmControlReceiver(IAmDatabaseHandler *iDatabaseHandler, CAmRoutingSender *iRoutingSender, CAmCommandSender *iCommandSender, CAmSocketHandler *iSocketHandler, CAmRouter* iRouter);
+ CAmControlReceiver(IAmDatabaseHandler *iDatabaseHandler, CAmRoutingSender *iRoutingSender, CAmCommandSender *iCommandSender, CAmSocketHandler *iSocketHandler, CAmRouter* iRouter, CAmDbusWrapper *iDBusWrapper);
~CAmControlReceiver();
am_Error_e getRoute(const bool onlyfree, const am_sourceID_t sourceID, const am_sinkID_t sinkID, std::vector<am_Route_s>& returnList);
am_Error_e connect(am_Handle_s& handle, am_connectionID_t& connectionID, const am_CustomConnectionFormat_t format, const am_sourceID_t sourceID, const am_sinkID_t sinkID);
am_Error_e getInterfaceVersionNSM(uint32_t& version) ;
NsmErrorStatus_e sendLifecycleRequestCompleteNSM(const uint32_t RequestId, const NsmErrorStatus_e status) ;
+ am_Error_e getDBusConnectionWrapper(CAmDbusWrapper*& dbusConnectionWrapper) const;
+
private:
IAmDatabaseHandler* mDatabaseHandler; //!< pointer tto the databasehandler
CAmRoutingSender* mRoutingSender; //!< pointer to the routing send interface.
CAmCommandSender* mCommandSender; //!< pointer to the command send interface
CAmSocketHandler* mSocketHandler; //!< pointer to the socketHandler
CAmRouter* mRouter; //!< pointer to the Router
+ CAmDbusWrapper* mDBusWrapper;
CAmNodeStateCommunicator* mNodeStateCommunicator;
};
mCommandSender(iCommandSender), //
mSocketHandler(iSocketHandler), //
mRouter(iRouter), //
+ mDBusWrapper(NULL),
mNodeStateCommunicator(iNodeStateCommunicator)
{
assert(mDatabaseHandler!=NULL);
mCommandSender(iCommandSender), //
mSocketHandler(iSocketHandler), //
mRouter(iRouter), //
+ mDBusWrapper(NULL),
mNodeStateCommunicator(NULL)
{
assert(mDatabaseHandler!=NULL);
assert(mRouter!=NULL);
}
+CAmControlReceiver::CAmControlReceiver(IAmDatabaseHandler *iDatabaseHandler, CAmRoutingSender *iRoutingSender, CAmCommandSender *iCommandSender, CAmSocketHandler *iSocketHandler, CAmRouter* iRouter, CAmDbusWrapper *iDBusWrapper) :
+ mDatabaseHandler(iDatabaseHandler), //
+ mRoutingSender(iRoutingSender), //
+ mCommandSender(iCommandSender), //
+ mSocketHandler(iSocketHandler), //
+ mRouter(iRouter), //
+ mDBusWrapper(iDBusWrapper),
+ mNodeStateCommunicator(NULL)
+{
+ assert(mDatabaseHandler!=NULL);
+ assert(mRoutingSender!=NULL);
+ assert(mCommandSender!=NULL);
+ assert(mSocketHandler!=NULL);
+ assert(mRouter!=NULL);
+ assert(mDBusWrapper!=NULL);
+}
+
CAmControlReceiver::~CAmControlReceiver()
{
}
}
+am_Error_e CAmControlReceiver::getDBusConnectionWrapper(CAmDbusWrapper *& dbusConnectionWrapper) const
+{
+#ifdef WITH_DBUS_WRAPPER
+ dbusConnectionWrapper = mDBusWrapper;
+ return (E_OK);
+#else
+ return (E_UNKNOWN);
+#endif
}
+}
CAmControlReceiver iControlReceiver(pDatabaseHandler,&iRoutingSender,&iCommandSender,&iSocketHandler, &iRouter, &iNodeStateCommunicator);
iNodeStateCommunicator.registerControlSender(&iControlSender);
#else /*WITH_NSM*/
+#ifdef WITH_DBUS_WRAPPER
+ CAmControlReceiver iControlReceiver(pDatabaseHandler,&iRoutingSender,&iCommandSender,&iSocketHandler, &iRouter, &iDBusWrapper);
+#else /*WITH_DBUS_WRAPPER*/
CAmControlReceiver iControlReceiver(pDatabaseHandler,&iRoutingSender,&iCommandSender,&iSocketHandler, &iRouter);
+#endif /*WITH_DBUS_WRAPPER*/
#endif /*WITH_NSM*/
#ifdef WITH_TELNET
* \file
* For further information see http://projects.genivi.org/audio-manager
*
- * THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL.
+ * THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL.
* PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN.
*/
#if !defined(EA_D35033D8_8C54_4c3b_B0E4_9C98516FDF3C__INCLUDED_)
#include "audiomanagertypes.h"
namespace am {
class CAmSocketHandler;
+class CAmDbusWrapper;
}
#include "audiomanagertypes.h"
#include "NodeStateManager.h"
-#define ControlReceiveVersion "3.0"
+#define ControlReceiveVersion "3.0"
namespace am {
/**
* this method sets a source state for a source. This function will trigger the
* callback cbAckSetSourceState
* @return E_OK on success, E_NO_CHANGE if the desired value is already correct,
- * E_UNKNOWN on error, E_NO_CHANGE if no change is neccessary
+ * E_UNKNOWN on error, E_NO_CHANGE if no change is neccessary
*/
virtual am_Error_e setSourceState(am_Handle_s& handle, const am_sourceID_t sourceID, const am_SourceState_e state) =0;
/**
* It is the duty of the controller to check if the property is valid. If it does
* not exist, the daemon will not return an error.
* @return E_OK on success, E_DATABASE_ERROR on error, E_NON_EXISTENT if
- * sinkClassID was not found.
+ * sinkClassID was not found.
*/
virtual am_Error_e changeSinkClassInfoDB(const am_SinkClass_s& sinkClass) =0;
/**
/**
* changes the mute state of a sink
* @return E_OK on success, E_DATABASE_ERROR on error, E_NON_EXISTENT if sink was
- * not found
+ * not found
*/
virtual am_Error_e changeSinkMuteStateDB(const am_MuteState_e muteState, const am_sinkID_t sinkID) =0;
/**
virtual am_Error_e getListSystemProperties(std::vector<am_SystemProperty_s>& listSystemProperties) const =0;
/**
* sets the command interface to ready. Will send setCommandReady to each of the
- * plugins. The corresponding answer is confirmCommandReady.
+ * plugins. The corresponding answer is confirmCommandReady.
*/
virtual void setCommandReady() =0;
/**
* sets the command interface into the rundown state. Will send setCommandRundown
- * to each of the plugins. The corresponding answer is confirmCommandRundown.
+ * to each of the plugins. The corresponding answer is confirmCommandRundown.
*/
virtual void setCommandRundown() =0;
/**
*/
virtual NsmErrorStatus_e sendLifecycleRequestCompleteNSM(const uint32_t RequestId, const NsmErrorStatus_e status) =0;
+ /**
+ * this function is used to retrieve a pointer to the dBusConnectionWrapper
+ * @return E_OK if pointer is valid, E_UKNOWN if AudioManager was compiled without DBus Support
+ *
+ * @param dbusConnectionWrapper This is a wrapper class that is needed to keep dbus inclusions away from the interface.
+ * The DBusWrapperClass will return the pointer to the DbusConnection call (getDBusConnection)
+ */
+ virtual am_Error_e getDBusConnectionWrapper(CAmDbusWrapper*& dbusConnectionWrapper) const =0;
+
};
}
#endif // !defined(EA_D35033D8_8C54_4c3b_B0E4_9C98516FDF3C__INCLUDED_)