Struct sonos_discovery::Discover [] [src]

pub struct Discover { /* fields omitted */ }

Discover type

Used for discovering sonos devices in the local network via the simple service discovery protocol (ssdp). The ssd-protocol works via udp sockets. First a certain search-message is sent to the multicast address (239.255.255.250:1900).

All answer from upnp (universal plug and play) ready devices are processed and filtered ("Sonos" is in the reply).

Methods

impl Discover
[src]

Creates a new Discovery. Uses the default socket on the default ipv4 multicast address (239.255.255.250:1900).

Examples

use sonos_discovery::Discovery;

let discovery: Discovery = Discovery::new();

Creates a new Discovery with a custom multicast address.

Start discovering devices.

Examples

In this example the search will stop if3 devices have been discovered or the default timeout (5s) is reached. This is useful if you know the amount of speakers you have and want to reduce the search time.

use sonos_discovery::Discovery;

let devices: HashSet<IpAddr> = Discovery::new().start(None, Some(3));

Trait Implementations

impl Debug for Discover
[src]

Formats the value using the given formatter.

impl Drop for Discover
[src]

Drop internal socket on going out of scope

A method called when the value goes out of scope. Read more