Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix write runtime command + version bump #490

Merged
merged 1 commit into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using Meadow.LibUsb;
using Meadow.Software;
using Microsoft.Extensions.Logging;
using System.IO;

namespace Meadow.CLI.Commands.DeviceManagement;

Expand All @@ -21,7 +20,7 @@ public class FirmwareWriteCommand : BaseDeviceCommand<FirmwareWriteCommand>
[CommandOption("version", 'v', IsRequired = false)]
public string? Version { get; set; }

[CommandOption("use-dfu", 'd', IsRequired = false, Description = "Force using DFU/HCOM for writing files.")]
[CommandOption("use-dfu", 'd', IsRequired = false, Description = "Force using DFU/HCOM for writing files")]
public bool UseDfu { get; set; }

[CommandOption("file", 'f', IsRequired = false, Description = "Send only the specified file")]
Expand Down Expand Up @@ -93,7 +92,7 @@ private bool RequiresDfuForRuntimeUpdates(DeviceInfo info)
return version.Major switch
{
0 => true,
1 => version.Minor < 8,
2 => version.Minor < 0,
_ => false,
};
}
Expand All @@ -108,7 +107,7 @@ private bool RequiresDfuForEspUpdates(DeviceInfo info)
return version.Major switch
{
0 => true,
1 => version.Minor < 9,
2 => version.Minor < 0,
_ => false,
};
}
Expand Down Expand Up @@ -159,6 +158,10 @@ protected override async ValueTask ExecuteCommand()
FirmwareType.ESP
};
}
else if (FirmwareFileTypes.Length == 1 && FirmwareFileTypes[0] == FirmwareType.Runtime)
{ //use the "DFU" path when only writing the runtime
UseDfu = true;
}

IMeadowConnection? connection = null;
DeviceInfo? deviceInfo = null;
Expand Down Expand Up @@ -248,7 +251,7 @@ protected override async ValueTask ExecuteCommand()
|| Path.GetFileName(IndividualFile) == F7FirmwarePackageCollection.F7FirmwareFiles.CoprocApplicationFile
|| Path.GetFileName(IndividualFile) == F7FirmwarePackageCollection.F7FirmwareFiles.CoprocBootloaderFile)
{
if(connection == null)
if (connection == null)
{
connection = await GetConnectionAndDisableRuntime();
}
Expand Down
2 changes: 1 addition & 1 deletion Source/v2/Meadow.Cli/Meadow.CLI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<Authors>Wilderness Labs, Inc</Authors>
<Company>Wilderness Labs, Inc</Company>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageVersion>2.0.7.1</PackageVersion>
<PackageVersion>2.0.8.0</PackageVersion>
<Platforms>AnyCPU</Platforms>
<PackageProjectUrl>http://developer.wildernesslabs.co/Meadow/Meadow.CLI/</PackageProjectUrl>
<RepositoryUrl>https://github.com/WildernessLabs/Meadow.CLI</RepositoryUrl>
Expand Down
2 changes: 1 addition & 1 deletion Source/v2/Meadow.Cli/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ namespace Meadow.CLI
{
public static class Constants
{
public const string CLI_VERSION = "2.0.7.1";
public const string CLI_VERSION = "2.0.8.0";
}
}
Loading