mirror of
https://github.com/thegecko/web-bluetooth-dfu.git
synced 2025-12-12 12:08:13 +08:00
device.connectGATT() deprecated. No need for notification callback handler in writeMode().
This commit is contained in:
7
dist/dfu.js
vendored
7
dist/dfu.js
vendored
@@ -130,7 +130,6 @@
|
|||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
log("writing modeData");
|
log("writing modeData");
|
||||||
controlChar.addEventListener('characteristicvaluechanged', handleNotifications);
|
|
||||||
return controlChar.writeValue(new Uint8Array([1, 4]));
|
return controlChar.writeValue(new Uint8Array([1, 4]));
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
@@ -142,10 +141,6 @@
|
|||||||
log(error);
|
log(error);
|
||||||
reject(error);
|
reject(error);
|
||||||
});
|
});
|
||||||
|
|
||||||
function handleNotifications(event) {
|
|
||||||
log('received notification on control characteristic - ERROR this should not happen');
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -217,7 +212,7 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
device.connectGATT()
|
device.gatt.connect()
|
||||||
.then(gattServer => {
|
.then(gattServer => {
|
||||||
// Connected
|
// Connected
|
||||||
server = gattServer;
|
server = gattServer;
|
||||||
|
|||||||
Reference in New Issue
Block a user