juliansteenbakker / nordic_dfu

Execute a Device Firmware Update (DFU) on your nRF51 or nRF52 chip from Nordic Semiconductor. Fork from flutter_nordic_dfu.
MIT License
28 stars 29 forks source link

Nothing happens when calling startDfu #110

Closed Roee-Tsur closed 1 year ago

Roee-Tsur commented 1 year ago

Hey, I'm trying to implement the plugin in the most basic way but I get no logs and my callbacks are not called. What might be the problem?

This is my implementation:

if (selectedDfuPath == null) {
                          Fluttertoast.showToast(msg: 'no file selected');
                          return;
                        }
                        String? address = device.getMacAddress();
                        if (address == null) {
                          Fluttertoast.showToast(msg: 'mac address is null');
                          return;
                        }
                        NordicDfu().startDfu(
                          address,
                          selectedDfuPath!,
                          onProgressChanged: (String address,
                              int percent,
                              double speed,
                              double avgSpeed,
                              int currentPart,
                              int totalParts) {
                            setState(() {
                              dfuProgress = percent;
                            });
                          },
                          onDfuCompleted: (String address) =>
                              Fluttertoast.showToast(
                                  msg: 'completed dfu: $address'),
                          onError: (String address, int error, int errorType,
                                  String message) =>
                              Fluttertoast.showToast(
                                  toastLength: Toast.LENGTH_LONG,
                                  msg:
                                      'ERROR:\naddress: $address\nerror: $error\nerror type: $errorType\nmessage: $message'),
                        );
rstewart22 commented 1 year ago

I'm experiencing this issue also on Android, but iOS works

Roee-Tsur commented 1 year ago

@rstewart22 I've reverted to version 6.0.1, works for me on android and ios.

JohanneBoisvilliers commented 1 year ago

even in 6.0.1 I have the same issue, no callbacks called

rstewart22 commented 1 year ago

I found this not working at 6.0.1 on a certain device (Galaxy Tab A) but worked on others

juliansteenbakker commented 1 year ago

This issue has been fixed in v6.1.2