Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when implementing ObjectManager on System Bus Connection #387

Open
DanWillans opened this issue Dec 5, 2023 · 0 comments
Open

Error when implementing ObjectManager on System Bus Connection #387

DanWillans opened this issue Dec 5, 2023 · 0 comments

Comments

@DanWillans
Copy link

Describe the bug
When implementing the various ways to implement ObjectManager (either ObjectManager_Adaptor or addObjectManager() member function) on a System Bus connection the object isn't introspectable in d-feet. If I do the same on a session bus it works as expected.

To Reproduce
This example is taken from #50 and adapted slightly but it also happens with my ObjectManager_Adaptor code.

#include "sdbus-c++/IConnection.h"
#include <sdbus-c++/sdbus-c++.h>

int main(int argc, char *argv[])
{
    // Create D-Bus connection to the system bus and requests name on it.
    const char* serviceName = "org.example.service";
    // auto connection = sdbus::createSystemBusConnection(serviceName);
    auto connection = sdbus::createSessionBusConnection(serviceName);


    // Create D-Bus object.
    const char* objectPath = "/org/example/service";
    auto serviceObject = sdbus::createObject(*connection, objectPath);

    // Register D-Bus property on the object, and export the object.
    const char* interfaceName = "org.example.service";
    serviceObject->registerProperty("Name").onInterface(interfaceName).withGetter([](){ return "hello"; }).withSetter([](const uint32_t& value){  });

    serviceObject->addObjectManager();
    serviceObject->finishRegistration();

    // Start the service
    connection->enterEventLoop();
}

Uncomment the different connection types to test.

Expected behavior
I expect the ObjectManager to behave the same on both system and session bus unless my understanding is incorrect.

Real (buggy) behavior
System bus object isn't introspectable.

Additional context

  • Ubuntu 20.04 - 5.15.0-88-generic.
  • Systemd version 245.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant