refactored hardware components

detach trait from mock and hardware implementation
This commit is contained in:
2025-06-02 14:46:24 +02:00
parent dc8fd22f0f
commit efd096a149
7 changed files with 75 additions and 56 deletions

View File

@@ -6,6 +6,8 @@ use std::{
};
use tokio::process::Command;
use crate::hardware::Hotspot;
const SSID: &str = "fwa";
const CON_NAME: &str = "fwa-hotspot";
const PASSWORD: &str = "a9LG2kUVrsRRVUo1";
@@ -41,16 +43,6 @@ impl fmt::Display for HotspotError {
impl std::error::Error for HotspotError {}
pub trait Hotspot {
fn enable_hotspot(
&self,
) -> impl std::future::Future<Output = Result<(), HotspotError>> + std::marker::Send;
fn disable_hotspot(
&self,
) -> impl std::future::Future<Output = Result<(), HotspotError>> + std::marker::Send;
}
/// NetworkManager Hotspot
pub struct NMHotspot {
ssid: String,