Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Declare which signals are subscribed to on DBus?

Tags:

python

dbus

Is there a way to declare which signals are subscribed by a Python application over DBus?

In other words, is there a way to advertise through the "Introspectable" interface which signals are subscribed to. I use "D-Feet D-Bus debugger".

E.g. Application subscribes to signal X (using the add_signal_receiver method on a bus object).

like image 647
jldupont Avatar asked Dec 13 '25 12:12

jldupont


2 Answers

D-Bus clients call AddMatch on the bus daemon to register their interest in messages matching a particular pattern; most bindings add a match rule either for all signals on a particular service and object path, or for signals on a particular interface on that service and object path, when you create a proxy object.

Using dbus-monitor you can see match rules being added: try running dbus-monitor member=AddMatch and then running an application that uses D-Bus. Similarly, you can eavesdrop calls to RemoveMatch. However, there's currently no way to ask the daemon for the set of match rules currently in effect. Adding a way to ask that question would make more sense than adding a way for clients to re-advertise this, given that the daemon knows already.

like image 191
wjt Avatar answered Dec 16 '25 11:12

wjt


This is probably not possible since a signal is emitted on the bus and the application just picks out what is interesting. Subscribing is not happening inside dbus.

like image 44
Stefan Avatar answered Dec 16 '25 12:12

Stefan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!