Failed to receive signal from dbus-send (CLI) #488
-
I am trying to receive a signal emitted by a bash script using dbus-send in an application using the sdbus-cpp library. Starting with an introspect XML:
I generated the proxy using the xml2cpp tool:
And implemented the proxy: Header:
Source:
But when I try to emit the signal via CLI with the client running, nothing is showing (suppose to log the values):
My guess is something related to the CLI dbus-send application validation (because it does not have a DBus connection, so it may not be identified as the correct emitter of the signal). I had tried with bustctl emit and gdbus emit with similar results. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Hi, First, I converted this to a discussion thread. It's better to start a discussion first, and if it turns out there is an issue in sdbus-c++ library, then a GitHub issue can be created. Second, you've provided some pieces of code, which is great, but you missed the most important part -- how do you start and use Furthermore, do you see the signal in dbus-monitor? |
Beta Was this translation helpful? Give feedback.
@lctasca You are on the right track -- you need to provide a sender when emitting the signal with
dbus-send
, so thedbus-send
connects todbus-daemon
in the name of that service:The client, when registering to a signal, provides a filter condition that is based on sender, object path, interface name and signal name. Since you've specified the latter three, but no sender, the condition did not match the signal and thus the callback was not called.
Let me know if that helped.