【发布时间】:2015-06-02 10:44:49
【问题描述】:
我在获取特征描述符时遇到问题,它总是返回 null。 我的代码有一大块:
public static final String CHARACTERISTIC_UPDATE_NOTIFICATION_DESCRIPTOR_UUID = "00000001-0000-1000-8000-00805f9b34fb";
public final static UUID tmp_uuid_1 = UUID.fromString(CHARACTERISTIC_UPDATE_NOTIFICATION_DESCRIPTOR_UUID);
...
BluetoothGattDescriptor descriptor = gattCharacteristic.getDescriptor(tmp_uuid_1);
descriptor.setValue(true ? BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE : new byte[]{0x00, 0x00});
我在装有 Android 5.1 的 Nexus 6 和装有 OS 2.0(如 Android 4.3)的诺基亚 X2 DS 上尝试过此操作,但遇到了类似的错误。
等待答案) 感谢您的关注!
【问题讨论】:
标签: android bluetooth bluetooth-lowenergy descriptor characteristics