0

I'm trying to read a characteristic with ReadCharacteristic().

But the function always return false.

What I have checked :

  • the UUID is the right one.
  • the connection is stable.
  • the UUID is readable.
  • there is no other call of ReadCharacteristic() -> OnCharacteristicRead is never called

Many topics, such as this one:

android 4.3 Bluetooth ble don't called onCharacteristicRead()

suggests that it's not necessary to do others things in order to receive the data.

Do I need to do additionnal things to make it work ? (like operations on descriptors?)

[open to any grammar/ortographic edit]

Community
  • 1
  • 1
Greg
  • 579
  • 5
  • 26
  • 1
    What about manifest permissions? Do you have all required ones? – foxanna Dec 16 '16 at 14:13
  • My permissions related to bluetooth are: BLUETOOTH, BLUETOOTH_ADMIN, BLUETOOTH_PRIVILEGED. As I'm under Marshmallow, I also ask them at runtime. – Greg Dec 16 '16 at 14:25
  • 1
    See the method "readCharacteristic" at https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/bluetooth/BluetoothGatt.java. There you have all reasons why it may return false. In particular, you can not have more than one outstanding GATT operation at a time (you need to wait for callback before you can issue a new one). – Emil Dec 16 '16 at 20:23
  • Everything was fine in the code, that was a firmware issue. Thanks for help. – Greg Dec 20 '16 at 10:04
  • @Greg can you give little bit brieff about how you sloved because i'm also facing same issue . – YBDevi Jan 29 '19 at 08:05
  • @YBDevi it's quite old but as far as I remember, it was a firmware issue. The bluetooth device was a prototype, and there was an error in the documentation of it's UUIDs leading us to believe it was an issue on the C# app. You should also check your permissions as stated in the comments – Greg Jan 29 '19 at 12:59
  • @Greg for my BLE device there is properties,i have checked those are READ only still those methods are not calling. – YBDevi Jan 29 '19 at 13:05

0 Answers0