|
@@ -162,7 +162,7 @@ function getSecret(deviceId, serviceId, characteristicId, client, kBytes, pBytes
|
|
getSecret(deviceId, serviceId, characteristicId, client, kBytes, pBytes, gBytes, obj.laveData);
|
|
getSecret(deviceId, serviceId, characteristicId, client, kBytes, pBytes, gBytes, obj.laveData);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- fail: function (res) { }
|
|
|
|
|
|
+ fail: function (res) {}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
@@ -192,7 +192,7 @@ function writeDeviceRouterInfoStart(deviceId, serviceId, characteristicId, data)
|
|
writeRouterSsid(deviceId, serviceId, characteristicId, null);
|
|
writeRouterSsid(deviceId, serviceId, characteristicId, null);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- fail: function (res) { }
|
|
|
|
|
|
+ fail: function (res) {}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
@@ -290,7 +290,7 @@ function writeDevicePwd(deviceId, serviceId, characteristicId, data) {
|
|
writeDeviceEnd(deviceId, serviceId, characteristicId, null);
|
|
writeDeviceEnd(deviceId, serviceId, characteristicId, null);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- fail: function (res) { }
|
|
|
|
|
|
+ fail: function (res) {}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
@@ -336,7 +336,7 @@ function init() {
|
|
if (options.isStart) {
|
|
if (options.isStart) {
|
|
//第一步检查蓝牙适配器是否可用
|
|
//第一步检查蓝牙适配器是否可用
|
|
wx.onBluetoothAdapterStateChange(function (res) {
|
|
wx.onBluetoothAdapterStateChange(function (res) {
|
|
- if (!res.available) { }
|
|
|
|
|
|
+ if (!res.available) {}
|
|
});
|
|
});
|
|
if (!itue) {
|
|
if (!itue) {
|
|
return;
|
|
return;
|
|
@@ -399,16 +399,21 @@ function init() {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (isnotexist) {
|
|
if (isnotexist) {
|
|
-
|
|
|
|
|
|
+
|
|
let name = devices.devices[0].name ?? ""
|
|
let name = devices.devices[0].name ?? ""
|
|
let localName = devices.devices[0].localName ?? ""
|
|
let localName = devices.devices[0].localName ?? ""
|
|
|
|
+ //AIrSMArT_d03110061a08
|
|
// AIrSMArT_d03110c71019
|
|
// AIrSMArT_d03110c71019
|
|
- if (name.includes("AIrSMArT") || localName.includes("AIrSMArT")) {
|
|
|
|
- // devices.devices[0].name = name.includes("AIrSMArT") ? name : localName
|
|
|
|
- console.log("打印2", JSON.stringify(devices.devices[0]))
|
|
|
|
- devicesList.push(devices.devices[0])
|
|
|
|
|
|
+ if (name.includes("MW_BLE") && localName === "") {} else {
|
|
|
|
+ devices.devices[0].name = localName;
|
|
|
|
+ devicesList.push(devices.devices[0]);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // if (name.includes("AIrSMArT") || localName.includes("AIrSMArT")) {
|
|
|
|
+ // // devices.devices[0].name = name.includes("AIrSMArT") ? name : localName
|
|
|
|
+ // console.log("打印2", JSON.stringify(devices.devices[0]))
|
|
|
|
+ // }
|
|
|
|
+
|
|
}
|
|
}
|
|
} else if (devices[0]) {
|
|
} else if (devices[0]) {
|
|
if (devices[0].advertisData) {
|
|
if (devices[0].advertisData) {
|