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


source to share





All Articles