|
@@ -21,6 +21,10 @@ class bleManager {
|
|
|
return this.compareList;
|
|
|
}
|
|
|
|
|
|
+ setCompareList(compareList) {
|
|
|
+ this.compareList = compareList;
|
|
|
+ }
|
|
|
+
|
|
|
getDissmissDevice() {
|
|
|
return this.dissmissDevice;
|
|
|
}
|
|
@@ -90,9 +94,9 @@ class bleManager {
|
|
|
if (that.callBackConnect != null) {
|
|
|
for (var i = 0; i < res.devices.length; i++) {
|
|
|
var temp = res.devices[i];
|
|
|
-// if (temp.name == "MW-SR1(4G_WIFI)") {
|
|
|
-// console.log("gadsfqewrqewrqwerqrqr==111==" + JSON.stringify(res.devices[i]));
|
|
|
-// }
|
|
|
+ // if (temp.name == "MW-SR1(4G_WIFI)") {
|
|
|
+ // console.log("gadsfqewrqewrqwerqrqr==111==" + JSON.stringify(res.devices[i]));
|
|
|
+ // }
|
|
|
if (that.connectWillDevice != null && temp.name == that.connectWillDevice.clientType) {
|
|
|
temp.mac = temp.advertisData ? that.buf2hex(temp.advertisData) : '';
|
|
|
if (that.callBackConnect != null) {
|
|
@@ -210,9 +214,9 @@ class bleManager {
|
|
|
var has = false;
|
|
|
for (var j = 0; j < that.compareList.length; j++) {
|
|
|
if (res.devices[i].name != "") {
|
|
|
-// if (res.devices[i].name == "MW-SR1(4G_WIFI)") {
|
|
|
-// console.log("gadsfqewrqewrqwerqrqr==000==" + JSON.stringify(res.devices[i]));
|
|
|
-// }
|
|
|
+ // if (res.devices[i].name == "MW-SR1(4G_WIFI)") {
|
|
|
+ // console.log("gadsfqewrqewrqwerqrqr==000==" + JSON.stringify(res.devices[i]));
|
|
|
+ // }
|
|
|
if (res.devices[i].deviceId == that.compareList[j].deviceId) {
|
|
|
has = true;
|
|
|
break;
|
|
@@ -581,6 +585,8 @@ class bleManager {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ connect() {}
|
|
|
+
|
|
|
// 发现特征值 read / write
|
|
|
discoverCharacteristics(deviceId, serviceId) {
|
|
|
var that = this;
|