收藏
回答

writeBleCharacteristic iphone6p 与ble 设备链接,返回信息错误?

发送buffer信息成功,蓝牙设备能正确接收信息,但是writeBleCharacteristic api 一直返回错误:

后测试固定数据写入,使用iphone6p手机依然写入失败

    let buffer= new ArrayBuffer(4)
    let dataView = new DataView(buffer)
    dataView.setUint8(00x1b)
    dataView.setUint8(10x84)
    dataView.setUint8(20x00)
    dataView.setUint8(30x84)      
    wx.writeBLECharacteristicValue({
        deviceIdthis._deviceId,
        serviceIdthis._serviceId,
        characteristicIdthis._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}` })
        }
回答关注问题邀请回答
收藏

1 个回答

  • xyz
    xyz
    2020-04-28
    对 BLE  write characteristicId 有什么特殊要求么?
    


    2020-04-28
    有用
    回复
登录 后发表内容
问题标签