|
@@ -65,7 +65,7 @@ class BleUtil {
|
|
await that.disconnect(device);
|
|
await that.disconnect(device);
|
|
|
|
|
|
var res = await that.manager.startConnect(device);
|
|
var res = await that.manager.startConnect(device);
|
|
- if (res === false) {
|
|
|
|
|
|
+ if (!res) {
|
|
onChanged(false, device);
|
|
onChanged(false, device);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -77,11 +77,7 @@ class BleUtil {
|
|
return;
|
|
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) {
|
|
async function (notifyServiceId, notifyCharaterId) {
|
|
var isTrue = that.manager.monitorCharacteristicValueChange(device, notifyServiceId, notifyCharaterId);
|
|
var isTrue = that.manager.monitorCharacteristicValueChange(device, notifyServiceId, notifyCharaterId);
|
|
if (!isTrue) {
|
|
if (!isTrue) {
|