-
-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
startNotifying sometimes makes BLE device disconnect #240
Comments
first what s your version of the plugin? second what s your ble device ? |
Plugin's version is the last one (3.1.5). You're right, this error can happen because of the BLE device. But the different callbacks order when failing makes me think this is the root cause. Do you think the device can trigger the callbacks in a different order randomly? I was also wondering if callbacks are all registered in the In the failing logs I provided, |
@sebj54 First the order is correct. |
Thank you for the adivce, I'm going to test it further today with extras About the order, you're saying:
I noticed the opposite, it is working only if I'll let you know if I find anything and I'll close the issue if I can work around the problem without altering the plugin. Tahnks again for your help! |
Hi!
I have a long running issue which happens approximately 1 in 10 times. It seems to happen more on Android than on iOS. I investigated this problem deeper on Android actually and I identified one thing which, I think, is responsible of the problem.
I started my debug by enabling Trace for this module:
What I do in my app is the following:
The problem occurs between step 2 and step 3.
Here is a sample of the involved code:
Here is a sample of
adb logcat
for a successful notification (only the startNotifying part):And here is a sample of
adb logcat
for a failing notification:To make it short, the problem in the failing notification seems to be that
BluetoothGattCallback.onCharacteristicChanged
is called beforeBluetoothGattCallback.onDescriptorWrite
(see diff).I tried to debug it in
bluetooth.android.js
directly in node_modules but I didn't find anything different when it fails. I thought thatsetCharacteristicNotification
should be called afterbluetoothGattDescriptor
instanciation but it does not change anything.ble/src/bluetooth.android.ts
Line 2328 in a81ffcf
If you have any idea, let me know, I'll probably debug it more last week.
The text was updated successfully, but these errors were encountered: