Java 如何找到客户端配置?

Java 如何找到客户端配置?,java,android,bluetooth-lowenergy,uuid,sensors,Java,Android,Bluetooth Lowenergy,Uuid,Sensors,我需要CLIENT\u CHARACTERISTIC\u CONFIGUUID在我的应用程序中激活通知。在google示例应用程序中,它们是预定义的: public static String HEART_RATE_MEASUREMENT = "00002a37-0000-1000-8000-00805f9b34fb"; public static String CLIENT_CHARACTERISTIC_CONFIG = "00002902-0000-1000-8000-00805f9b34f

我需要
CLIENT\u CHARACTERISTIC\u CONFIG
UUID在我的应用程序中激活通知。在google示例应用程序中,它们是预定义的:

public static String HEART_RATE_MEASUREMENT = "00002a37-0000-1000-8000-00805f9b34fb";
public static String CLIENT_CHARACTERISTIC_CONFIG = "00002902-0000-1000-8000-00805f9b34fb";
我所拥有的只是:

  • 双向服务:b9e875c0-1cfa-11e6-b797-0002a5d5c51b
  • 接收号码:0c68d100-266f-11e6-b388-0002a5d5c51b
  • Tx:1ed9e2c0-266f-11e6-850b-0002a5d5c51b
如何获取以下对象的UUID:

mBluetoothGatt.setCharacteristicNotification(characteristic, enabled);
BluetoothGattDescriptor descriptor = characteristic.getDescriptor(UUID.fromString(needed UUID here));
descriptor.setValue(enabled?BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE : new byte[]{0x00, 0x00});
mBluetoothGatt.writeDescriptor(descriptor);

客户端特征配置的UUID为0x2902,或长格式的“00002902-0000-1000-8000-00805f9b34fb”,如您的应用程序中所定义

作为旁注,您可以从Nick Unucheck中找到所有支持的描述符及其UUID,如本答案所示:


客户端特征配置具有UUID 0x2902,或长格式的“00002902-0000-1000-8000-00805f9b34fb”,如应用程序中所定义

作为旁注,您可以从Nick Unucheck中找到所有支持的描述符及其UUID,如本答案所示: