mirror of
https://github.com/thegecko/web-bluetooth-dfu.git
synced 2026-03-15 13:13:19 +08:00
Merge pull request #81 from gfwilliams/master
If DFU update fails, automatically try again but with a delay between writes
This commit is contained in:
@@ -548,7 +548,14 @@ export class SecureDfu extends EventDispatcher {
|
||||
resolve(device);
|
||||
});
|
||||
})
|
||||
.catch(error => reject(error));
|
||||
.catch(error => {
|
||||
if (this.delay === 0) {
|
||||
this.log("DFU update failed, but delay=0. Trying again with delay=10...");
|
||||
this.delay = 10;
|
||||
return this.update(device, init, firmware);
|
||||
}
|
||||
reject(error);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user