Laerdal.Dfu
Laerdal.Dfu copied to clipboard
dfu updated issues with Maui (with Laerdal.Dfu)
i am trying for dfu with maui and i have downloaded the laerdal.dfu 1.27.8 from Nuget Package then i created a function for picking up the file and i have also copy the zip file created by nordic for dfu then i have placed that file in mobile so i can select the file and it will start the dfu but i hit the function start it will destroy the dfu. i am sharing the code of instating the dfu and logs as well
private async Task StartDfuProcess(IPeripheral connectedDevice, string filePath) { try { //string Device_address = "C2:08:51:5F:5F:C0"; string Device_address = "D8:12:F2:92:46:8B"; var fileExists = File.Exists(filePath); Debug.WriteLine($"File path exists: {fileExists}");
if (!fileExists)
{
Debug.WriteLine("File does not exist, aborting DFU process.");
return;
}
Debug.WriteLine("DFU process is about to start.");
var _output = new DfuInstallation(Device_address, filePath);
_output.Start();
Debug.WriteLine("DFU process started successfully.");
}
catch (Exception ex)
{
Debug.WriteLine($"Error during DFU process: {ex.Message}");
}
}
and logs are
[DOTNET] File selected: /data/data/com.companyname.bluetoothcourse/cache/2203693cc04e0be7f4f024d5f9499e13/8d01d97ef7354bc1828aa4125f15fa1c/dfu_application.zip
[0:] File path exists: True
[0:] DFU process is about to start.
[0:] DFU process started successfully.
[ViewRootImpl@5042f0f[IntermediateActivity]] stopped(false) old=true
[DfuBaseService] DFU service created. Version: 2.3.0
[ViewRootImpl@5042f0f[IntermediateActivity]] stopped(false) old=false
[SurfaceControl] assignNativeObject: nativeObject = 0 Surface(name=null)/@0xa550588 / android.view.SurfaceControl.readFromParcel:1121 android.view.IWindowSession$Stub$Proxy.relayout:1830 android.view.ViewRootImpl.relayoutWindow:9005 android.view.ViewRootImpl.performTraversals:3360 android.view.ViewRootImpl.doTraversal:2618 android.view.ViewRootImpl$TraversalRunnable.run:9971 android.view.Choreographer$CallbackRecord.run:1010 android.view.Choreographer.doCallbacks:809 android.view.Choreographer.doFrame:744 android.view.Choreographer$FrameDisplayEventReceiver.run:995
[SurfaceControl] assignNativeObject: nativeObject = 0 Surface(name=null)/@0xdb8cb9c / android.view.SurfaceControl.readFromParcel:1121 android.view.IWindowSession$Stub$Proxy.relayout:1840 android.view.ViewRootImpl.relayoutWindow:9005 android.view.ViewRootImpl.performTraversals:3360 android.view.ViewRootImpl.doTraversal:2618 android.view.ViewRootImpl$TraversalRunnable.run:9971 android.view.Choreographer$CallbackRecord.run:1010 android.view.Choreographer.doCallbacks:809 android.view.Choreographer.doFrame:744 android.view.Choreographer$FrameDisplayEventReceiver.run:995
[ViewRootImpl@5042f0f[IntermediateActivity]] Relayout returned: old=(0,0,1080,2340) new=(0,0,1080,2340) req=(1080,2340)4 dur=11 res=0x1 s={false 0} ch=false fn=-1
[ViewRootImpl@129f74a[MainActivity]] stopped(false) old=true
[DfuBaseService] Starting DFU service in foreground
Thread started: #23
[ViewRootImpl@129f74a[MainActivity]] stopped(false) old=false
[SurfaceControl] assignNativeObject: nativeObject = 0 Surface(name=null)/@0xf85a525 / android.view.SurfaceControl.readFromParcel:1121 android.view.IWindowSession$Stub$Proxy.relayout:1840 android.view.ViewRootImpl.relayoutWindow:9005 android.view.ViewRootImpl.performTraversals:3360 android.view.ViewRootImpl.doTraversal:2618 android.view.ViewRootImpl$TraversalRunnable.run:9971 android.view.Choreographer$CallbackRecord.run:1010 android.view.Choreographer.doCallbacks:809 android.view.Choreographer.doFrame:744 android.view.Choreographer$FrameDisplayEventReceiver.run:995
[ViewRootImpl@129f74a[MainActivity]] Relayout returned: old=(0,0,1080,2340) new=(0,0,1080,2340) req=(1080,2340)0 dur=14 res=0x7 s={true 488234582016} ch=true fn=-1
[DfuArchiveInputStream] Manifest failed to be parsed. Did you add
[DfuArchiveInputStream] -keep class no.nordicsemi.android.dfu.** { *; }
[DfuArchiveInputStream] to your proguard rules?
[DfuBaseService] An exception occurred while calculating file size
[DfuBaseService] java.io.IOException: The ZIP file must contain an Application, a Soft Device and/or a Bootloader.
[DfuBaseService] at no.nordicsemi.android.dfu.internal.ArchiveInputStream.