dfu-js
This JS library was build against Nordic Semiconductors nRF SDK 12.3 using the secure bootloader. The library requires Chrome 56 on Linux and Mac and Chrome 70 on Windows 10 which is partial support for Web Bluetooth was introduced. Other browswers have not fully or partially implemented Web Bluetooth.
The package also includes a Vue.js Mixin that sets up few useful computed properties. See this gist of a vue component.
A demo web applicatiion using this library and web-bluetooth-vuex is available here, Chrome only.
Installation
$ yarn add dfu-js# OR$ npm install dfu-js
Usage
an semi pseduo code example on how to use the library straight.
/**... Assume you discovered a ble device and aquired the service and characteristic needed. Servie uuid DFUServiceUUID.DFU and characteristics DFUCharacteristicUUID.PacketPoint, DFUCharacteristicUUID.ControlPoint**/ //Create a dfu object with the characteristicsconst dfu = /** load fileContentStream from a url or a local file**/const zip = await zipconst dfuFirmware = zipawait dfuFirmware /** Register for events fired by the dfu**/dfudfu /** Finally send the firmware update and await the callbacks to indicate sucess or failure. Besides the callvack the current state is expressed in dfu.state and dfu.progress**/dfu