bluetooth-lowenergygattcharacteristicsrxandroidble

RxAndroidBle: Reading Pre-Defined GATT Characteristics


I have a BLE device with multiple characteristics addressed by default addresses as defined here

Things like Manufacturer Name String, Hardware Revision String, Serial Number String etc.

Using the UUID class I've attempted several different ways to construct a UUID that RxAndroidBle would accept and read from these characteristics.

The one I though would work most was this:

UUID GATT_DSR1_MANUFACTURER_NAME = new UUID(0L, 0x2A29L);

but I just get back onError callbacks.

RxBleConnection.readCharacteristic only accepts UUID or a BluetoothGattCharacteristic which is created with a UUID...


Solution

  • Creating UUIDs (copied from How to correctly use UUID.fromString method? )

    In the BLE specification there are two kinds of UUIDs.

    Your 0x2A29L stands for "2A29" String as the xxxx.

    Obtaining BluetoothGattCharacteristic

    On Android there is no possibility to create a working BluetoothGattCharacteristic with a UUID. It is still possible to call RxBleConnection.discoverServices() and get it from the result though.