[][src]Struct async_resol_vbus::DeviceDiscovery

pub struct DeviceDiscovery { /* fields omitted */ }

Allows discovery of VBus-over-TCP devices in a local network.

All VBus-over-TCP devices listen for UDPv4 broadcast messages on port 7053. If such a message with the correct payload is received, the device sends a unicast message back to the sender of the broadcast to identify itself.

The DeviceDiscovery type allows to send such broadcasts and collect all associated replies.

Methods

impl DeviceDiscovery[src]

pub fn new() -> DeviceDiscovery[src]

Create a new DeviceDiscovery instance using default values.

Examples

use async_resol_vbus::DeviceDiscovery;

let discovery = DeviceDiscovery::new();
let addresses = discovery.discover_device_addresses().await?;

pub fn set_broadcast_addr(&mut self, addr: SocketAddr)[src]

Set the broadcast address.

pub fn set_rounds(&mut self, rounds: u8)[src]

Set the number of discovery rounds.

pub fn set_broadcast_timeout(&mut self, timeout: Duration)[src]

Set the timeout used to wait for replies after each round's broadcast.

pub fn set_fetch_port(&mut self, port: u16)[src]

Set the port number used for fetching the device information.

pub fn set_fetch_timeout(&mut self, timeout: Duration)[src]

Set the timeout used for fetching the device information.

pub async fn discover_devices<'_>(&'_ self) -> Result<Vec<DeviceInformation>>[src]

Discover all VBus-over-TCP devices and return their device information.

Examples

use async_resol_vbus::DeviceDiscovery;

let discovery = DeviceDiscovery::new();
let devices = discovery.discover_devices().await?;

pub async fn discover_device_addresses<'_>(&'_ self) -> Result<Vec<SocketAddr>>[src]

Discover all VBus-over-TCP devices and return their addresses.

Examples

use async_resol_vbus::DeviceDiscovery;

let discovery = DeviceDiscovery::new();
let addresses = discovery.discover_device_addresses().await?;

Trait Implementations

impl Debug for DeviceDiscovery[src]

impl Default for DeviceDiscovery[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.