Add default crc if not specified

This commit is contained in:
Rob Moran
2016-02-27 14:07:34 +00:00
parent 3de7ca6765
commit e2a427d094
5 changed files with 13 additions and 18 deletions

View File

@@ -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');