收藏
回答

小程序onBluetoothDeviceFound一直发现不了设备,前两天是正常

框架类型 问题类型 API/组件名称 终端类型 微信版本 基础库版本
小程序 Bug 蓝牙 客户端 7.0.4 2.0.0

- 当前 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 个回答

  • 疯狂的小辣椒
    疯狂的小辣椒
    2019-06-10

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

    2019-06-10
    有用
    回复 1
    • 宁
      2019-06-10

      可以了,是地理位置没有打开就不能搜索到

      2019-06-10
      回复
登录 后发表内容