nordic_dfu

v7.2.1

This library allows you to do a Device Firmware Update (DFU) of your nrf51 or nrf52 chip from Nordic Semiconductor. Fork of flutter-nordic-dfu.

Архив пакета: https://pubdev.letsnova.ru/api/archives/nordic_dfu/7.2.1.tar.gz

Установкаdart pub add nordic_dfu

README

nordic_dfu

style: very good analysis pub package GitHub Sponsors

Fork from flutter_nordic_dfu and updated with latest dependencies, now with macOS support from version 6.0.0.

This library allows you to do a Device Firmware Update (DFU) of your nrf51 or nrf52 chip from Nordic Semiconductor. It works for Android, iOS, and MacOS.

This is the implementation of the reference "react-native-nordic-dfu"

For more info about the DFU process, see: Resources

Run example

  1. Add your dfu zip file to example/assets/file.zip

  2. Run example project

  3. Scan device

  4. Start dfu

Usage

You can pass an absolute file path or asset file to NordicDfu

Use absolute file path
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');
                      },
                    );
                
Use asset file path
/// just set [fileInAsset] true
                await NordicDfu().startDfu(
                            'EB:75:AD:E3:CA:CF', 'assets/file.zip',
                            fileInAsset: true,
                         );
                

Parallel DFU

Available from version 7.0.0

Concurrent DFU Processes

  • DFU operations can run simultaneously on multiple devices.
  • Callbacks are triggered correctly and independently for each device.

Interface change

  • Updated abortDfu method to include an optional address parameter:
    • If an address is provided: The DFU process for the specified device will be aborted. (iOS only)
    • If no address is provided: All active DFU processes will be aborted.
  • Added error handling for abortDfu:
    • FlutterError("INVALID_ADDRESS") is thrown if the provided address does not match any active DFU process.
    • FlutterError("NO_ACTIVE_DFU") is thrown if no address is provided and there are no active DFU processes.

iOS

  • ✅ Devices update in parallel.
  • ✅ Callbacks set in startDfu are called independently for each device.
  • ✅ All active DFU processes can be aborted using the abortDfu method without an address.
  • ✅ DFU processes can be individually aborted using the abortDfu method with an address.

Android

  • ✅ Devices update in parallel (set limit of 8).
  • ✅ Callbacks set in startDfu are called independently for each device.
  • ✅ All active DFU processes can be aborted using the abortDfu method without an address.
  • ❌ DFU processes cannot be individually aborted using the abortDfu method with an address due to current limitations in the underlying Android-DFU-Library.
  • ⚠️ Devices with adjacent addresses (…:46 and …:47) should be updated one after another. A device in bootloader mode advertises with its address incremented by one, so the Android-DFU-Library cannot tell such a pair apart and may report their events against the wrong device. A warning is logged when this is detected.

Address Mapping

A device performing a buttonless update reboots into its bootloader, which commonly advertises with a different BLE address (usually the original one, last byte incremented). The plugin handles this: every event is reported with the address you passed to startDfu, on every platform, for the whole update.

setAddressMapping, getTranslatedAddress, removeAddressMapping and clearAddressMappings are therefore deprecated and will be removed in a future release. Delete your calls to them, along with any bootloader scanning that existed only to feed them — no replacement is needed.

Resources

История изменений

Changelog

7.2.1 (2026-08-24)

Bug Fixes

  • apple: update nordic dfu cocoapod to 4.17.0

7.2.0 (2026-08-17)

Features

  • android: support for agp 9 (f64f0d7)

Bug Fixes

  • android: remove obsolete jetifier & raise gradle heap (725dfac)
  • android: resolve original device address for DFU callbacks (#283) (e3ee1d1)

7.1.3

Improvements:

  • [Darwin] Correct package identity for IOS-DFU-Library dependency.

7.1.2

Improvements:

  • [Android] Updated Nordic DFU Library to version 2.11.0. This update should fix onDeviceConnecting and onDeviceDisconnecting not being called.
  • [Android] Updated Kotlin to version 2.3.10.

7.1.1

New features:

  • Update address mapping so that it works with both the original address as the changed address.
  • [Darwin] Support for Swift Package Manager.
  • [Darwin] Adds PrivacyInfo.

7.1.0

New Features:

  • Added address mapping logic to handle address changes during DFU process.
  • Added increment UUID support to example app.
  • [Android] Added mbrSize, scope and currentMtu parameters to callback.
  • [Darwin] Callback can now be set in constructor.

Breaking Changes:

  • [Darwin] Changed onFirmwareUploading to onDfuProcessStarted to match Android implementation.

Bug Fixes:

  • Fixed deprecation warning.
  • Fixed onFirmwareUploading calling wrong event.
  • Fixed function not being awaited.
  • [Android] Fixed missing .zip extension to temp asset file path.
  • Separated DFU logic from Flutter logic.

Other Changes:

  • Made dispose async, due to underlying events.cancel being async.
  • [Android] Updated Nordic DFU Library to version 2.10.1.
  • [Android] Updated Kotlin to version 2.2.21.
  • [Android] Updated Gradle to version 8.13.1.
  • [Android] Updated minSDK and compileSDK.
  • [Darwin] Updated iOS files for latest Flutter version.
  • Improved example app with DFU service selector, address mapping example, and event ordering.

7.0.0

New Features:

  • Added parallel DFU support (thanks @Flasher-MS !)
  • iOS and macOS implementation have been merged in one Darwin implementation, and now share the same functionality.

Other Changes:

  • All callbacks in startDfu() have been moved to DfuEventHandler class.
  • AndroidSpecialOption() and IosSpecialOption() have been deprecated in favor of AndroidOptions() and DarwinOptions().
  • [Android] Updated Nordic DFU Library to version 2.8.0
  • [Darwin] Updated Nordic DFU Library to version 4.16.0
  • [Android] Updated compileSdk to 35.

6.2.0

  • [Android] Updated Nordic DFU Library to version 2.5.0
  • [iOS & macOS] Updated Nordic DFU Library to version 4.15.3

6.1.4+hotfix

  • [Android] Updated Nordic DFU Library to version 2.4.2
  • [iOS] Updated Nordic DFU Library to version 4.15.0
  • [macOS] Updated Nordic DFU Library to version 4.15.0

6.1.4

  • [Android] Updated Nordic DFU Library to version 2.4.2
  • [iOS] Updated Nordic DFU Library to version 4.15.0

6.1.3

  • [Android] Updated Nordic DFU Library to version 2.3.1
  • [Android] Fix crash on Android 14

6.1.2

  • [Android] Fixed an issue which caused DFU to not work.

6.1.1

  • [Android] Fix rebootTime parameter to convert to Long from Int (thanks @rstewart22 !)
  • [Android] Fix build for older AGP versions.

6.1.0

  • [Android] Added rebootTime parameter.
  • [Android] Upgraded to gradle 8.

6.0.1

[Android] Fixed an exception when starting DFU.

6.0.0

macOS is now supported! The configuration is the same as for iOS.

Other changes:

  • [Android] Add dataDelay and numberOfRetries parameters to androidSpecialParameter.
  • [iOS] packetReceiptNotificationParameter parameter is added. Set this to 1 if you get error 308.

5.2.1

[Android] revert kotlin 1.8.0 to 1.7.10 due to compatibility issues.

5.2.0

[Android] Updated Nordic DFU Library to version 2.3.0

5.1.2

  • [Android] Updated Nordic DFU Library to version 2.2.2
  • Updated example app dependencies.

5.1.1

  • [iOS] Fixed build for iOS.

5.1.0

  • [Android] Fixed an issue which caused the callback to fail.
  • [Android] Upgraded Nordic DFU Library to version 2.2.0
  • [iOS] Upgraded Nordic DFU POD to version 4.13.0

5.0.1

  • [Android] Upgraded Nordic DFU Library to version 2.0.3
  • Upgraded some dependencies

5.0.0

BREAKING CHANGES: Callback is now handled through functions in the StartDfu() method. Please see the example app for an example.

Bugs fixed: Fixed callback not being called on both Android and iOS.

4.0.0

BREAKING CHANGES: NordiDfu now uses a Singelton! The notation changes from NordicDfu.startDfu() to NordicDfu().startDfu()

New Features:

  • Upgraded Nordic-DFU-Library to 2.0.2
  • Upgraded Android Bluetooth Permissions.
  • Upgraded other minor dependencies.
  • Upgraded flutter_lints to lint for stricter analyzer.

3.3.0

  • Upgraded Android Dependency to 1.12.1-beta01
  • Upgraded Android Gradle

3.2.0

  • Upgraded iOS Pod to 4.11.1
  • Upgraded Android Dependency to 1.12.0
  • Applied flutter_lints suggestion
  • Upgraded gradle

3.1.0

  • Upgraded iOS Pod to 4.10.3
  • Added api docs

3.0.0

  • Upgraded to null-safety
  • Upgraded to Android Embedding V2
  • Update Android library to 1.11.1
  • Migrated from java to kotlin
  • Add pedantic and format accordingly
  • Updated several other dependencies

Changes from flutter_nordic_dfu

2.4.0

  • Update Android library to 1.10.1

2.3.0

  • Update iOS library to 4.5.1

2.2.1

  • add android x depend

2.2.0

  • Add example project
  • Cancel notification when dfu complete

2.1.0

  • Fix android 8+ notification error
  • Add some android parameter to dfu lib
  • Add forceDfu parameter to dfu lib

2.0.0

  • Add asset file support

1.2.0

  • Update iOS dependency to 4.4.2

1.1.0

  • Convert android kotlin code to java

1.0.0

  • Add DefaultDfuProgressListenerAdapter

0.5.0+2

  • fix pod bug

0.5.0

  • change dfu iOS dependency version
  • this version has bug, do not use

0.4.0

  • migrate to android x

0.3.0

  • Down kotlin version to 1.2.71

0.2.1

  • Update android kotlin version to 1.3.21
  • Update com.android.tools.build:gradle to 3.3.1

0.2.0

  • Finish iOS version

0.1.0

  • Finish android version

0.0.1

  • Init the package.