pub mod dto;
pub use dto::*;
pub mod utils;
#[cfg(target_os = "linux")]
pub mod linux;
use anyhow::{Result, anyhow};
use async_trait::async_trait;
use std::fmt::Debug;
#[async_trait]
pub trait IWifi:Send+Sync+Debug {
async fn scan(&self) -> Result<Vec<ScanResult>> {
Ok(vec![])
}
async fn get_scan_result(&self) -> Result<Vec<ScanResult>> {
Ok(vec![])
}
async fn get_networks(&self) -> Result<Vec<NetworkListResult>> {
Ok(vec![])
}
async fn remove(&self, network_id: usize) -> Result<()> {
Ok(())
}
async fn disconnect(&self) -> Result<()> {
Ok(())
}
async fn reconnect(&self) -> Result<()> {
Ok(())
}
async fn select_id(&self, network_id: usize) -> Result<SelectResult> {
Err(anyhow!("unsupported"))
}
async fn status(&self) -> Result<Status> {
Err(anyhow!("unsupported"))
}
async fn connect(&self, ssid: String, passwd: String) -> Result<()> {
Err(anyhow!("unsupported"))
}
}
#[derive(Debug)]
pub struct EmptyWifi;
impl IWifi for EmptyWifi{}