From 3829145e51989710238d02bb79080a84d81a4b00 Mon Sep 17 00:00:00 2001 From: Michael Dietz Date: Fri, 26 Feb 2016 15:35:27 +0100 Subject: [PATCH] Change order of parameters of provision(). --- dist/dfu.js | 4 ++-- example_node.js | 2 +- example_web.html | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dist/dfu.js b/dist/dfu.js index 28ce01f..a490392 100644 --- a/dist/dfu.js +++ b/dist/dfu.js @@ -162,11 +162,11 @@ return view; } - function provision(device, arrayBuffer, imageType, crc) { + function provision(device, arrayBuffer, crc, imageType) { return new Promise(function(resolve, reject) { var versionChar = null; - imageType = imageType || ImageType.Application; initPacket.crc = crc || 0xFFFF; // Not used in mbed/ older bootloader revisions. + imageType = imageType || ImageType.Application; connect(device) .then(function(chars) { diff --git a/example_node.js b/example_node.js index ab43162..8568252 100644 --- a/example_node.js +++ b/example_node.js @@ -43,7 +43,7 @@ dfu.findDevice({ services: [0x180D] }) log("file length: " + buffer.byteLength); var crc = crc16(buffer); - return dfu.provision(device, buffer, 4, crc); + return dfu.provision(device, buffer, crc); }) .then(() => process.exit()) .catch(error => { diff --git a/example_web.html b/example_web.html index f8347b4..d5a82fd 100644 --- a/example_web.html +++ b/example_web.html @@ -71,7 +71,7 @@ log("downloaded length: " + buffer.byteLength); var crc = crc16(buffer); - return dfu.provision(device, buffer, 4, crc); + 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. }) .then(() => { log('dfu complete');