Skip to content

Commit

Permalink
perf (iOS/all operations): we now launch logging and progress% callba…
Browse files Browse the repository at this point in the history
…cks in the background so that the file-uploading/downloading aspects will be unimpeded

[skip ci]
  • Loading branch information
ksidirop-laerdal committed Jan 17, 2025
1 parent fcbec31 commit 435b193
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>

<!-- these versions are getting replaced by the build script in one swift pass -->
<Version>1.0.1225.0</Version>
<Version>1.0.1230.0</Version>

<FileVersion>$(Version)</FileVersion>
<PackageVersion>$(Version)</PackageVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
<AllowedReferenceRelatedFileExtensions>$(AllowedReferenceRelatedFileExtensions);.pdb</AllowedReferenceRelatedFileExtensions>

<!-- these versions are getting replaced by the build script in one swift pass -->
<Version>1.0.1225.0</Version>
<Version>1.0.1230.0</Version>

<FileVersion>$(Version)</FileVersion>
<PackageVersion>$(Version)</PackageVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,9 @@ public class IOSFileDownloader: NSObject {

//@objc dont
private func logMessageAdvertisement(_ message: String, _ category: String, _ level: String) {
_listener.logMessageAdvertisement(message, category, level, _remoteFilePathSanitized)
DispatchQueue.global(qos: .background).async { //fire and forget to boost performance
self._listener.logMessageAdvertisement(message, category, level, self._remoteFilePathSanitized)
}
}

//@objc dont
Expand All @@ -218,7 +220,9 @@ public class IOSFileDownloader: NSObject {
_ progressPercentage: Int,
_ averageThroughput: Float32
) {
_listener.fileDownloadProgressPercentageAndDataThroughputChangedAdvertisement(progressPercentage, averageThroughput)
DispatchQueue.global(qos: .background).async { //fire and forget to boost performance
self._listener.fileDownloadProgressPercentageAndDataThroughputChangedAdvertisement(progressPercentage, averageThroughput)
}
}

//@objc dont
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,9 @@ public class IOSFileUploader: NSObject {

//@objc dont
private func logMessageAdvertisement(_ message: String, _ category: String, _ level: String) {
_listener.logMessageAdvertisement(message, category, level, _remoteFilePathSanitized)
DispatchQueue.global(qos: .background).async { //fire and forget to boost performance
self._listener.logMessageAdvertisement(message, category, level, self._remoteFilePathSanitized)
}
}

//@objc dont
Expand Down Expand Up @@ -294,10 +296,12 @@ public class IOSFileUploader: NSObject {
_ progressPercentage: Int,
_ averageThroughput: Float32
) {
_listener.fileUploadProgressPercentageAndDataThroughputChangedAdvertisement(
progressPercentage,
averageThroughput
)
DispatchQueue.global(qos: .background).async { //fire and forget to boost performance
self._listener.fileUploadProgressPercentageAndDataThroughputChangedAdvertisement(
progressPercentage,
averageThroughput
)
}
}

private func setState(_ newState: EIOSFileUploaderState) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,9 @@ public class IOSFirmwareInstaller: NSObject {
//@objc dont

private func logMessageAdvertisement(_ message: String, _ category: String, _ level: String) {
_listener.logMessageAdvertisement(message, category, level);
DispatchQueue.global(qos: .background).async { //fire and forget to boost performance
self._listener.logMessageAdvertisement(message, category, level)
}
}

//@objc dont
Expand Down Expand Up @@ -245,7 +247,9 @@ public class IOSFirmwareInstaller: NSObject {
_ progressPercentage: Int,
_ averageThroughput: Float32
) {
_listener.firmwareUploadProgressPercentageAndDataThroughputChangedAdvertisement(progressPercentage, averageThroughput)
DispatchQueue.global(qos: .background).async { //fire and forget to boost performance
self._listener.firmwareUploadProgressPercentageAndDataThroughputChangedAdvertisement(progressPercentage, averageThroughput)
}
}

private func setState(_ newState: EIOSFirmwareInstallationState) {
Expand Down Expand Up @@ -371,9 +375,9 @@ extension IOSFirmwareInstaller: McuMgrLogDelegate {
atLevel level: iOSMcuManagerLibrary.McuMgrLogLevel
) {
logMessageAdvertisement(
msg,
category.rawValue,
level.name
msg,
category.rawValue,
level.name
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<AllowedReferenceRelatedFileExtensions>$(AllowedReferenceRelatedFileExtensions);.pdb</AllowedReferenceRelatedFileExtensions>

<!-- these versions are getting replaced by the build script in one swift pass -->
<Version>1.0.1225.0</Version>
<Version>1.0.1230.0</Version>

<FileVersion>$(Version)</FileVersion>
<PackageVersion>$(Version)</PackageVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
<AllowedReferenceRelatedFileExtensions>$(AllowedReferenceRelatedFileExtensions);.pdb</AllowedReferenceRelatedFileExtensions>

<!-- these versions are getting replaced by the build script in one swift pass -->
<Version>1.0.1225.0</Version>
<Version>1.0.1230.0</Version>

<FileVersion>$(Version)</FileVersion>
<PackageVersion>$(Version)</PackageVersion>
Expand Down
10 changes: 5 additions & 5 deletions Laerdal.McuMgr/Laerdal.McuMgr.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>

<!-- these versions are getting replaced by the build script in one swift pass -->
<Version>1.0.1225.0</Version>
<Version>1.0.1230.0</Version>

<FileVersion>$(Version)</FileVersion>
<PackageVersion>$(Version)</PackageVersion>
Expand Down Expand Up @@ -176,22 +176,22 @@

<!-- ANDROID -->
<ItemGroup Condition=" '$(IsAndroid)' == 'true' ">
<PackageReference Include="Laerdal.McuMgr.Bindings.Android" Version="1.0.1225.0"/>
<PackageReference Include="Laerdal.McuMgr.Bindings.Android" Version="1.0.1230.0"/>
</ItemGroup>

<!-- IOS -->
<ItemGroup Condition=" '$(IsIOS)' == 'true' ">
<PackageReference Include="Laerdal.McuMgr.Bindings.iOS" Version="1.0.1225.0"/>
<PackageReference Include="Laerdal.McuMgr.Bindings.iOS" Version="1.0.1230.0"/>
</ItemGroup>

<!-- MACCATALYST -->
<ItemGroup Condition=" '$(IsNetXMacCatalyst)' == 'true' and '$(Should_Skip_MacCatalyst)' != 'true' ">
<PackageReference Include="Laerdal.McuMgr.Bindings.MacCatalyst" Version="1.0.1225.0"/>
<PackageReference Include="Laerdal.McuMgr.Bindings.MacCatalyst" Version="1.0.1230.0"/>
</ItemGroup>

<!-- NETSTANDARD -->
<ItemGroup Condition=" '$(IsDudNet8_0)' == 'true' ">
<PackageReference Include="Laerdal.McuMgr.Bindings.NetStandard" Version="1.0.1225.0"/>
<PackageReference Include="Laerdal.McuMgr.Bindings.NetStandard" Version="1.0.1230.0"/>
</ItemGroup>

</Project>

0 comments on commit 435b193

Please sign in to comment.