wx.writeBLECharacteristicValue 10007?
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
})
}
})
}
},