I try to implement reconnecting device after loosing bluetooth connection (for example because of leaving the bluetooth range). Therefore I register a listener with "Device.on('disconnect', ...)". One issue is if I call this after "Adapter.waitDevice(...)" promise on the received device, no events will be emitted. Therefore I call "Adapter.getDevice(...)" and register disconnect listener. Now the event is emitted. But for some reasons I like remove the "disconnect event listener" from Device, but this does not work.
I can see in your source, that the 'disconnect' - event is forwarded from BusHelper-propertiesChanged-event. Is this the reason that I can not unregister the listener for 'disconnect'-events on Device?
I try to implement reconnecting device after loosing bluetooth connection (for example because of leaving the bluetooth range). Therefore I register a listener with "Device.on('disconnect', ...)". One issue is if I call this after "Adapter.waitDevice(...)" promise on the received device, no events will be emitted. Therefore I call "Adapter.getDevice(...)" and register disconnect listener. Now the event is emitted. But for some reasons I like remove the "disconnect event listener" from Device, but this does not work. I can see in your source, that the 'disconnect' - event is forwarded from BusHelper-propertiesChanged-event. Is this the reason that I can not unregister the listener for 'disconnect'-events on Device?