Skip to content

Commit

Permalink
clean (DfuInstallation.cs): trivial neutral reindentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ksidirop-laerdal committed Nov 13, 2024
1 parent c61d446 commit 8dd029b
Showing 1 changed file with 21 additions and 20 deletions.
41 changes: 21 additions & 20 deletions Laerdal.Dfu/Platforms.iOSandMacCatalyst/DfuInstallation.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using CoreFoundation;

using Foundation;

using Laerdal.Dfu.Specific;

namespace Laerdal.Dfu
Expand All @@ -14,20 +12,22 @@ public partial class DfuInstallation
public static Func<DispatchQueue> LoggerQueue { get; set; } = () => DispatchQueue.GetGlobalQueue(DispatchQueuePriority.Default);

public Func<Laerdal.Dfu.Bindings.iOS.DFUServiceInitiator, Laerdal.Dfu.Bindings.iOS.DFUServiceInitiator> CustomDfuServiceInitiatorConfiguration { get; set; } = (dfuInitiator) => dfuInitiator;

private void SetInitiator()
{
DfuProgressDelegate = new DfuProgressDelegate(this);
DfuServiceDelegate = new DfuServiceDelegate(this);
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,
Expand All @@ -38,7 +38,7 @@ private void SetInitiator()
// PacketsReceiptNotifications
if (PacketReceiptNotificationParameter.HasValue)
Initiator.PacketReceiptNotificationParameter = PacketReceiptNotificationParameter.Value;

// DataObjectPreparationDelay
if (DataObjectPreparationDelay.HasValue)
Initiator.DataObjectPreparationDelay = DataObjectPreparationDelay.Value;
Expand All @@ -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;
Expand All @@ -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)
{
}
Expand All @@ -98,6 +98,7 @@ public override void Start()
{
throw new System.Exception("Controller is already set.");
}

SetInitiator();
Controller = Initiator.StartWithTargetWithIdentifier(new NSUuid(DeviceId));
}
Expand Down

0 comments on commit 8dd029b

Please sign in to comment.