diff --git a/Cargo.lock b/Cargo.lock index 5176ed0..7d1941e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -320,7 +320,7 @@ dependencies = [ [[package]] name = "framework_lib" -version = "0.1.0" +version = "0.2.0" dependencies = [ "built", "clap", @@ -351,7 +351,7 @@ dependencies = [ [[package]] name = "framework_tool" -version = "0.1.0" +version = "0.2.0" dependencies = [ "framework_lib", "static_vcruntime", @@ -359,7 +359,7 @@ dependencies = [ [[package]] name = "framework_uefi" -version = "0.1.0" +version = "0.2.0" dependencies = [ "framework_lib", "log", diff --git a/README.md b/README.md index 0e186e3..f4927fc 100644 --- a/README.md +++ b/README.md @@ -279,13 +279,13 @@ succcess, 1 on failure. ``` # Check which devices it's available for -> ./framework_system --device - [possible values: bios, ec, pd0, pd1, rtm01, rtm23] +> ./framework_tool --device + [possible values: bios, ec, pd0, pd1, rtm01, rtm23, ac-left, ac-right] For more information try '--help' # Successful compare -> ./framework_system --device bios --compare-version 03.01 +> ./framework_tool --device bios --compare-version 03.01 Target Version "03.01" Comparing BIOS version "03.01" Compared version: 0 @@ -293,7 +293,7 @@ Compared version: 0 0 # Failed compare -> ./framework_system --device bios --compare-version 03.00 +> ./framework_tool --device bios --compare-version 03.00 Finished dev [unoptimized + debuginfo] target(s) in 0.05s Target Version "03.00" Comparing BIOS version "03.01" @@ -304,6 +304,29 @@ Error: "Fail" 1 ``` +On UEFI Shell: + +``` +# Check if AC is attached on left side +Shell> fs0:framework_tool.efi --device ac-left --compare-version 1 +Target Version "1" +Comparing AcLeft "1" +Comparison Result: 0 +# It is +Shell> echo %lasterror% +0x0 + +# Check if AC is attached on right side +Shell> fs0:framework_tool.efi --device ac-right --compare-version 1 +Target Version "1" +Comparing AcLeft "0" +Comparison Result: 1 + +# It is not +Shell> echo %lasterror% +0x1 +``` + ## Debugging To debug, increase the verbosity from the commandline with `-v`. diff --git a/framework_lib/Cargo.toml b/framework_lib/Cargo.toml index a98fa1d..31cfc08 100644 --- a/framework_lib/Cargo.toml +++ b/framework_lib/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "framework_lib" -version = "0.1.0" +version = "0.2.0" edition = "2021" rust-version = "1.61" build = "build.rs" diff --git a/framework_lib/src/ccgx/mod.rs b/framework_lib/src/ccgx/mod.rs index 185d103..71f187b 100644 --- a/framework_lib/src/ccgx/mod.rs +++ b/framework_lib/src/ccgx/mod.rs @@ -121,7 +121,7 @@ impl fmt::Display for BaseVersion { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!( f, - "{}.{}.{}.{:0>3}", + "{:X}.{:X}.{:X}.{:03X}", self.major, self.minor, self.patch, self.build_number ) } @@ -163,7 +163,7 @@ pub struct AppVersion { impl fmt::Display for AppVersion { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - write!(f, "{}.{}.{:0>2}", self.major, self.minor, self.circuit) + write!(f, "{:X}.{:X}.{:02X}", self.major, self.minor, self.circuit) } } diff --git a/framework_lib/src/commandline/uefi.rs b/framework_lib/src/commandline/uefi.rs index 3a656fe..283f01a 100644 --- a/framework_lib/src/commandline/uefi.rs +++ b/framework_lib/src/commandline/uefi.rs @@ -436,12 +436,16 @@ pub fn parse(args: &[String]) -> Cli { Some(HardwareDeviceType::RTM01) } else if console_arg == "rtm23" { Some(HardwareDeviceType::RTM23) + } else if console_arg == "ac-left" { + Some(HardwareDeviceType::AcLeft) + } else if console_arg == "ac-right" { + Some(HardwareDeviceType::AcRight) } else { println!("Invalid value for --device: {}", console_arg); None } } else { - println!("Need to provide a value for --console. Either `follow` or `recent`"); + println!("Need to provide a value for --console. Possible values: bios, ec, pd0, pd1, rtm01, rtm23, ac-left, ac-right"); None }; } diff --git a/framework_tool/Cargo.toml b/framework_tool/Cargo.toml index 7a9266d..06defaa 100644 --- a/framework_tool/Cargo.toml +++ b/framework_tool/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "framework_tool" -version = "0.1.0" +version = "0.2.0" edition = "2021" [features] diff --git a/framework_uefi/Cargo.toml b/framework_uefi/Cargo.toml index 2d0b672..05ec746 100644 --- a/framework_uefi/Cargo.toml +++ b/framework_uefi/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "framework_uefi" -version = "0.1.0" +version = "0.2.0" edition = "2021" rust-version = "1.68"