Skip to content

Commit 25a5518

Browse files
committed
Add --expansion-bay command to print info
``` > framework_tool.exe --expansion-bay Expansion Bay Serial Number: FRAXXXXXXXXXXXXXXX ``` TODO: - [x] Try with dGPU - [ ] Try with SSD Holder - [ ] Try with fan module - [ ] Try with bad interposer Signed-off-by: Daniel Schaefer <dhs@frame.work>
1 parent a0b5cdf commit 25a5518

File tree

4 files changed

+19
-0
lines changed

4 files changed

+19
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ Options:
181181
--inputmodules Show status of the input modules (Framework 16 only)
182182
--input-deck-mode <INPUT_DECK_MODE>
183183
Set input deck power mode [possible values: auto, off, on] (Framework 16 only) [possible values: auto, off, on]
184+
--expansion-bay Show status of the expansion bay (Framework 16 only)
184185
--charge-limit [<CHARGE_LIMIT>]
185186
Get or set max charge limit
186187
--get-gpio <GET_GPIO>

framework_lib/src/commandline/clap_std.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,10 @@ struct ClapCli {
147147
#[arg(long)]
148148
input_deck_mode: Option<InputDeckModeArg>,
149149

150+
/// Show status of the expansion bay (Framework 16 only)
151+
#[arg(long)]
152+
expansion_bay: bool,
153+
150154
/// Get or set max charge limit
151155
#[arg(long)]
152156
charge_limit: Option<Option<u8>>,
@@ -352,6 +356,7 @@ pub fn parse(args: &[String]) -> Cli {
352356
intrusion: args.intrusion,
353357
inputmodules: args.inputmodules,
354358
input_deck_mode: args.input_deck_mode,
359+
expansion_bay: args.expansion_bay,
355360
charge_limit: args.charge_limit,
356361
get_gpio: args.get_gpio,
357362
fp_led_level: args.fp_led_level,

framework_lib/src/commandline/mod.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ pub struct Cli {
173173
pub intrusion: bool,
174174
pub inputmodules: bool,
175175
pub input_deck_mode: Option<InputDeckModeArg>,
176+
pub expansion_bay: bool,
176177
pub charge_limit: Option<Option<u8>>,
177178
pub get_gpio: Option<String>,
178179
pub fp_led_level: Option<Option<FpBrightnessArg>>,
@@ -761,6 +762,13 @@ pub fn run_with_args(args: &Cli, _allupdate: bool) -> i32 {
761762
} else if let Some(mode) = &args.input_deck_mode {
762763
println!("Set mode to: {:?}", mode);
763764
ec.set_input_deck_mode((*mode).into()).unwrap();
765+
} else if args.expansion_bay {
766+
println!("Expansion Bay");
767+
if let Ok(sn) = ec.get_gpu_serial() {
768+
println!(" Serial Number: {}", sn);
769+
} else {
770+
println!(" Serial Number: Unknown");
771+
}
764772
} else if let Some(maybe_limit) = args.charge_limit {
765773
print_err(handle_charge_limit(&ec, maybe_limit));
766774
} else if let Some(gpio_name) = &args.get_gpio {
@@ -1080,6 +1088,7 @@ Options:
10801088
--intrusion Show status of intrusion switch
10811089
--inputmodules Show status of the input modules (Framework 16 only)
10821090
--input-deck-mode Set input deck power mode [possible values: auto, off, on] (Framework 16 only)
1091+
--expansion-bay Show status of the expansion bay (Framework 16 only)
10831092
--charge-limit [<VAL>] Get or set battery charge limit (Percentage number as arg, e.g. '100')
10841093
--get-gpio <GET_GPIO> Get GPIO value by name
10851094
--fp-led-level [<VAL>] Get or set fingerprint LED brightness level [possible values: high, medium, low]

framework_lib/src/commandline/uefi.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ pub fn parse(args: &[String]) -> Cli {
8686
intrusion: false,
8787
inputmodules: false,
8888
input_deck_mode: None,
89+
expansion_bay: false,
8990
charge_limit: None,
9091
get_gpio: None,
9192
fp_led_level: None,
@@ -247,6 +248,9 @@ pub fn parse(args: &[String]) -> Cli {
247248
None
248249
};
249250
found_an_option = true;
251+
} else if arg == "--expansion-bay" {
252+
cli.expansion_bay = true;
253+
found_an_option = true;
250254
} else if arg == "--charge-limit" {
251255
cli.charge_limit = if args.len() > i + 1 {
252256
if let Ok(percent) = args[i + 1].parse::<u8>() {

0 commit comments

Comments
 (0)