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 like notification removal is different depending on wether the connection is requested to disconnect and the connection is lost.
If I disconnect I seem to need to do a StopNotifications() otherwise I end up with old callbacks being hit in a second connect (I sadly don't have an easy repo for that).
...but, if I suffer a disconnect I can't call StopNotifications(), else I'll get a index.js:190 Coudln't Stop Notifications:BluetoothGatt is null error and I won't be able to get notifications anymore. My guess is that notifications get automagically removed when there's a connection loss.
Is this the expected behaviour? I didn't see any of this mentioned in the docs so I am wondering if it could be added if my guesswork is correct.
Also, would it be possible to recover from the "BluetoothGatt is null error"?
The text was updated successfully, but these errors were encountered:
Calling ble.stopNotification writes a value to a descriptor on the peripheral, so you need to be connected to the peripheral for this to work.
I'm not sure what you mean by "end up with old callbacks being hit in a second connect". Typically I call ble.startNotification after connecting to a peripheral. I usually pass a named function as the callback rather than an anonymous inline function.
It seems like notification removal is different depending on wether the connection is requested to disconnect and the connection is lost.
If I disconnect I seem to need to do a
StopNotifications()
otherwise I end up with old callbacks being hit in a second connect (I sadly don't have an easy repo for that)....but, if I suffer a disconnect I can't call
StopNotifications()
, else I'll get aindex.js:190 Coudln't Stop Notifications:BluetoothGatt is null
error and I won't be able to get notifications anymore. My guess is that notifications get automagically removed when there's a connection loss.Is this the expected behaviour? I didn't see any of this mentioned in the docs so I am wondering if it could be added if my guesswork is correct.
Also, would it be possible to recover from the "BluetoothGatt is null error"?
The text was updated successfully, but these errors were encountered: