Skip to content

Exporting object on unnamed service #49

Closed
@zobar

Description

@zobar

I'm working with the BlueZ Bluetooth API which, for some operations, requires a callback object that is exported by the client connection. If I understand correctly, the only way to export an object in ruby-dbus is through a named service, which can only be retrieved from DBus::Connection#request_service. Unfortunately, since I'm working with an unprivileged connection to the system bus, my process does not have permission to request_service.

I noticed that SystemBus has a usable Service in @service, and if I call DBus::SystemBus.instance.instance_variable_get(:@service).export(my_object) my object is exported and receives method invocations as expected. However, I'm a little bit 😬 about relying on instance variables like that.

Is there a recommended way of doing this?

(For reference, line 152 of this file contains the Python equivalent of the code I need.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions