如何监听已连接蓝牙的RSSI
发布于 5 年前 作者 min81 9545 次浏览 来自 问答

onReady: function () {

var that = this;

setInterval(function () {

wx.getBluetoothDevices({

success: function(res) {

var devices = res.devices;

for(var i in devices){

console.log('设备: ’ + devices[i][‘RSSI’])  

var device = devices[i]

if (device.name === that.data.deviceName_L){

that.setData({

rssi_L: device[‘RSSI’]

})

} else if (device.name === that.data.deviceName_R){

that.setData({

rssi_R: device[‘RSSI’]

})

}

}

},

})

}, 1000)

},

每次都RSSI 都是一样的,没有变化.

1 回复

我这边看看能否下版本支持。

回到顶部