Closed erezbuchnik closed 1 year ago
Yes, you can subscribe connection and disconnection events. Follow these following links
https://github.com/chrvadala/node-ble/blob/main/docs/api.md#Device+event_connect https://github.com/chrvadala/node-ble/blob/main/docs/api.md#disconnect
My use-case involves multiple devices which may sporadically disconnect, and I need to intercept the disconnection event - as it appears in the bluetooth logs:
src/adapter.c:dev_disconnected()
How can I assign a callback on this event using node-ble? I mean, something similar to the callback for intercepting notifications (once registered to a Notifications characteristic), e.g.:
Does the current version support this? If not, is there an easy way to add such a feature? It's an absolute must for noisy Bluetooth environments.