发送buffer信息成功,蓝牙设备能正确接收信息,但是writeBleCharacteristic api 一直返回错误:
后测试固定数据写入,使用iphone6p手机依然写入失败
let buffer= new ArrayBuffer(4)
let dataView = new DataView(buffer)
dataView.setUint8(0, 0x1b)
dataView.setUint8(1, 0x84)
dataView.setUint8(2, 0x00)
dataView.setUint8(3, 0x84)
wx.writeBLECharacteristicValue({
deviceId: this._deviceId,
serviceId: this._serviceId,
characteristicId: this._characteristicId,
value: buffer,
success: (res) => {
this.setPrcess(` uuid:${this._characteristicId}写入二进制数据成功: ${res.errMsg}`)
console.log('writeBLECharacteristicValue success', res.errMsg)
},
fail: (res) => {
this.setPrcess(` uuid:${this._characteristicId}写入二进制数据失败`)
this.setData({ writeErrorMsg: `写入失败:${e.errMsg}` })
}
对 BLE write characteristicId 有什么特殊要求么?