diff --git a/Source/v2/Meadow.Cli/Commands/Current/Firmware/FirmwareWriteCommand.cs b/Source/v2/Meadow.Cli/Commands/Current/Firmware/FirmwareWriteCommand.cs index be7e9a0c..00af54a6 100644 --- a/Source/v2/Meadow.Cli/Commands/Current/Firmware/FirmwareWriteCommand.cs +++ b/Source/v2/Meadow.Cli/Commands/Current/Firmware/FirmwareWriteCommand.cs @@ -4,7 +4,6 @@ using Meadow.LibUsb; using Meadow.Software; using Microsoft.Extensions.Logging; -using System.IO; namespace Meadow.CLI.Commands.DeviceManagement; @@ -21,7 +20,7 @@ public class FirmwareWriteCommand : BaseDeviceCommand [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")] @@ -93,7 +92,7 @@ private bool RequiresDfuForRuntimeUpdates(DeviceInfo info) return version.Major switch { 0 => true, - 1 => version.Minor < 8, + 2 => version.Minor < 0, _ => false, }; } @@ -108,7 +107,7 @@ private bool RequiresDfuForEspUpdates(DeviceInfo info) return version.Major switch { 0 => true, - 1 => version.Minor < 9, + 2 => version.Minor < 0, _ => false, }; } @@ -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; @@ -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(); } diff --git a/Source/v2/Meadow.Cli/Meadow.CLI.csproj b/Source/v2/Meadow.Cli/Meadow.CLI.csproj index 04efc9ce..0c719a05 100644 --- a/Source/v2/Meadow.Cli/Meadow.CLI.csproj +++ b/Source/v2/Meadow.Cli/Meadow.CLI.csproj @@ -10,7 +10,7 @@ Wilderness Labs, Inc Wilderness Labs, Inc true - 2.0.7.1 + 2.0.8.0 AnyCPU http://developer.wildernesslabs.co/Meadow/Meadow.CLI/ https://github.com/WildernessLabs/Meadow.CLI diff --git a/Source/v2/Meadow.Cli/Properties/AssemblyInfo.cs b/Source/v2/Meadow.Cli/Properties/AssemblyInfo.cs index a7ab2d30..a5e7b308 100644 --- a/Source/v2/Meadow.Cli/Properties/AssemblyInfo.cs +++ b/Source/v2/Meadow.Cli/Properties/AssemblyInfo.cs @@ -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"; } } \ No newline at end of file