html52.com
我爱小程序-开发者交流社区

调用wx.makeBluetoothPair报错errCode:10013

框架类型 问题类型 API/组件名称 终端类型 微信版本 基础库版本
小程序 Bug wx.makeBluetoothPair 微信安卓客户端 7.0.19 2.13.1[462]

https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-ble/wx.makeBluetoothPair.html

调用wx.makeBluetoothPair报错errCode:10013,errMsg:makeBluetoothPair:fail:invalid data

之前用手动输入配对码没有问题,现在想用wx.makeBluetoothPair自动输入配对码

已确认传入的参数pin的ArrayBuffer没有问题

关于wx.makeBluetoothPair文档给的信息太少了,能给一下示例代码吗?

想知道wx.makeBluetoothPair这个API有人调用成功过没

代码如下:

pairCode是6位数字

          var code = ''+pairCode
          console.log('pairCode:'+code);
          var arrayBuffer = new ArrayBuffer(6);
          var dataView = new DataView(arrayBuffer);
          for(var i=0;i<code.length;i++){
            dataView.setUint8(i,code.charCodeAt(i));
          }
          console.log(arrayBuffer);
      
          wx.makeBluetoothPair({
            deviceId:BLEConfig.deviceId,
            pin:arrayBuffer,
            success:res=>{
              console.log(JSON.stringify(res));
            },
            fail:error=>{
              console.log(JSON.stringify(error));
            }
          })

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

真正的个人免签约支付接口

云免签H5支付