From bd2ab3cc5838c12c98be738e95efc1a5f8f9cccb Mon Sep 17 00:00:00 2001 From: frectonz Date: Tue, 23 Jun 2026 15:15:36 +0300 Subject: [PATCH] feat: support fetching `MAX_Station_num` --- src/args.rs | 2 ++ src/main.rs | 1 + src/proc_get.rs | 23 +++++++++++++++++++++++ 3 files changed, 26 insertions(+) diff --git a/src/args.rs b/src/args.rs index a14b4f8..561d5c8 100644 --- a/src/args.rs +++ b/src/args.rs @@ -109,6 +109,8 @@ pub enum GetCommands { HardwareVersion, /// Fetch system status. SystemStatus, + /// Fetch max station num. + MaxStationNum, } #[derive(Subcommand, Debug)] diff --git a/src/main.rs b/src/main.rs index 17d396d..5c74841 100644 --- a/src/main.rs +++ b/src/main.rs @@ -47,6 +47,7 @@ async fn main() -> EyreResult<()> { GetCommands::RealtimeTx => router.show::().await?, GetCommands::HardwareVersion => router.show::().await?, GetCommands::SystemStatus => router.system_status().await?, + GetCommands::MaxStationNum => 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 a56674d..5d50593 100644 --- a/src/proc_get.rs +++ b/src/proc_get.rs @@ -978,3 +978,26 @@ impl ProcGet for SystemStatus { Ok(()) } } + +#[derive(Debug, Deserialize)] +pub struct MaxStationNum { + #[serde(rename = "MAX_Station_num")] + pub max_station_num: BoxStr, +} + +impl ProcGet for MaxStationNum { + const CMD: &str = "MAX_Station_num"; + type Params = (); + + fn print_table(&self) -> EyreResult<()> { + let mut table = create_table(); + + table + .set_header(["Max Station Num"]) + .add_row([&self.max_station_num]); + + println!("{table}"); + + Ok(()) + } +} -- 2.51.2