Open
Description
Hi
The problem I'm facing is checking if service emitting signals went dark. There seems to not be any event emitted when interface goes down. To make problem worse when service goes back up properties.on("SendBrightness", ()=>{});
does not work anymore.
What I'm doing to circumvent this problem is registering listener on brightness service as usual:
const registerBrightnessService = async () => {
try {
// get a proxy object
const obj = await bus.getProxyObject("me.kryq.brightness", "/me/kryq/brightness");
const properties = obj.getInterface("me.kryq.brightness");
properties.on("SendBrightness", ()=>{});
}
catch (e) {
console.log(e.toString());
setTimeout(registerBrightnessService, 5000);
}
};
but then listening on the bus for messages:
bus.on("message", (msg:dbus.Message)=> {
if(msg.interface == "me.kryq.brightness" && msg.member === "SendBrightness") {
setBrightness(msg.body[0])
.catch(console.error);
}
});
This allows me to listen to messages when service reconnects.
Is there any event I'm missing?
Thanks for help
Activity