var that = this;
wx.openBluetoothAdapter({
success: function (res) {
// success
console.log(“初始化成功”)
console.log(res);
wx.startBluetoothDevicesDiscovery({
success: function (res) {
console.log(“搜索成功”)
console.log(res);
var index = 0
// var interval = setInterval(function() {
wx.getBluetoothDevices({
success: function (res) {
console.log(“get成功”);
console.log(res);
var devices = res.devices
},
fail: function (res) {
console.log(“get失败”);
console.log(res)
},
complete: function () {
index++
if (index == 5) {
clearInterval(interval)
}
}
})
// }, 1000)
},
fail: function (res) {
console.log(“搜索失败”)
console.log(res);
},
})
},
fail: function (res) {
console.log(“初始化失败”)
console.log(res);
wx.showToast({
title: ‘没有打开蓝牙’,
})
},
})
怎么获取到的全是未知设备 我在网上看了一些例子不是这样的啊 是不是我哪里写的不对?