Skip to content

BleGattCharacteristicException while readCharacteristic #829

@mkiisoft

Description

@mkiisoft

Describe the bug
I have a BLE device with several (11) characteristics and almost of those working. One in particular is not, but I was able to read it using HTML5 Bluetooth library on Android itself (same phone) and on iOS connecting to the same device (the result on iOS has several trailing zeros).

The following exception is being thrown:

com.polidea.rxandroidble2.exceptions.BleGattCharacteristicException: GATT exception from MAC='XX:XX:XX:XX:XX:XX', status 133 (GATT_ERROR), type BleGattOperation{description='CHARACTERISTIC_READ'}. (Look up status 0x85 here https://cs.android.com/android/platform/superproject/+/master:packages/modules/Bluetooth/system/stack/include/gatt_api.h)

Every single other Characteristic works, no problem, still connected (so, it's not a connection issue) right before and right after that one, except for every time I'm reading that Characteristic.

To Reproduce
Steps to reproduce the behavior:

  1. Connect to device
  2. Read Characteristic

Expected behavior
iOS and HTML5/Js native implementations, all of them return a List of int as expected being the following one:

[118, 49, 46, 56, 46, 50, 32, 104, 119, 49, 32, 110, 54, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0]

Smartphone / tablet

  • Device: OnePlus 6T
  • OS: Android 11
  • Package version: 1.17.2

Logs from the application when bug occurs (this will greatly help in quick understanding the problem)
To turn on logs use:

RxBleClient.updateLogOptions(new LogOptions.Builder()
        .setLogLevel(LogConstants.DEBUG)
        .setMacAddressLogSetting(LogConstants.MAC_ADDRESS_FULL)
        .setUuidsLogSetting(LogConstants.UUIDS_FULL)
        .setShouldLogAttributeValues(true)
        .build()
);
com.polidea.rxandroidble2.exceptions.BleGattCharacteristicException: GATT exception from MAC='XX:XX:XX:XX:XX:XX', status 133 (GATT_ERROR), type BleGattOperation{description='CHARACTERISTIC_READ'}. (Look up status 0x85 here https://cs.android.com/android/platform/superproject/+/master:packages/modules/Bluetooth/system/stack/include/gatt_api.h)

Additional context
I discarded being my device as I'm getting the data if I use a HTML5/Js library and the data gets as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug-androidBug that is caused by Android OS

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions