jicang / healywatch_reactive

ff
0 stars 3 forks source link

Exception if bluetooth connection is lost on DFU mode #36

Closed aBuder closed 2 years ago

aBuder commented 2 years ago

If I start the Firmware update process and disable Bluetooth if the device is in dfu mode, the device is stocked.

Expected behavior:

If Bluetooth connection is lost while firmware update, the firmware update process should continue also if Bluetooth is available or device with dfu mode.

[log] Firmware Update available
flutter: downloadLatestFirmwareUpdate
flutter: Firmware update will be saved here: /var/mobile/Containers/Data/Application/0556D83E-8827-4077-8CA4-819FB2528CD5/Documents
[log] Downloading Firmware update: 0.0077851647165756216
[log] Downloading Firmware update: 0.02529494557072462
[log] Downloading Firmware update: 0.060314507279022614
[log] Downloading Firmware update: 0.11284384984146961
[log] Downloading Firmware update: 0.18726041847160285
[log] Downloading Firmware update: 0.2966965488100341
[log] Downloading Firmware update: 0.4509741335546375
[log] Downloading Firmware update: 0.5210132569712335
[log] Downloading Firmware update: 0.6677063099048818
[log] Downloading Firmware update: 0.6939709811861052
[log] Downloading Firmware update: 0.7858973306703875
[log] Downloading Firmware update: 0.81439936283853
[log] Downloading Firmware update: 0.901948267109275
[log] Downloading Firmware update: 0.9763648357394082
[log] Downloading Firmware update: 0.9851197261664828
[log] Downloading Firmware update: 1.0
[log] Downloading Firmware finished.
[log] _unZipFirmwareUpdateFile: color565.bin
[log] _unZipFirmwareUpdateFile: color565MD5.txt
flutter: write: 47 00 00 00 00 00 00 00 00 00 00 00 00 00 00 47
[log] _unZipFirmwareUpdateFile: firmware.zip
flutter: notifyData 47 00 00 00 00 00 00 00 00 00 00 00 00 00 00 47
flutter: dfu
flutter: Start ble discovery
[VERBOSE-2:ui_dart_state.cc(209)] Unhandled Exception: Bad state: No element
#0      Stream.first.<anonymous closure> (dart:async/stream.dart:1226:9)
#1      _rootRun (dart:async/zone.dart:1420:47)
#2      _CustomZone.run (dart:async/zone.dart:1328:19)
#3      _CustomZone.runGuarded (dart:async/zone.dart:1236:7)
#4      _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:394:13)
#5      _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:404:7)
#6      _BufferingStreamSubscription._close (dart:async/stream_impl.dart:291:7)
#7      _ForwardingStream._handleDone (dart:async/stream_pipe.dart:99:10)
#8      _ForwardingStreamSubscription._handleDone (dart:async/stream_pipe.dart:161:13)
#9      _rootRun (dart:async/zone.dart:1420:47)
#10     _CustomZone.run (dart:async/zone.dart:1328:19)
#11     _CustomZone.runGuarded (dart:async/zone.dart:1236:7)
#12     _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:394:13)
#13     _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:404:7)
#14     _DelayedDone.perform (dart:async/stream_impl.dart:610:14)
#15     _StreamImplEvents.handleNext (dart:async/stream_impl.dart:706:11)
#16     _PendingEvents.schedule.<anonymous closure> (dart:async/stream_impl.dart:663:7)
#17     _rootRun (dart:async/zone.dart:1420:47)
#18     _CustomZone.run (dart:async/zone.dart:1328:19)
#19     _CustomZone.runGuarded (dart:async/zone.dart:1236:7)
#20     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1276:23)
#21     _rootRun (dart:async/zone.dart:1428:13)
#22     _CustomZone.run (dart:async/zone.dart:1328:19)
#23     _CustomZone.runGuarded (dart:async/zone.dart:1236:7)
#24     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1276:23)
#25     _microtaskLoop (dart:async/schedule_microtask.dart:40:21)
#26     _startMicrotaskLoop (dart:async/schedule_microtask.dart:49:5)
flutter: ConnectionState for device 5D76FBCF-4869-A53B-FD66-102684B5EE74 : DeviceConnectionState.disconnected
flutter: enableNotification DeviceConnectionState.disconnected
flutter: BleStatus.poweredOff
reactive_ble_mobile/PluginController.swift:153: Assertion failed
reactive_ble_mobile/PluginController.swift:153: Assertion failed
* thread #1, queue = 'com.apple.main-thread', stop reason = Assertion failed
    frame #0: 0x00000001a0a76eac libswiftCore.dylib`_swift_runtime_on_report
libswiftCore.dylib`_swift_runtime_on_report:
->  0x1a0a76eac <+0>: ret    
libswiftCore.dylib`_swift_reportToDebugger:
    0x1a0a76eb0 <+0>: b      0x1a0a76eac               ; _swift_runtime_on_report
libswiftCore.dylib`_swift_shouldReportFatalErrorsToDebugger:
    0x1a0a76eb4 <+0>: adrp   x8, 337372
    0x1a0a76eb8 <+4>: ldrb   w0, [x8, #0x299]
Target 0: (Runner) stopped.
Lost connection to device.
jicang commented 2 years ago

v1.5版本已经更新