write为true,但还是报10007
方法:
SendTap: function () {
var that = this
if (that.data.connected) {
var buffer = new ArrayBuffer(that.data.inputText.length)
var dataView = new Uint8Array(buffer)
for (var i = 0; i < that.data.inputText.length; i++) {
dataView[i] = that.data.inputText.charCodeAt(i)
}
wx.writeBLECharacteristicValue({
deviceId: that.data.connectedDeviceId,
serviceId: that.data.serviceId,
characteristicId: that.data.characteristics,
value: buffer,
success: function (res) {
console.log('发送成功')
},
fail:(err)=>{
console.log(err)
}
})
} else {
wx.showModal({
title: '提示',
content: '蓝牙已断开',
showCancel: false,
success: function (res) {
that.setData({
searching: false
})
}
})
}
},
定位到问题了,发现写和订阅的uuid相同了导致写不了,是硬件固件的问题,硬件那边修改name后导致两个uuid一样了。谢谢。
你好,麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)
麻烦在手机微信那里上传下日志: 我->设置->帮助与反馈右上角有个上报日志的入口,麻烦提供一下微信号,时间点(具体到分钟)