mirror of
https://github.com/thegecko/web-bluetooth-dfu.git
synced 2025-12-12 12:08:13 +08:00
Promise in transfer(...) should resolve after DFU Target is activated and reset.
This commit is contained in:
1
dist/dfu.js
vendored
1
dist/dfu.js
vendored
@@ -397,6 +397,7 @@
|
||||
controlChar.writeValue(new Uint8Array([5]))
|
||||
.then(() => {
|
||||
log('image activated and dfu target reset');
|
||||
resolve(); // TODO: Resolve in disconnect event handler when implemented in Web Bluetooth API.
|
||||
})
|
||||
.catch(error => {
|
||||
error = "error resetting: " + error;
|
||||
|
||||
@@ -36,8 +36,8 @@
|
||||
|
||||
function transfer(device) {
|
||||
return new Promise(function(resolve, reject) {
|
||||
//var url = urlMask.replace("{0}", device.name === "Hi_Rob" ? "Bye" : "Hi");
|
||||
var url = urlMask52; // nRF52832 application (example BLE heart rate from Nordic SDK) for DFU OTA update.
|
||||
var url = urlMask.replace("{0}", device.name === "Hi_Rob" ? "Bye" : "Hi");
|
||||
//var url = urlMask52; // nRF52832 application (example BLE heart rate from Nordic SDK) for DFU OTA update.
|
||||
|
||||
download(url)
|
||||
.then(hex => {
|
||||
|
||||
Reference in New Issue
Block a user