栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

onCharacteristicwrite中的Android蓝牙状态133

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

onCharacteristicwrite中的Android蓝牙状态133

当我尝试写入某些特征时,我也遇到了类似的问题,但是我是否记得相同的错误代码。 (它可以在某些设备上运行,而不能在其他设备上运行)。

原来是问题

property
出在
characteristics
和的
writeType

由于特征可以设置值:

  • write without response
    要么
  • write with response

参考该属性,您必须

writeType
在将实际数据写入特征之前进行设置。

一旦获得特性,就可以设置类型,而在写入之前。

BluetoothGattCharacteristic tChar = syncService.getCharacteristic(SYNC_HEIGHT_INPUT_CHAR);        if (tChar == null) throw new AssertionError("characteristic null when sync time!");        // use one of them in regards of the Characteristic's property        tChar.setWriteType(BluetoothGattCharacteristic.WRITE_TYPE_NO_RESPONSE);        //tChar.setWriteType(BluetoothGattCharacteristic.WRITE_TYPE_DEFAULT);        tChar.setValue(, BluetoothGattCharacteristic.FORMAT_SINT32, 0);        gatt.writeCharacteristic(tChar);


转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/438011.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号