Crate upnp_rs

Source
Expand description

This crate implements the four major components of the UPnP Device Architecture (UDA), namely

  1. Discovery, the search and notification functions via the Simple Service Discovery Protocol (SSDP).
  2. Description, the device and service templates.
  3. Control, TBD
  4. Eventing, via the General Event Notification Architecture (GENA).

The UDA covers the search for devices by a control point (client) as well as how devices respond with, and proactively advertise, capabilities. There are currently 3 versions of the UDA specification, v1.0, v1.1 (also standardized as ISO/IEC 29341-1-1), and v2.0.

For more information see the specifications and other documents at Open Connectivity Foundation.

The main interface is the ssdp module.

§Example

The following example issues a single v1.0 multicast search and collects and returns a set of device responses.

use upnp_rs::SpecVersion;
use upnp_rs::discovery::search::*;

let mut options = Options::default_for(SpecVersion::V10);
options.search_target = SearchTarget::RootDevice;

match search_once(options) {
    Ok(responses) => {
        println!("search returned {} results.", responses.len());
        for (index, response) in responses.iter().enumerate() {
            println!("{}: {:#?}", index, response);
        }
    }
    Err(error) => {
        println!("search failed with error: {:#?}", error);
    }
}

§Documentation

Where possible any documentation for fields, functions, and values will be taken directly from the UDA specifications. In general the description will be taken from the version of the specication where the component in question was first introduced.

Modules§

common
control
This module implements the UPnP device and service control capabilities.
description
This module implements the UPnP device and service descriptions using the UPnP template language.
discovery
This module implements the UPnP discovery protocol providing availability notifications and search capabilities.
error
One-line description. More detailed description, with
eventing
This module implements the UPnP device and service eventing capabilities via the General Event Notification Architecture (GENA) protocol.
syntax
One-line description.

Enums§

SpecVersion
This denotes the version of the UPnP Device Architecture (UDA) specification to use for a given interaction.

Constants§

UPNP_DOMAIN
The domain part of standard UPnP URI/URN identifiers.
UPNP_STRING
The protocol short form identifier used in constructing numerous values.