diff options
author | Stefan Laner <laner@itestra.de> | 2014-03-13 14:15:28 +0100 |
---|---|---|
committer | Johannes Langlotz <Johannes.Langlotz@partner.bmw.de> | 2014-03-24 16:46:50 +0100 |
commit | 845303b00a5ca98a83ccfd5be82075fc546b1e89 (patch) | |
tree | 0c876298d22474f17c821f5b6afe756d1a3b97ce /src/CommonAPI/DBus/DBusObjectManager.cpp | |
parent | b0a9c1d6c6ab78f722a74098080b32881c764784 (diff) | |
download | genivi-common-api-dbus-runtime-845303b00a5ca98a83ccfd5be82075fc546b1e89.tar.gz |
Implemented stub support for org.freedesktop.DBus.Properties
Change-Id: I75abc2e75643ff8da51795787970d55cf4e470c2
Diffstat (limited to 'src/CommonAPI/DBus/DBusObjectManager.cpp')
-rw-r--r-- | src/CommonAPI/DBus/DBusObjectManager.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/CommonAPI/DBus/DBusObjectManager.cpp b/src/CommonAPI/DBus/DBusObjectManager.cpp index 2feff75..df43bf0 100644 --- a/src/CommonAPI/DBus/DBusObjectManager.cpp +++ b/src/CommonAPI/DBus/DBusObjectManager.cpp @@ -10,6 +10,8 @@ #include "DBusOutputStream.h" #include "DBusUtils.h" +#include "DBusFreedesktopPropertiesStub.h" + #include <CommonAPI/utils.h> #include <dbus/dbus-protocol.h> @@ -54,6 +56,20 @@ bool DBusObjectManager::registerDBusStubAdapter(std::shared_ptr<DBusStubAdapter> objectPathLock_.lock(); isRegistrationSuccessful = addDBusInterfaceHandler(dbusStubAdapterHandlerPath, dbusStubAdapter); + if(isRegistrationSuccessful && dbusStubAdapter->hasFreedesktopProperties()) { + const std::shared_ptr<DBusFreedesktopPropertiesStub> dbusFreedesktopPropertiesStub = + std::make_shared<DBusFreedesktopPropertiesStub>(dbusStubAdapterObjectPath, + dbusStubAdapterInterfaceName, + dbusStubAdapter->getDBusConnection(), + dbusStubAdapter); + isRegistrationSuccessful = isRegistrationSuccessful + && addDBusInterfaceHandler( + {dbusFreedesktopPropertiesStub->getDBusObjectPath(), + dbusFreedesktopPropertiesStub->getInterfaceName() + }, + dbusFreedesktopPropertiesStub); + } + if (isRegistrationSuccessful && dbusStubAdapter->isManagingInterface()) { auto managerStubIterator = managerStubs_.find(dbusStubAdapterObjectPath); const bool managerStubExists = managerStubIterator != managerStubs_.end(); @@ -252,7 +268,6 @@ bool DBusObjectManager::onIntrospectableInterfaceDBusMessage(const DBusMessage& << dbusStubAdapterBase->getMethodsDBusIntrospectionXmlData() << "\n" "</interface>\n"; nodeSet.insert(elems.back()); - //break; } else { if (dbusMessage.hasObjectPath("/") && elems.size() > 1) { if (nodeSet.find(elems[1]) == nodeSet.end()) { |