diff --git a/src/asynch/control.rs b/src/asynch/control.rs index 0eaba53..8d03404 100644 --- a/src/asynch/control.rs +++ b/src/asynch/control.rs @@ -195,6 +195,19 @@ impl<'a, const INGRESS_BUF_SIZE: usize, const URC_CAPACITY: usize> } } + pub async fn get_signal_strength(&self) -> Result { + match (&self.at_client) + .send_retry(&GetWifiStatus { + status_id: StatusId::Rssi, + }) + .await? + .status_id + { + WifiStatus::Rssi(s) => Ok(s), + _ => Err(Error::AT(atat::Error::InvalidResponse)), + } + } + pub async fn wait_for_link_state(&self, link_state: LinkState) { self.state_ch.wait_for_link_state(link_state).await } diff --git a/src/command/wifi/types.rs b/src/command/wifi/types.rs index 1b996ec..fb9ce5f 100644 --- a/src/command/wifi/types.rs +++ b/src/command/wifi/types.rs @@ -499,7 +499,7 @@ pub enum WifiStatus { /// The is the RSSI value of the current connection; will /// return-32768, if not connected. #[at_arg(value = 6)] - Rssi(u32), + Rssi(i16), /// The is the mobility domain of the last or current /// connection This tag is supported by ODIN-W2 from software version 6.0.0 /// onwards only.