diff --git a/src/args.rs b/src/args.rs index 285055a..6360b45 100644 --- a/src/args.rs +++ b/src/args.rs @@ -47,6 +47,8 @@ pub enum GetCommands { Rssi, /// Fetch router RSCP in dBm. Rscp, + /// Fetch LTE RSRP + LteRsrp, /// Fetch router signal bar. Signalbar, /// Fetch last cached airtime balance. diff --git a/src/main.rs b/src/main.rs index b33c539..a51910f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -25,6 +25,7 @@ async fn main() -> EyreResult<()> { GetCommands::BatteryExists => router.show::().await?, GetCommands::PowerExists => router.show::().await?, GetCommands::Sms => router.show::().await?, + GetCommands::LteRsrp => router.show::().await?, }, TopLevelCommands::Post { command } => match command { PostCommands::Reboot => router.reboot().await.print_table(), diff --git a/src/proc_get.rs b/src/proc_get.rs index b0b8f4f..f09474c 100644 --- a/src/proc_get.rs +++ b/src/proc_get.rs @@ -173,6 +173,24 @@ impl ProcGet for Rscp { } } +#[derive(Debug, Deserialize)] +pub struct LteRsrp { + pub lte_rsrp: BoxStr, +} + +impl ProcGet for LteRsrp { + const CMD: &str = "lte_rsrp"; + type Params = (); + + fn print_table(&self) { + let mut table = create_table(); + table + .set_header(["LTE RSRP (dBm)"]) + .add_row([&self.lte_rsrp]); + println!("{table}"); + } +} + #[derive(Debug, Deserialize)] pub struct SignalBar { pub signalbar: BoxStr,