I am having some difficulties with Bluetooth Low Energy on Android. I have closely done the guide I linked, as well as checked the full example code. I have a BLE device I need to connect to and retrieve data frames from. The documentation at one point dictates to
Discover/Enable service: Service UUID
UUID1
, Characteristic UUIDUUID2
Once this has been executed correctly, the device should start streaming frames of 20 bytes formatted in a particular way.
Searching for the device, connecting to it and discovering services on it I have no problem with. But then I'm stuck. To get the services, BluetoothGatt
's method getServices()
is called. This returns a list of BluetoothGattService
's, which on their part also contain a list of BluetoothGattCharacteristic
's. Obviously the BluetoothGattService
's UUID must be equal to provided UUID1, and BluetoothGattCharacteristic
's UUID to UUID2. But I do not know how to 'enable' this service with certain characteristic.
My documentation also does not mention descriptors. I have checked and there is only one descriptor in the UUID2
characteristic. So now I have everything one could possibly need - Service UUID, Characteristic UUID and Descriptor... But how do I read the data?