gpt4 book ai didi

android - bluetoothGatt writeCharacteristic 返回 false

转载 作者:太空宇宙 更新时间:2023-11-03 10:42:39 32 4
gpt4 key购买 nike

我创建了一个具有 WRITE_TYPE_NO_RESPONSE 特性的外设。对于另一个应用程序,我写了特性,但我偶尔会遇到带有 lollipop 5.1.1 的 samsung galaxy nexus i9250 问题:有时函数 BluetoothGatt.writeCharacteristic 返回 false 并且写入未完成。

它会是什么?这可能是cyanogenmod的错吗?我可以用什么方式解决这个问题?

在外围设备上:

new BluetoothGattCharacteristic(
UUID.fromString(characteristic),
BluetoothGattCharacteristic.PROPERTY_WRITE_NO_RESPONSE ,
BluetoothGattCharacteristic.PERMISSION_WRITE);

编辑:这个问题只发生在 android >= 5.0.2

在 kitkat 和 android 5.0.1 上从未发生过,是偶然的吗?

最佳答案

我通过在连续的 BluetoothGatt 读/写调用之间留出一秒的间隔来解决这个问题。

关于android - bluetoothGatt writeCharacteristic 返回 false,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30737658/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com