mirror of
https://github.com/thegecko/web-bluetooth-dfu.git
synced 2025-12-12 20:18:13 +08:00
Get rid of warnings due to error being defined as a variable and then used in catch() out of scope.
This commit is contained in:
12
dist/dfu.js
vendored
12
dist/dfu.js
vendored
@@ -270,9 +270,9 @@
|
|||||||
offset = 0;
|
offset = 0;
|
||||||
|
|
||||||
if (!controlChar.properties.notify) {
|
if (!controlChar.properties.notify) {
|
||||||
var error = "controlChar missing notify property";
|
var err = "controlChar missing notify property";
|
||||||
log(error);
|
log(err);
|
||||||
return reject(error);
|
return reject(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
log("enabling notifications");
|
log("enabling notifications");
|
||||||
@@ -317,9 +317,9 @@
|
|||||||
|
|
||||||
if (opCode === OPCODE.RESPONSE_CODE) {
|
if (opCode === OPCODE.RESPONSE_CODE) {
|
||||||
if (resp_code !== 1) {
|
if (resp_code !== 1) {
|
||||||
var error = "error from control: " + resp_code;
|
var err = "error from control: " + resp_code;
|
||||||
log(error);
|
log(err);
|
||||||
return reject(error);
|
return reject(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (req_opcode === OPCODE.START_DFU && majorVersion > 6) {
|
if (req_opcode === OPCODE.START_DFU && majorVersion > 6) {
|
||||||
|
|||||||
@@ -36,8 +36,8 @@
|
|||||||
|
|
||||||
function transfer(device) {
|
function transfer(device) {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
//var url = urlMask.replace("{0}", device.name === "Hi_Rob" ? "Bye" : "Hi");
|
var url = urlMask.replace("{0}", device.name === "Hi_Rob" ? "Bye" : "Hi");
|
||||||
var url = urlMask52; // nRF52832 application (example BLE heart rate from Nordic SDK) for DFU OTA update.
|
//var url = urlMask52; // nRF52832 application (example BLE heart rate from Nordic SDK) for DFU OTA update.
|
||||||
|
|
||||||
download(url)
|
download(url)
|
||||||
.then(hex => {
|
.then(hex => {
|
||||||
|
|||||||
Reference in New Issue
Block a user