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

D-Bus service event "status" should be a property #2

Open
dlech opened this issue Dec 8, 2015 · 1 comment
Open

D-Bus service event "status" should be a property #2

dlech opened this issue Dec 8, 2015 · 1 comment

Comments

@dlech
Copy link
Contributor

dlech commented Dec 8, 2015

When this is implemented as an event. We cannot know the initial state of the service. It should be a property instead so the we can read the state at any time.

You still need an event when the property changes of course. For this, I suggest using org.freedesktop.DBus.Properties.PropertiesChanged.

See http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-properties.

@ensonic
Copy link
Contributor

ensonic commented Jan 27, 2016

I seem to have found an example for python dbus and properties:
https://github.com/bkircher/dbus-python/blob/master/examples/example-service.py#L72-L81
This is completely undocumented in the python-dbus docs though and I am not sure it is even part of the official release (see https://bugs.freedesktop.org/show_bug.cgi?id=26903).

Right now I work around the issue by emitting the current-status whenever a client connects. So if dbus properties actually work on the ev3 a transition plan would be:

  1. add the property and keep the signal
  2. after a release cycle drop the annotation from the signal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants