如何监听已连接蓝牙的RSSI
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 都是一样的,没有变化.