有些android手机使用蓝牙搜索,搜索不到指定设备
发布于 5 年前 作者 szeng 10206 次浏览 来自 问答

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

/**

  * 搜索蓝牙设备

  */

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);

}

})

})

},

1 回复

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

android版本:6.0.1微信版本:6.7.1321

回到顶部