Failed to get onCharacteristicChanged callback in Android BLE

I ran into a rather peculiar problem. I am programming in Android to get readings from a BLE blood pressure monitor (A&D UA 651). I can get device read on some devices (Galaxy S6, Note 2, Droid Turbo), but other devices (like Oneplus One, HTC Desire 810), etc. I can connect to BP monitor, but cannot get read from it.

I followed the tutorial posted by Android here .

Write now, I use setCharacteristicNotification()

to warn me of any changes in stats. I also write the correct descriptor using:

  descriptor.setValue(BluetoothGattDescriptor.ENABLE_INDICATION_VALUE);
  mBluetoothGatt.writeDescriptor(descriptor);`

      

Here's the kicker. I noticed that on devices where I am not warned about changing the value of the traits, if I put a breakpoint inside the callback onDescriptorWrite()

, I can get a read. The status value in the callback is always 0 (regardless of whether I can read the value on the characteristic or not.)

This led me to believe that I should cause a delay in this callback, but this rarely works.

If anyone has encountered this problem before, please let me know. I have been stuck with this issue for a long time.

Thank!

+3
android bluetooth android bluetooth bluetooth-lowenergy


source to share


No one has answered this question yet

See similar questions:

6
Android list of BLE devices after device scan

or similar:

3606
Close / hide Android soft keyboard
3295
Why is the Android emulator so slow? How can we speed up the development of an Android emulator?
3288
Correct use cases for Android UserManager.isUserAGoat ()?
2609
Is there a unique identifier for an Android device?
2510
How to persist android activity state by persisting instance state?
2097
Is there a way to run Python on Android?
1844
What is "Context" on Android?
185
Android 4.3 Bluetooth Low energy unstable
nine
Android BLE: onCharacteristicChanged never fires
0
Android BLE: Successfully write ENABLE_NOTIFICATION_VALUE value for BluetoothGattDescriptor but onCharacteristicChanged never fires



All Articles
Loading...
X
Show
Funny
Dev
Pics