Преглед изворни кода

feature: 代码优化与数据处理

Damon пре 7 месеци
родитељ
комит
de904b1e8a
1 измењених фајлова са 2 додато и 6 уклоњено
  1. 2 6
      utils/blue_ble/util.js

+ 2 - 6
utils/blue_ble/util.js

@@ -65,7 +65,7 @@ class BleUtil {
     await that.disconnect(device);
 
     var res = await that.manager.startConnect(device);
-    if (res === false) {
+    if (!res) {
       onChanged(false, device);
       return;
     }
@@ -77,11 +77,7 @@ class BleUtil {
       return;
     }
 
-    var index = 0;
-    var notify = false;
-    var write = false;
-    var read = false;
-    that.manager.getCharacteristics(device, services, index, notify, write, read,
+    that.manager.getCharacteristics(device, services, 0, false, false, false,
       async function (notifyServiceId, notifyCharaterId) {
           var isTrue = that.manager.monitorCharacteristicValueChange(device, notifyServiceId, notifyCharaterId);
           if (!isTrue) {