Search packages, repositories and app categories

Package detailsv3.0.0

flutter_nordic_dfu

This library allows you to do a Device Firmware Update (DFU) of your nrf51 or nrf52 chip from Nordic Semiconductor. Currently, it only works for Android.

AndroidiOS
30-day downloads
76
Likes
24
Pub points
135

Install package

flutter pub add flutter_nordic_dfu

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

flutter_nordic_dfu is a Flutter package enabling Device Firmware Update (DFU) for Nordic Semiconductor's nRF51 and nRF52 chips. It facilitates over-the-air firmware updates on Android devices, leveraging the Nordic DFU protocol. The package integrates seamlessly with Flutter apps targeting Android, providing a straightforward API to initiate and manage firmware upgrades. While currently limited to Android, it supports secure and reliable firmware transmission via Bluetooth Low Energy. The library is ideal for IoT applications requiring remote device maintenance.

Use cases

  • Remote firmware updates for BLE devices
  • Updating nRF5x-based hardware in the field
  • IoT device management in Android environments
  • Over-the-air device maintenance
  • Embedded system firmware upgrades

Key features

  • Supports nRF51 and nRF52 chips
  • Android-only implementation
  • Bluetooth Low Energy integration
  • Secure firmware transfer
  • Simple Flutter API
  • Nordic DFU protocol compliance

Suitable for

  • IoT developers using nRF chips
  • Android-focused BLE applications
  • Firmware update automation
  • Hardware product maintainers
  • Mobile app developers for embedded devices

Considerations

  • Limited to Android platform
  • Requires compatible nRF hardware
  • No iOS support
  • Bluetooth permissions required
  • Firmware file format must be valid for Nordic DFU

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

flutter-nordic-dfu pub package

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 fine.

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

For more info about the DFU process, see: Resources

Run Example-->Amazing

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

  2. Run example project

  3. Scan device

  4. Start dfu

Usage

startDFU
Examples

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

Use absolute file path
/// You can define your ProgressListenerListener
await FlutterNordicDfu.startDfu(
            'EB:75:AD:E3:CA:CF', '/file/to/zip/path/file.zip',
            progressListener: ProgressListenerListener(),
         );


class ProgressListenerListener extends DfuProgressListenerAdapter {
  @override
  void onProgressChanged(String deviceAddress, int percent, double speed,
      double avgSpeed, int currentPart, int partsTotal) {
    super.onProgressChanged(
        deviceAddress, percent, speed, avgSpeed, currentPart, partsTotal);
    print('deviceAddress: $deviceAddress, percent: $percent');
  }
}

/// Or you can use DefaultDfuProgressListenerAdapter
await FlutterNordicDfu.startDfu(
      'EB:75:AD:E3:CA:CF',
      'assets/file.zip',
      fileInAsset: true,
      progressListener:
          DefaultDfuProgressListenerAdapter(onProgressChangedHandle: (
        deviceAddress,
        percent,
        speed,
        avgSpeed,
        currentPart,
        partsTotal,
      ) {
        print('deviceAddress: $deviceAddress, percent: $percent');
      }),
    );
Use asset file path
/// just set [fileInAsset] true
await FlutterNordicDfu.startDfu(
            'EB:75:AD:E3:CA:CF', 'assets/file.zip',
            progressListener: ProgressListenerListener(),
            fileInAsset: true,
         );

class ProgressListenerListener extends DfuProgressListenerAdapter {
  @override
  void onProgressChanged(String deviceAddress, int percent, double speed,
      double avgSpeed, int currentPart, int partsTotal) {
    super.onProgressChanged(
        deviceAddress, percent, speed, avgSpeed, currentPart, partsTotal);
    print('deviceAddress: $deviceAddress, percent: $percent');
  }
}

Resources

Categories

Source repository

Projects using this package

No data available yet.