搜尋套件、儲存庫與 APP 分類

套件詳情v3.0.0

flutter_nordic_dfu

此程式庫可讓您對 Nordic Semiconductor 的 nrf51 或 nrf52 芯片執行裝置韌體更新 (DFU)。目前僅支援 Android。

AndroidiOS
近 30 天下載
76
喜歡數
24
Pub 分數
135

安裝套件

flutter pub add flutter_nordic_dfu

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

flutter_nordic_dfu 是一個 Flutter 套件,可為 Nordic Semiconductor 的 nRF51 和 nRF52 芯片啟用設備固件更新(DFU)。它可在 Android 裝置上實現空中固件更新,利用 Nordic DFU 協定。該套件與針對 Android 的 Flutter 應用無縫整合,提供簡單直覺的 API 來啟動和管理固件升級。儘管目前僅限於 Android,但可透過藍牙低功耗實現安全可靠的固件傳輸。此函式庫非常適合需要遠端設備維護的物聯網應用。

適用情境

  • BLE設備的遠端韌體更新
  • 在野外更新基於nRF5x的硬體
  • Android環境中的物聯網裝置管理
  • 空中設備維護
  • 嵌入式系統固件升級

主要特色

  • 支援 nRF51 和 nRF52 芯片
  • 僅限 Android 的實作
  • 藍牙低功耗整合
  • 安全固件傳輸
  • 簡單的 Flutter API
  • 北歐DFU協議合規性

適合對象

  • 使用nRF晶片的物聯網開發者
  • 面向Android的BLE應用
  • 韌體更新自動化
  • 硬體產品維護人員
  • 嵌入式設備的移動應用開發者

使用建議

  • 僅限 Android 平台
  • 需要相容的nRF硬體
  • 無 iOS 支援
  • 需要藍牙權限
  • 韌體檔案格式必須適用於 Nordic DFU

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

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

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。