请确保以下几点:
你的设备已经成功连接到周边设备并已发现和建立了正确的GATT服务和特征.
当你调用以下方法注册你的回调函数时,确保你使用的是正确的特征UUID:
mBluetoothGatt.setCharacteristicNotification(characteristic, true);
BluetoothGattDescriptor descriptor = characteristic.getDescriptor(descriptorUuid);
descriptor.setValue(BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE);
mBluetoothGatt.writeDescriptor(descriptor);
如果你的设备上的操作系统版本低于Android 5.0(API级别21),请不要使用BluetoothGatt.requestMtu()方法更改MTU大小.
最后,请注意你的应用是否有适当的权限,例如:BLUETOOTH、BLUETOOTH_ADMIN.