This library allows you to do a Device Firmware Update (DFU) of your nrf51 or nrf52 chip from Nordic Semiconductor from Flutter Web
add this package to pubspec.yaml file
nordic_dfu_web: 0.0.7
add this script tag in web/index.html file inside of head tag (check example folder)
<script src="./assets/packages/nordic_dfu_web/assets/ble.js" defer></script>
To Start Dfu, Pick a file by using any File Picker Plugin and convert File to buffer, pass that buffer to this method and start DFU
Note: startDfu will open dialog to choose for a Device if , that device is already in Dfu mode , then it will start transferring firmware else ,device will be booted to Dfu and and it will throw an error, Also try to increase dfuDelay if getting any issue while transferring, to add filters, pass a list of requestBuilderFilter object, if passed an empty list , all devices will be shown in request builder
await NordicDfuWeb.startDfu(
uint8list: bytes,
requestBuilderFilters: [],
dfuDelay: 25,
onProgress: (progress) {
print(progress);
},
onComplete: (data) {
print(data);
},
onError: (err) {
print(err);
},
onLogs: (logs) {
print(logs);
},
);
Host example
Added longer examples to /example folder.
- DFU Introduction
- Secure DFU Introduction
- How to create init packet
- nRF51 Development Kit (DK) (compatible with Arduino Uno Revision 3)
- nRF52 Development Kit (DK) (compatible with Arduino Uno Revision 3)
This is Just The Initial Version feel free to Contribute or Report any Bug!