kidd3166 190c0255e7 update | преди 2 години | |
---|---|---|
.. | ||
android | преди 2 години | |
ios | преди 2 години | |
lib | преди 2 години | |
CHANGELOG.md | преди 2 години | |
LICENSE | преди 2 години | |
README.md | преди 2 години | |
analysis_options.yaml | преди 2 години | |
pubspec.lock | преди 2 години | |
pubspec.yaml | преди 2 години |
From version 5.0.0, the callbacks are defined as function parameters in NordicDfu().startDfu(). Please see the example app for more information.
From version 4.0.0, the NordicDfu class uses a Singleton. If you are comming from an older version, you have to change the notation from NordicDfu.startDfu() to NordicDfu().startDfu().
Fork from flutter_nordic_dfu and updated with latest dependencies.
This library allows you to do a Device Firmware Update (DFU) of your nrf51 or nrf52 chip from Nordic Semiconductor. It works for Android and iOS.
This is the implementation of the reference "react-native-nordic-dfu"
For more info about the DFU process, see: Resources
Add your dfu zip file to example/assets/file.zip
Run example project
Scan device
Start dfu
You can pass an absolute file path or asset file to NordicDfu
await NordicDfu().startDfu(
'EB:75:AD:E3:CA:CF', '/file/to/zip/path/file.zip'
);
// With callback
await NordicDfu().startDfu(
'EB:75:AD:E3:CA:CF',
'assets/file.zip',
fileInAsset: true,
onProgressChanged: (
deviceAddress,
percent,
speed,
avgSpeed,
currentPart,
partsTotal,
) {
print('deviceAddress: $deviceAddress, percent: $percent');
},
);
/// just set [fileInAsset] true
await NordicDfu().startDfu(
'EB:75:AD:E3:CA:CF', 'assets/file.zip',
fileInAsset: true,
);