I am running a custom service with custom characteristics on a BLE 4.2 device. I am working on an android app to read/write the characteristics etc. The first thing I try is to read the characteristics.
I define a list of UUIDs: List chars = new ArrayList<>();
I create a service using my know service UUID: mCustomService = mBluetoothGatt.getService(MY_SERVICE_UUID);
I load the List with 4 know UUIDs from my service:
chars.clear();
chars.add(UUID1);
chars.add(UUID2);
chars.add(UUID3);
chars.add(UUID4);
I read the first characteristic from the end of my list:
BluetoothGattCharacteristic mReadCharacteristic = mCustomService.getCharacteristic(chars.get(chars.size() - 1));
if(mReadCharacteristic != null)
mBluetoothGatt.readCharacteristic(mReadCharacteristic);
mReadCharacteristic always returns null, the service does not contain my characteristics.
If I use a BLE "sniffer" app then I do see all the characteristics.
Thanks
Rich
PS I cannot figure out the formatting here!