I’m trying to receive a signal over D-Bus but I can’t see the method being invoked:
DBusInterface {
bus: DBus.SessionBus
service: 'com.example.apple'
path: '/'
iface: 'com.example.apple'
signalsEnabled: true
function orange(int_value) {
console.log("############### DEBUG SIGNAL orange ", int_value);
}
function send_pear() {
typedCall("Pear", [
{"type": "s", "value": "hello world"},
],
function (result) {
console.log("DEBUG Pear:", result);
},
function (error) {
console.log("############### ERROR Pear failed:", error);
}
);
}
Component.onCompleted: {
console.log("############### DEBUG DBUS completed");
send_pear();
}
}
If I run dbus-monitor I see the signals being emitted:
[nemo@Sailfish ~]$ dbus-monitor --session "type='signal',sender='com.example.apple'"
signal time=1601199482.354399 sender=:1.83 -> destination=(null destination) serial=788 path=/; interface=com.example.apple; member=orange
uint16 780
signal time=1601199483.357265 sender=:1.83 -> destination=(null destination) serial=789 path=/; interface=com.example.apple; member=orange
uint16 781
Executing methods (e.g. the “Pear” method above) works perfectly fine.
What am I doing wrong?