CAmDbusWrapper* CAmDbusWrapper::mpReference = NULL;
-CAmDbusWrapper::CAmDbusWrapper(CAmSocketHandler* socketHandler) :
+CAmDbusWrapper::CAmDbusWrapper(CAmSocketHandler* socketHandler, DBusBusType type) :
pDbusDispatchCallback(this, &CAmDbusWrapper::dbusDispatchCallback), //
pDbusFireCallback(this, &CAmDbusWrapper::dbusFireCallback), //
pDbusCheckCallback(this, &CAmDbusWrapper::dbusCheckCallback), //
dbus_error_init(&mDBusError);
logInfo("DBusWrapper::DBusWrapper Opening DBus connection");
- mpDbusConnection = dbus_bus_get(DBUS_BUS_SESSION, &mDBusError);
+ mpDbusConnection = dbus_bus_get(type, &mDBusError);
if (dbus_error_is_set(&mDBusError))
{
logError("DBusWrapper::DBusWrapper Error while getting the DBus");
"\t-V: print DLT logs to stdout\t\n"
#endif
"\t-d: daemonize AudioManager \t\n"
+#ifdef WITH_DBUS_WRAPPER
+ "\t-T: DbusType to be used by CAmDbusWrapper (0=DBUS_SESSION[default], 1=DBUS_SYSTEM)\t\n"
+#endif
"\t-p<path> path for sqlite database (default is in memory)\t\n"
"\t-t<port> port for telnetconnection\t\n"
"\t-m<max> number of max telnetconnections\t\n"
int fd0, fd1, fd2;
bool enableNoDLTDebug = false;
+#ifdef WITH_DBUS_WRAPPER
+ DBusBusType dbusWrapperType=DBUS_BUS_SESSION;
+#endif
+
/**
* the out of memory handler
*/
while (optind < argc)
{
#ifdef WITH_DLT
- int option = getopt(argc, argv, "h::v::c::l::r::L::R::d::t::m::i::p::");
+ #ifdef WITH_DBUS_WRAPPER
+ int option = getopt(argc, argv, "h::v::c::l::r::L::R::d::t::m::i::p::T::");
+ #else
+ int option = getopt(argc, argv, "h::v::c::l::r::L::R::d::t::m::i::p::");
+ #endif WITH_DBUS_WRAPPER
#else
- int option = getopt(argc, argv, "h::v::V::c::l::r::L::R::d::t::m::i::p::");
+ #ifdef WITH_DBUS_WRAPPER
+ int option = getopt(argc, argv, "h::v::V::c::l::r::L::R::d::t::m::i::p::T::");
+ #else
+ int option = getopt(argc, argv, "h::v::V::c::l::r::L::R::d::t::m::i::p::");
+ #endif //WITH_DBUS_WRAPPER
#endif
switch (option)
enableNoDLTDebug = true;
break;
#endif
+#ifdef WITH_DBUS_WRAPPER
+ case 'T':
+ dbusWrapperType=static_cast<DBusBusType>(atoi(optarg));
+ break;
+#endif
case 'h':
default:
printf("AudioManagerDaemon Version: %s\n", DAEMONVERSION);
CAmSocketHandler iSocketHandler;
#ifdef WITH_DBUS_WRAPPER
- CAmDbusWrapper iDBusWrapper(&iSocketHandler);
+ CAmDbusWrapper iDBusWrapper(&iSocketHandler,dbusWrapperType);
#endif /*WITH_DBUS_WRAPPER */
CAmDatabaseHandler iDatabaseHandler(databasePath);
Usage: AudioManagerDaemon [options]
options:
- -h: print this message
- -i: info about current settings
- -v: print version
- -d: daemonize AudioManager
- -p<path> path for sqlite database (default is in memory)
- -t<port> port for telnetconnection
- -m<max> number of max telnetconnections
- -c<Name> use controllerPlugin <Name> (full path with .so ending)
- -l<Name> replace command plugin directory with <Name> (full path)
- -r<Name> replace routing plugin directory with <Name> (full path)
- -L<Name> add command plugin directory with <Name> (full path)
- -R<Name> add routing plugin directory with <Name> (full path)
+
+ -h: print this message
+ -i: info about current settings
+ -v: print version
+ -V: print DLT logs to stdout
+ -d: daemonize AudioManager
+ -T: DbusType to be used by CAmDbusWrapper (0=DBUS_SESSION[default], 1=DBUS_SYSTEM)
+ -p<path> path for sqlite database (default is in memory)
+ -t<port> port for telnetconnection
+ -m<max> number of max telnetconnections
+ -c<Name> use controllerPlugin <Name> (full path with .so ending)
+ -l<Name> replace command plugin directory with <Name> (full path)
+ -r<Name> replace routing plugin directory with <Name> (full path)
+ -L<Name> add command plugin directory with <Name> (full path)
+ -R<Name> add routing plugin directory with <Name> (full path)
***********************************************************************************************************
class CAmDbusWrapper
{
public:
- CAmDbusWrapper(CAmSocketHandler* socketHandler);
+ CAmDbusWrapper(CAmSocketHandler* socketHandler,DBusBusType type=DBUS_BUS_SESSION);
virtual ~CAmDbusWrapper();
void registerCallback(const DBusObjectPathVTable* vtable, const std::string& path, void* userdata);