Skip to content

Latest commit

 

History

History
64 lines (44 loc) · 1.62 KB

README.md

File metadata and controls

64 lines (44 loc) · 1.62 KB

connman-rs

crates.io Build Status

A ConnMan API library that abstracts the D-Bus layer using dbus-tokio.

The API is still under development, and may be subject to change.

Documentation

Usage

Add connman-rs to your Cargo.toml with:

[dependencies]
connman = "0.2"

Example

The following example demonstrates how to create a Manager and list the available services.

use connman::Manager;
use dbus_tokio::connection;

#[tokio::main]
async fn main() {
    let (resource, conn) = connection::new_system_sync().unwrap();
    tokio::spawn(async {
        let err = resource.await;
        panic!("Lost connection to D-Bus: {}", err);
    });

    let manager = Manager::new(conn);

    let services = manager.get_services().await.unwrap();
    for svc in services {
        // Dump service info
        println!("Found service: {:?}", svc.path())
    }
}

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.