Skip to main content

Crate sonos_discovery

Crate sonos_discovery 

Source
Expand description

Internal implementation detail of sonos-sdk. Not intended for direct use.

Sonos device discovery library

This crate provides a simple API for discovering Sonos devices on a local network using SSDP (Simple Service Discovery Protocol) and UPnP device descriptions.

§Quick Start

use sonos_discovery::get;

// Discover all Sonos devices on the network
let devices = get();
for device in devices {
    println!("Found {} at {}", device.name, device.ip_address);
}

§Iterator-based Discovery

For more control, use the iterator API:

use sonos_discovery::{get_iter, DeviceEvent};

for event in get_iter() {
    match event {
        DeviceEvent::Found(device) => {
            println!("Found: {}", device.name);
            // Can break early if needed
        }
    }
}

Modules§

device
Device description parsing and validation.

Structs§

Device
Information about a discovered Sonos device.
DiscoveryIterator
Iterator that discovers Sonos devices on the local network.

Enums§

DeviceEvent
Events emitted during device discovery.
DiscoveryError
Error type for discovery operations.

Functions§

get
Discover all Sonos devices on the local network with a default 3-second timeout.
get_iter
Get an iterator for discovering Sonos devices with a default 3-second timeout.
get_iter_with_timeout
Get an iterator for discovering Sonos devices with a custom timeout.
get_with_timeout
Discover all Sonos devices on the local network with a custom timeout.

Type Aliases§

Result
Convenience Result type alias for discovery operations.