added some documentation

This commit is contained in:
2025-04-26 19:22:13 +02:00
parent 6496f671d9
commit 0195bb3666
4 changed files with 26 additions and 1 deletions

View File

@@ -6,6 +6,8 @@ const CON_NAME: &str = "fwa-hotspot";
const PASSWORD: &str = "hunter22";
const IPV4_ADDRES: &str = "192.168.4.1/24";
/// Create the connection in NM
/// Will fail if already exists
async fn create_hotspot() -> Result<(), Box<dyn Error>> {
let mut cmd = Command::new("nmcli")
.args(["device", "wifi", "hotspot"])
@@ -42,6 +44,7 @@ async fn create_hotspot() -> Result<(), Box<dyn Error>> {
Ok(())
}
/// Checks if the connection already exists
async fn exists() -> Result<bool, Box<dyn Error>> {
let mut cmd = Command::new("nmcli")
.args(["connection", "show"])