From 424b83db112df1afb52488d394b42076ae3c8a20 Mon Sep 17 00:00:00 2001 From: frectonz Date: Tue, 23 Jun 2026 15:18:32 +0300 Subject: [PATCH] feat: support fetching `device_version` --- src/args.rs | 2 ++ src/main.rs | 1 + src/proc_get.rs | 22 ++++++++++++++++++++++ 3 files changed, 25 insertions(+) diff --git a/src/args.rs b/src/args.rs index 561d5c8..b3b9a2a 100644 --- a/src/args.rs +++ b/src/args.rs @@ -111,6 +111,8 @@ pub enum GetCommands { SystemStatus, /// Fetch max station num. MaxStationNum, + /// Fetch device version. + DeviceVersion, } #[derive(Subcommand, Debug)] diff --git a/src/main.rs b/src/main.rs index 5c74841..a929964 100644 --- a/src/main.rs +++ b/src/main.rs @@ -48,6 +48,7 @@ async fn main() -> EyreResult<()> { GetCommands::HardwareVersion => router.show::().await?, GetCommands::SystemStatus => router.system_status().await?, GetCommands::MaxStationNum => router.show::().await?, + GetCommands::DeviceVersion => router.show::().await?, }, TopLevelCommands::Post { command } => match command { PostCommands::Reboot => router.reboot().await?, diff --git a/src/proc_get.rs b/src/proc_get.rs index 5d50593..a0f85f1 100644 --- a/src/proc_get.rs +++ b/src/proc_get.rs @@ -1001,3 +1001,25 @@ impl ProcGet for MaxStationNum { Ok(()) } } + +#[derive(Debug, Deserialize)] +pub struct DeviceVersion { + pub device_version: BoxStr, +} + +impl ProcGet for DeviceVersion { + const CMD: &str = "device_version"; + type Params = (); + + fn print_table(&self) -> EyreResult<()> { + let mut table = create_table(); + + table + .set_header(["Device Version"]) + .add_row([&self.device_version]); + + println!("{table}"); + + Ok(()) + } +} -- 2.51.2