mirror of
https://github.com/thegecko/web-bluetooth-dfu.git
synced 2026-04-02 09:15:07 +08:00
If DFU update fails but we're not using any delay between sending packets, try again but with a delay.
This fixes an issue with *some* Windows 11 PCs where a DFU update would fail on the first 4096 byte block Fix #80
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