diff --git a/src/args.rs b/src/args.rs index 6360b45..67bbfa3 100644 --- a/src/args.rs +++ b/src/args.rs @@ -47,8 +47,10 @@ pub enum GetCommands { Rssi, /// Fetch router RSCP in dBm. Rscp, - /// Fetch LTE RSRP + /// Fetch LTE RSRP. LteRsrp, + /// Fetch LTE RSRQ. + LteRsrq, /// Fetch router signal bar. Signalbar, /// Fetch last cached airtime balance. diff --git a/src/main.rs b/src/main.rs index a51910f..5c3a623 100644 --- a/src/main.rs +++ b/src/main.rs @@ -26,6 +26,7 @@ async fn main() -> EyreResult<()> { GetCommands::PowerExists => router.show::().await?, GetCommands::Sms => router.show::().await?, GetCommands::LteRsrp => router.show::().await?, + GetCommands::LteRsrq => 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 f09474c..1c6a963 100644 --- a/src/proc_get.rs +++ b/src/proc_get.rs @@ -173,6 +173,24 @@ impl ProcGet for Rscp { } } +#[derive(Debug, Deserialize)] +pub struct LteRsrq { + pub lte_rsrq: BoxStr, +} + +impl ProcGet for LteRsrq { + const CMD: &str = "lte_rsrq"; + type Params = (); + + fn print_table(&self) { + let mut table = create_table(); + table + .set_header(["LTE RSRQ (dBm)"]) + .add_row([&self.lte_rsrq]); + println!("{table}"); + } +} + #[derive(Debug, Deserialize)] pub struct LteRsrp { pub lte_rsrp: BoxStr,