[−][src]Struct async_resol_vbus::DeviceDiscovery
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]
fn default() -> DeviceDiscovery
[src]
Auto Trait Implementations
impl RefUnwindSafe for DeviceDiscovery
impl Send for DeviceDiscovery
impl Sync for DeviceDiscovery
impl Unpin for DeviceDiscovery
impl UnwindSafe for DeviceDiscovery
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,