|
@@ -91,7 +91,7 @@ Page({
|
|
|
var hasWifi = false;
|
|
|
var bleDevice;
|
|
|
let that = this
|
|
|
- this.data.deviceList.forEach(device => {
|
|
|
+ that.data.deviceList.forEach(device => {
|
|
|
if (device.connectType == 1) {
|
|
|
hasBle = true
|
|
|
if (device.state == "online") {
|
|
@@ -150,13 +150,13 @@ Page({
|
|
|
|
|
|
async compareList() {
|
|
|
var that = this;
|
|
|
- if (BtHelper.getInstance().getCallBackConnect() == null) {
|
|
|
- var compareList = BtHelper.getInstance().getCompareList();
|
|
|
- if (compareList.length > 0) {
|
|
|
- ///对比在线的蓝牙设备
|
|
|
- var isChanged = false;
|
|
|
- var tempList = that.data.deviceList;
|
|
|
- if (tempList.length > 0) {
|
|
|
+ var tempList = that.data.deviceList;
|
|
|
+ if (tempList.length > 0) {
|
|
|
+ if (BtHelper.getInstance().getCallBackConnect() == null) {
|
|
|
+ var compareList = BtHelper.getInstance().getCompareList();
|
|
|
+ if (compareList.length > 0) {
|
|
|
+ ///对比在线的蓝牙设备
|
|
|
+ var isChanged = false;
|
|
|
for (var i = 0; i < tempList.length; i++) {
|
|
|
var tempItem = tempList[i];
|
|
|
if (tempItem.connectType != 3) {
|
|
@@ -205,9 +205,8 @@ Page({
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ BtHelper.getInstance().startScan(null, null, null);
|
|
|
}
|
|
|
- await BtHelper.getInstance().stopSearch();
|
|
|
- BtHelper.getInstance().startScan(null, null, null);
|
|
|
}
|
|
|
},
|
|
|
|