diff --git a/framework_lib/src/commandline/mod.rs b/framework_lib/src/commandline/mod.rs index c15ccf9..7ca78f7 100644 --- a/framework_lib/src/commandline/mod.rs +++ b/framework_lib/src/commandline/mod.rs @@ -960,13 +960,11 @@ fn smbios_info() { if let Some(version) = dmidecode_string_val(&data.version()) { // Assumes it's ASCII, which is guaranteed by SMBIOS let config_digit0 = &version[0..1]; - let config_digit0 = u8::from_str_radix(config_digit0, 16).unwrap(); - if let Some(version_config) = - ::from_u8(config_digit0) - { + let config_digit0 = u8::from_str_radix(config_digit0, 16); + if let Ok(version_config) = config_digit0.map(::from_u8) { println!(" Version: {:?} ({})", version_config, version); } else { - println!(" Version: {}", version); + println!(" Version: '{}'", version); } } if let Some(manufacturer) = dmidecode_string_val(&data.manufacturer()) { @@ -979,12 +977,37 @@ fn smbios_info() { println!(" Wake-Up-Type: {:?}", wake_up_type.value); } if let Some(sku_number) = dmidecode_string_val(&data.sku_number()) { - println!(" SKU Number: {}", sku_number); + println!(" SKU Number: '{}'", sku_number); + } + if let Some(sn) = dmidecode_string_val(&data.serial_number()) { + println!(" Serial Number:{}", sn); } if let Some(family) = dmidecode_string_val(&data.family()) { println!(" Family: {}", family); } } + DefinedStruct::BaseBoardInformation(data) => { + println!("BaseBoard Information"); + if let Some(version) = dmidecode_string_val(&data.version()) { + // Assumes it's ASCII, which is guaranteed by SMBIOS + let config_digit0 = &version[0..1]; + let config_digit0 = u8::from_str_radix(config_digit0, 16); + if let Ok(version_config) = config_digit0.map(::from_u8) { + println!(" Version: {:?} ({})", version_config, version); + } else { + println!(" Version: '{}'", version); + } + } + if let Some(manufacturer) = dmidecode_string_val(&data.manufacturer()) { + println!(" Manufacturer: {}", manufacturer); + } + if let Some(product_name) = dmidecode_string_val(&data.product()) { + println!(" Product: {}", product_name); + } + if let Some(sn) = dmidecode_string_val(&data.serial_number()) { + println!(" Serial Number:{}", sn); + } + } _ => {} } }