From 8dd029b291b2e6abdae05347bec7bf3cb7107d7d Mon Sep 17 00:00:00 2001 From: Kyriakos Sidiropoulos Date: Wed, 13 Nov 2024 20:31:54 +0100 Subject: [PATCH] clean (DfuInstallation.cs): trivial neutral reindentation --- .../DfuInstallation.cs | 41 ++++++++++--------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/Laerdal.Dfu/Platforms.iOSandMacCatalyst/DfuInstallation.cs b/Laerdal.Dfu/Platforms.iOSandMacCatalyst/DfuInstallation.cs index f81820d..56518d1 100644 --- a/Laerdal.Dfu/Platforms.iOSandMacCatalyst/DfuInstallation.cs +++ b/Laerdal.Dfu/Platforms.iOSandMacCatalyst/DfuInstallation.cs @@ -1,7 +1,5 @@ using CoreFoundation; - using Foundation; - using Laerdal.Dfu.Specific; namespace Laerdal.Dfu @@ -14,7 +12,7 @@ public partial class DfuInstallation public static Func LoggerQueue { get; set; } = () => DispatchQueue.GetGlobalQueue(DispatchQueuePriority.Default); public Func CustomDfuServiceInitiatorConfiguration { get; set; } = (dfuInitiator) => dfuInitiator; - + private void SetInitiator() { DfuProgressDelegate = new DfuProgressDelegate(this); @@ -22,12 +20,14 @@ private void SetInitiator() DfuPeripheralSelectorDelegate = new DfuPeripheralSelectorDelegate(this); Firmware = new Laerdal.Dfu.Bindings.iOS.DFUFirmware(new NSUrl(FileUrl, false), out NSError error); - - Initiator = new Laerdal.Dfu.Bindings.iOS.DFUServiceInitiator(Queue.Invoke(), - DelegateQueue.Invoke(), - ProgressQueue.Invoke(), - LoggerQueue.Invoke(), - null) + + Initiator = new Laerdal.Dfu.Bindings.iOS.DFUServiceInitiator( + queue: Queue.Invoke(), + loggerQueue: LoggerQueue.Invoke(), + delegateQueue: DelegateQueue.Invoke(), + progressQueue: ProgressQueue.Invoke(), + centralManagerOptions: null + ) { Logger = new DfuLogger(), WeakProgressDelegate = DfuProgressDelegate, @@ -38,7 +38,7 @@ private void SetInitiator() // PacketsReceiptNotifications if (PacketReceiptNotificationParameter.HasValue) Initiator.PacketReceiptNotificationParameter = PacketReceiptNotificationParameter.Value; - + // DataObjectPreparationDelay if (DataObjectPreparationDelay.HasValue) Initiator.DataObjectPreparationDelay = DataObjectPreparationDelay.Value; @@ -50,15 +50,15 @@ private void SetInitiator() // AlternativeAdvertisingName Initiator.AlternativeAdvertisingNameEnabled = !string.IsNullOrEmpty(AlternativeAdvertisingName); Initiator.AlternativeAdvertisingName = AlternativeAdvertisingName; - + // ForceScanningForNewAddressInLegacyDfu if (ForceScanningForNewAddressInLegacyDfu.HasValue) Initiator.ForceScanningForNewAddressInLegacyDfu = ForceScanningForNewAddressInLegacyDfu.Value; - + // EnableUnsafeExperimentalButtonlessServiceInSecureDfu if (EnableUnsafeExperimentalButtonlessServiceInSecureDfu.HasValue) Initiator.ForceScanningForNewAddressInLegacyDfu = EnableUnsafeExperimentalButtonlessServiceInSecureDfu.Value; - + // ForceDfu if (ForceDfu.HasValue) Initiator.ForceDfu = ForceDfu.Value; @@ -72,18 +72,18 @@ private void SetInitiator() // public DFUUuidHelper UuidHelper {get; set;} } - public Laerdal.Dfu.Bindings.iOS.DFUServiceInitiator Initiator { get; private set; } + public Laerdal.Dfu.Bindings.iOS.DFUServiceInitiator Initiator { get; private set; } public Laerdal.Dfu.Bindings.iOS.DFUServiceController Controller { get; private set; } - public Laerdal.Dfu.Bindings.iOS.DFUFirmware Firmware { get; private set;} - - private DfuProgressDelegate DfuProgressDelegate { get; set;} + public Laerdal.Dfu.Bindings.iOS.DFUFirmware Firmware { get; private set; } + + private DfuProgressDelegate DfuProgressDelegate { get; set; } - private DfuServiceDelegate DfuServiceDelegate { get; set;} + private DfuServiceDelegate DfuServiceDelegate { get; set; } + + private DfuPeripheralSelectorDelegate DfuPeripheralSelectorDelegate { get; set; } - private DfuPeripheralSelectorDelegate DfuPeripheralSelectorDelegate { get; set;} - public DfuInstallation(string deviceId, string fileUrl) : base(deviceId, fileUrl) { } @@ -98,6 +98,7 @@ public override void Start() { throw new System.Exception("Controller is already set."); } + SetInitiator(); Controller = Initiator.StartWithTargetWithIdentifier(new NSUuid(DeviceId)); }