小程序onBluetoothDeviceFound一直发现不了设备,前两天是正常
发布于 5 年前 作者 xiuying56 2123 次浏览 来自 问答
  • 当前 Bug 的表现(可附上截图)
  • 预期表现
  • 复现路径
  • 提供一个最简复现 Demo

wx.openBluetoothAdapter({

success: function (res) {

wx.showLoading({

title: ‘搜索蓝牙…’,

})

//开始搜索蓝牙

wx.startBluetoothDevicesDiscovery({

success: function (res) {

console.log(‘search111’, res);

//监听发现设备

wx.onBluetoothDeviceFound(function (devices) {

console.log(‘发现设备:’, devices.devices)

wx.hideLoading();

for (let i = 0; i < devices.devices.length; i++) {

that.connectBle(devices.devices[i].deviceId);//开始链接设备

}

})

}, fail(res) {

console.log(“开启蓝牙搜索服务失败” + e);

}

})

},

1 回复

你好,麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)

回到顶部