收藏
回答

有些android手机使用蓝牙搜索,搜索不到指定设备

框架类型 问题类型 API/组件名称 终端类型 微信版本 基础库版本
小程序 Bug wx.startBluetoothDevicesDiscovery(OBJECT) 客户端 6.6.7 2.2.5


有些手机通过蓝牙搜索能够搜索的指定设备,但是有些手机却收不到,我这里有两台设备是搜索不到的。

/**

  * 搜索蓝牙设备

  */

searchBluetooth: function() {

var that = this;

wx.startBluetoothDevicesDiscovery({

services: [util.MAIN_SERVICE_LIST_UUID],

interval: 3000,

success: function(res) {

console.log('开启搜索蓝牙成功');

},

})


wx.onBluetoothDeviceFound(function(res) {

console.log(res);

console.log('发现新的设备');

// 获取搜索到的蓝牙设备

wx.getBluetoothDevices({

success: function(resList) {

console.log(resList);

that.setData({

bluetoothDevices: resList.devices

});

console.log(that.data.bluetoothDevices);

}

})

})

},


最后一次编辑于  2018-09-04
回答关注问题邀请回答
收藏

1 个回答

  • 景风
    景风
    2018-07-13

    手机信息:Redmi4 MIUI9.5|稳定版

    android版本:6.0.1 微信版本:6.7.1321

    2018-07-13
    有用
    回复
登录 后发表内容