upnp-client 0.1.11

A simple UPnP client written in Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use colored_json::prelude::*;
use futures_util::StreamExt;
use upnp_client::discovery::discover_pnp_locations;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let devices = discover_pnp_locations().await?;
    tokio::pin!(devices);

    while let Some(device) = devices.next().await {
        let json = serde_json::to_string_pretty(&device)?;
        println!("{}", json.to_colored_json_auto()?);
    }

    Ok(())
}