Skip to content

Commit

Permalink
Merge pull request #390 from WildernessLabs/ota_version_check
Browse files Browse the repository at this point in the history
add logic to compare os version and package version and download appropriate mpak
  • Loading branch information
ctacke authored Nov 9, 2023
2 parents 6bbc6d4 + 9a6952e commit 37e24bc
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions source/Meadow.Core/Update/UpdateService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,15 @@ public void RetrieveUpdate(UpdateInfo updateInfo)

private async Task DownloadProc(UpdateMessage message)
{
Resolver.Log.Trace($"Device OS Version: {Resolver.Device.PlatformOS.OSVersion}, Update OS Version: {message.OsVersion}");

var destination = message.MpakDownloadUrl;

if (!string.IsNullOrEmpty(message.OsVersion)
&& Resolver.Device.PlatformOS.OSVersion != message.OsVersion)
{
destination = message.MpakWithOsDownloadUrl;
}

if (!destination.StartsWith("http"))
{
Expand Down

0 comments on commit 37e24bc

Please sign in to comment.