mirror of
https://github.com/thegecko/web-bluetooth-dfu.git
synced 2025-12-12 20:18:13 +08:00
Add default crc if not specified
This commit is contained in:
@@ -27,7 +27,6 @@
|
||||
|
||||
<script src="dist/dfu.js"></script>
|
||||
<script src="dist/hex2bin.js"></script>
|
||||
<script src="dist/crc16.js"></script>
|
||||
|
||||
<script>
|
||||
var resultsEl = document.getElementById("results");
|
||||
@@ -69,9 +68,10 @@
|
||||
.then(hex => {
|
||||
var buffer = hex2bin(hex);
|
||||
log("downloaded length: " + buffer.byteLength);
|
||||
var crc = crc16(buffer);
|
||||
|
||||
return dfu.provision(device, buffer, crc); // dfu.ImageType.Application is the default value for the fourth parameter. Specify this if you want to upload a softdevice/bootloader.
|
||||
// dfu.ImageType.Application is the default value for the third parameter
|
||||
// Specify this if you want to upload a softdevice/bootloader
|
||||
return dfu.provision(device, buffer);
|
||||
})
|
||||
.then(() => {
|
||||
log('dfu complete');
|
||||
|
||||
Reference in New Issue
Block a user