Expand description

A NetworkManager API library using the D-Bus message bus system

§Usage

[dependencies]
networkmanager = { package = "passcod-networkmanager", version = "=0.7.0-pre.1" }
tokio = { version = "1", features = ["full"] }

§Example

use networkmanager::{Error, NetworkManager};

#[tokio::main]
async fn main() -> Result<(), Error> {
    let nm = NetworkManager::new().await?;

    for dev in nm.get_devices().await? {
        if let Some(wifi) = dev.to_wireless().await? {
            println!("Bitrate: {:?}", wifi.bitrate().await?);
            wifi.request_scan().await?;
            for ap in wifi.get_all_access_points().await? {
                let raw = ap.ssid().await?;
                println!("SSID: {} {raw:02x?}", String::from_utf8_lossy(&raw));
            }
        }
    }

    Ok(())
}

§Features

  • raw: Enable access to the raw D-Bus proxies. This is useful if you need to access methods that are not wrapped by this library, or if you need to access the D-Bus signals.

Modules§

Structs§

Enums§