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

Exporting object on unnamed service #49

Closed
zobar opened this issue Dec 22, 2013 · 3 comments
Closed

Exporting object on unnamed service #49

zobar opened this issue Dec 22, 2013 · 3 comments

Comments

@zobar
Copy link

zobar commented Dec 22, 2013

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.)

@meh
Copy link

meh commented Jul 7, 2014

I'm having the same issue.

@dpruessner
Copy link

@zobar Interesting-- ran into same question when translating some BlueZ python DBus code into Ruby for a BLE peripheral application. I have control of the system (embedded Linux install-- I can create the DBus service permissions to create a named service), so it's not a show-stopper. But non-named service export would be nice to have in a clean way.

mvidner added a commit that referenced this issue Jun 12, 2023
just mentioning an issue that was fixed in beta1 already and I forgot to
mention it

#49
@mvidner
Copy link
Owner

mvidner commented Jun 12, 2023

Fixed in #135, released 0.23.0.beta1

@mvidner mvidner closed this as completed Jun 12, 2023
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

4 participants