扫描小程序码分享
系统返回10008,麻烦帮吗解答下,谢谢
6 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
确认是不是对正确的特征值进行了操作。
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
10008是系统错误哈,一般返回10008是因为该特征值的属性不支持write,
或者是频繁调用操作特征值的接口如:
建议加延时操作。
你好,我来跟进一下这个问题哈,方便复现一下问题,提供相应的微信号,并在任意聊天框输入//uplog上传日志?
调用wx.writeBLECharacteristicValue(OBJECT)
返回是10007,不知道什么原因
是因为这个原因吗,请问,该怎么解决呢
// 向蓝牙设备发送一个0x00的16进制数据
let buffer = new ArrayBuffer(16)
let dataView = new DataView(buffer)
dataView.setUint8(0, 0x06)
dataView.setUint8(0, 0x01)
dataView.setUint8(0, 0x00)
wx.writeBLECharacteristicValue({
// 这里的 deviceId 需要在上面的 getBluetoothDevices 或 onBluetoothDeviceFound 接口中获取
deviceId: 'EB:BB:11:14:CA:CA',
// 这里的 serviceId 需要在上面的 getBLEDeviceServices 接口中获取
serviceId: '0000fee7-0000-1000-8000-00805f9b34fb',
// 这里的 characteristicId 需要在上面的 getBLEDeviceCharacteristics 接口中获取
characteristicId: '000036f5-0000-1000-8000-00805f9b34fb',
// 这里的value是ArrayBuffer类型
value: buffer,
success: function (res) {
console.log('writeBLECharacteristicValue success', res.errMsg)
},
fail:function(res){
console.log('失败'+res)
console.log(res)
}
})
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
确认是不是对正确的特征值进行了操作。
10008是系统错误哈,一般返回10008是因为该特征值的属性不支持write,
或者是频繁调用操作特征值的接口如:![]()
建议加延时操作。
你好,我来跟进一下这个问题哈,方便复现一下问题,提供相应的微信号,并在任意聊天框输入//uplog上传日志?
调用wx.writeBLECharacteristicValue(OBJECT)
返回是10007,不知道什么原因
是因为这个原因吗,请问,该怎么解决呢![]()
// 向蓝牙设备发送一个0x00的16进制数据
let buffer = new ArrayBuffer(16)
let dataView = new DataView(buffer)
dataView.setUint8(0, 0x06)
dataView.setUint8(0, 0x01)
dataView.setUint8(0, 0x01)
dataView.setUint8(0, 0x01)
dataView.setUint8(0, 0x00)
dataView.setUint8(0, 0x00)
dataView.setUint8(0, 0x00)
dataView.setUint8(0, 0x00)
dataView.setUint8(0, 0x00)
dataView.setUint8(0, 0x00)
dataView.setUint8(0, 0x00)
dataView.setUint8(0, 0x00)
dataView.setUint8(0, 0x00)
dataView.setUint8(0, 0x00)
dataView.setUint8(0, 0x00)
dataView.setUint8(0, 0x00)
wx.writeBLECharacteristicValue({
// 这里的 deviceId 需要在上面的 getBluetoothDevices 或 onBluetoothDeviceFound 接口中获取
deviceId: 'EB:BB:11:14:CA:CA',
// 这里的 serviceId 需要在上面的 getBLEDeviceServices 接口中获取
serviceId: '0000fee7-0000-1000-8000-00805f9b34fb',
// 这里的 characteristicId 需要在上面的 getBLEDeviceCharacteristics 接口中获取
characteristicId: '000036f5-0000-1000-8000-00805f9b34fb',
// 这里的value是ArrayBuffer类型
value: buffer,
success: function (res) {
console.log('writeBLECharacteristicValue success', res.errMsg)
},
fail:function(res){
console.log('失败'+res)
console.log(res)
}
})