Arn*_*r Z 11 android bluetooth bluetooth-lowenergy
经过一段令人尴尬的时间后,我刚刚发现新推荐的接收器 inonCharacteristicRead如BluetoothGattCallbackAndroid开发人员参考中所示:
public void onCharacteristicRead (BluetoothGatt gatt,
BluetoothGattCharacteristic characteristic,
byte[] value,
int status)
Run Code Online (Sandbox Code Playgroud)
readCharacteristic当我调用该服务时没有收到任何数据。然而,已弃用的(Google Developers)实际上确实收到了回调。
我一直在遵循官方指南中的所有步骤,但尝试实现新方法,这是迄今为止唯一在“新回调”中不起作用的方法。
有想法该怎么解决这个吗?我将使用已弃用的方法,但这不是我所热衷的。提前致谢。
新的 API 仅在 Android 13 中可用。
所以
之后,它应该可以工作。至少对我来说是这样...