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...
Creating UUIDs (copied from How to correctly use UUID.fromString method? )
In the BLE specification there are two kinds of UUIDs.
UUID.fromString("F000xxxx-0451-4000-B000-000000000000");
UUID.fromString("0000xxxx-0000-1000-8000-00805f9b34fb")
where xxxx is the place to fill the four characters you get from the 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.