You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that the characteristic notify callback that is registered with the underlying layer is not removed when a device disconnects. When you reconnect to that device and register a notify callback it is called twice for each time data is received. Every time you disconnect/reconnect and register the callback you get one more call of the callback each time. Note that a new derived gatt.Device is instantiated on each connect.
In my disconnect code I call .enable_notifications(False) on the particular characteristic in question. Seems to work correctly if the central is causing the disconnect. However, if the peripheral device is remotely disconnected (e.g. powered off), then device.services is no longer valid to obtain the characteristic to call enable_notifications on.
I would assume it is the responsibility of the destructing code to clean up any callbacks registered?
Any ideas how to work around this?
The text was updated successfully, but these errors were encountered:
It seems that the characteristic notify callback that is registered with the underlying layer is not removed when a device disconnects. When you reconnect to that device and register a notify callback it is called twice for each time data is received. Every time you disconnect/reconnect and register the callback you get one more call of the callback each time. Note that a new derived gatt.Device is instantiated on each connect.
In my disconnect code I call .enable_notifications(False) on the particular characteristic in question. Seems to work correctly if the central is causing the disconnect. However, if the peripheral device is remotely disconnected (e.g. powered off), then device.services is no longer valid to obtain the characteristic to call enable_notifications on.
I would assume it is the responsibility of the destructing code to clean up any callbacks registered?
Any ideas how to work around this?
The text was updated successfully, but these errors were encountered: