修复有时候蓝牙配对成功依然提示未连接的异常
This commit is contained in:
@ -557,14 +557,22 @@
|
||||
if (ble) {
|
||||
|
||||
let f = ble.data.LinkedList.find((v) => {
|
||||
if (v.macAddress == this.itemInfo.deviceMac) {
|
||||
if (!this.formData.deviceId) {
|
||||
this.formData.deviceId = v.deviceId
|
||||
};
|
||||
return true;
|
||||
let flag = v.macAddress == these.device.deviceMac;
|
||||
if (!flag && v.device) {
|
||||
flag = v.device.id == these.device.id;
|
||||
}
|
||||
if (flag) {
|
||||
these.formData.deviceId = v.deviceId;
|
||||
}
|
||||
return flag;
|
||||
});
|
||||
|
||||
// #ifdef WEB
|
||||
f = {
|
||||
deviceId: '123'
|
||||
}
|
||||
// #endif
|
||||
|
||||
return f;
|
||||
}
|
||||
return null;
|
||||
@ -692,7 +700,7 @@
|
||||
deviceRecovry(res) {
|
||||
console.log('蓝牙连接成功');
|
||||
if (res.deviceId == this.formData.deviceId) {
|
||||
this.formData.bleStatu = true;
|
||||
this.formData.bleStatu = true;
|
||||
}
|
||||
|
||||
},
|
||||
@ -2117,14 +2125,7 @@
|
||||
this.initBle();
|
||||
|
||||
console.log("ble=", ble);
|
||||
let f = ble.data.LinkedList.find((v) => {
|
||||
if (v.macAddress == this.itemInfo.deviceMac) {
|
||||
console.log("找到设备了", v);
|
||||
these.formData.deviceId = v.deviceId;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
let f = these.getDevice();
|
||||
|
||||
if (f) {
|
||||
these.formData.bleStatu = 'connecting';
|
||||
|
||||
Reference in New Issue
Block a user