|
@@ -110,7 +110,7 @@ class bleManager {
|
|
|
// }
|
|
|
console.log("2222:", temp.mac, ":", temp.mac2, ":", temp.deviceId, temp, temp.connectable);
|
|
|
|
|
|
- // if ((temp.deviceId === "07:F6:F4:66:FB:FA")) {
|
|
|
+ // if ((temp.deviceId.indexOf("1f:de") ) > -1) {
|
|
|
// that.callBackConnect(temp);
|
|
|
// }
|
|
|
that.callBackConnect(temp);
|
|
@@ -504,6 +504,7 @@ class bleManager {
|
|
|
that.disconnect({ "deviceId": device.deviceId })
|
|
|
} else {
|
|
|
that.isConnecting = false;
|
|
|
+ console.log("监听到设备状态变化3:", err);
|
|
|
that.errorDisconnect({ "deviceId": device.deviceId, "state": "offline" })
|
|
|
let publicDevice = that.publicDevice ?? {}
|
|
|
if (device.deviceId == publicDevice.deviceId) {
|
|
@@ -555,7 +556,7 @@ class bleManager {
|
|
|
if (callback) {
|
|
|
callback(false)
|
|
|
}
|
|
|
- console.log('数据发送失败:', err);
|
|
|
+ console.log('监听到设备状态变化4:', err);
|
|
|
that.errorDisconnect({ "deviceId": that.publicDevice.deviceId, "state": "offline" })
|
|
|
resolve(false);
|
|
|
}
|
|
@@ -762,7 +763,7 @@ class bleManager {
|
|
|
}
|
|
|
errorDisconnect(result) {
|
|
|
// this.disconnect();
|
|
|
- console.log("监听到设备状态变化1:", result.deviceId, result.connected, this.stateChangeCallback);
|
|
|
+ console.log("监听到设备状态变化1:", result.deviceId, result.state, this.stateChangeCallback);
|
|
|
if (this.stateChangeCallback && result.deviceId) {
|
|
|
this.stateChangeCallback(result);
|
|
|
}
|