Here you have a list of all the available characteristics: https://www.bluetooth.com/specifications/gatt/characteristics
Now you can run through the list of UUIDs and compare with them. Here is a class containing some of them:
// All BLE characteristic UUIDs are of the form:
// 0000XXXX-0000-1000-8000-00805f9b34fb
// The assigned number for the Heart Rate Measurement characteristic UUID is
// listed as 0x2A37, which is how the developer of the sample code could arrive at:
// 00002a37-0000-1000-8000-00805f9b34fb
public static class Characteristic {
final static public UUID HEART_RATE_MEASUREMENT = UUID.fromString("00002a37-0000-1000-8000-00805f9b34fb");
final static public UUID CSC_MEASUREMENT = UUID.fromString("00002a5b-0000-1000-8000-00805f9b34fb");
final static public UUID MANUFACTURER_STRING = UUID.fromString("00002a29-0000-1000-8000-00805f9b34fb");
final static public UUID MODEL_NUMBER_STRING = UUID.fromString("00002a24-0000-1000-8000-00805f9b34fb");
final static public UUID FIRMWARE_REVISION_STRING = UUID.fromString("00002a26-0000-1000-8000-00805f9b34fb");
final static public UUID APPEARANCE = UUID.fromString("00002a01-0000-1000-8000-00805f9b34fb");
final static public UUID BODY_SENSOR_LOCATION = UUID.fromString("00002a38-0000-1000-8000-00805f9b34fb");
final static public UUID BATTERY_LEVEL = UUID.fromString("00002a19-0000-1000-8000-00805f9b34fb");
final static public UUID CLIENT_CHARACTERISTIC_CONFIG = UUID.fromString("00002902-0000-1000-8000-00805f9b34fb");
}
Then, when you receive the characteristic from the gatt callback, try to check (against the list) which characteristic it is:
private final BluetoothGattCallback mGattCallback = new BluetoothGattCallback() {
...
@Override
public void onCharacteristicRead(BluetoothGatt gatt,
BluetoothGattCharacteristic characteristic,
int status) {
if (status == BluetoothGatt.GATT_SUCCESS) {
getCharacteristicValue(characteristic);
}
}
@Override
public void onCharacteristicChanged(BluetoothGatt gatt,
BluetoothGattCharacteristic characteristic) {
getCharacteristicValue(characteristic);
}
}
private void getCharacteristicValue(BluetoothGattCharacteristic characteristic) {
if(characteristic.getUuid().equals(Characteristic.HEART_RATE_MEASUREMENT)) {
if (mType == Accessory.Type.HRM && mBtLeGattServiceHeartrate != null) {
mBtLeGattServiceHeartrate.onCharacteristicChanged(mContext, BtLeDevice.this, characteristic);
}
}
}
Hope this helps.