unifly_api/session/
wifi.rs1use serde_json::Value;
7use tracing::debug;
8
9use crate::error::Error;
10use crate::session::client::SessionClient;
11use crate::session::models::{ChannelAvailability, RogueAp};
12
13impl SessionClient {
14 pub async fn list_rogue_aps(&self, within_secs: Option<i64>) -> Result<Vec<RogueAp>, Error> {
21 let path = match within_secs {
22 Some(secs) => format!("stat/rogueap?within={secs}"),
23 None => "stat/rogueap".to_string(),
24 };
25 let url = self.site_url(&path);
26 debug!(?within_secs, "listing rogue and neighboring APs");
27 self.get(url).await
28 }
29
30 pub async fn list_channels(&self) -> Result<Vec<ChannelAvailability>, Error> {
34 let url = self.site_url("stat/current-channel");
35 debug!("listing regulatory channel availability");
36 self.get(url).await
37 }
38
39 pub async fn get_client_wifi_experience(&self, client_ip: &str) -> Result<Value, Error> {
46 let path = format!("wifiman/{client_ip}/");
47 let url = self.site_url_v2(&path);
48 debug!(client_ip, "fetching client Wi-Fi experience");
49 self.get_raw(url).await
50 }
51}