From abbd0bc818e85743f808f7f68629b1363c008b87 Mon Sep 17 00:00:00 2001 From: Michael Dietz Date: Thu, 10 Mar 2016 12:42:42 +0100 Subject: [PATCH 1/2] Add timeouts so entire DFU process works. --- dist/dfu.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/dist/dfu.js b/dist/dfu.js index 6f7ffe7..bb201d3 100644 --- a/dist/dfu.js +++ b/dist/dfu.js @@ -134,6 +134,9 @@ }) .then(function() { log("modeData written"); + setTimeout(function() { // TODO: Remove this when gattserverdisconnected event is implemented and possibly put a timeout in that event handler before resolving. + resolve(device); + }, 2000); }) .catch(function(error) { error = "writeMode error: " + error; @@ -215,7 +218,12 @@ device.gatt.connect() .then(function(gattServer) { log("connected to device"); - server = gattServer; + return new Promise(function(resolve) { + server = gattServer; + setTimeout(resolve, 2000); // This delay is needed because BlueZ needs time to update it's cache. + }); + }) + .then(function() { return server.getPrimaryService(serviceUUID); }) .then(function(primaryService) { From 39b462a4aea958f4f2e8eda10fea99308909cb74 Mon Sep 17 00:00:00 2001 From: Michael Dietz Date: Thu, 10 Mar 2016 12:44:24 +0100 Subject: [PATCH 2/2] SoftDevice, bootloader updates work with nRF51/mbed as well - just haven't included files to test in /firmware --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c18c613..f856a95 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ $ node example_node Where `````` is one of ```nrf51``` or ```nrf52```. -## Updating the SoftDevice or Bootloader (nRF52 only) +## Updating the SoftDevice or Bootloader The ```.hex``` files below can be transferred via DFU to test SoftDevice and Bootloader updates respectivley: