Search code examples
dbus

Is it possible to call methods of all objects that implement some interface?


I have a few objects which implement dbus interface. Is it possible to call a method of that interface on all objects which implement it?

For example:

org.freedesktop.DBus.Properties has method GetAll. Is it possible to call GetAll method on all the objects that implement this interface?

P.S. Don't know how to tag this question properly, the answer may be in python, c/c++ languages, or even dbus-send, just give an idea.


Solution

  • There is no way to do this directly: you need to enumerate all objects exposed by all connections on the bus, then enumerate all their interfaces to find the ones which implement the interface you care about, then call the methods on those objects one-by-one.