pub struct RouterConnection { /* private fields */ }Expand description
A KNXnet/IP router connection over multicast UDP.
Implementations§
Source§impl RouterConnection
impl RouterConnection
Sourcepub async fn connect(
local_addr: Ipv4Addr,
multicast: SocketAddrV4,
) -> Result<Self, KnxIpError>
pub async fn connect( local_addr: Ipv4Addr, multicast: SocketAddrV4, ) -> Result<Self, KnxIpError>
Join the KNX multicast group and start receiving routing indications.
local_addr is the local interface to bind to (use 0.0.0.0 for any).
multicast is the multicast group + port (default 224.0.23.12:3671).
§Errors
Returns KnxIpError if the socket cannot be created or joined.
Sourcepub async fn connect_v4(
local_addr: Ipv4Addr,
multicast: SocketAddrV4,
) -> Result<Self, KnxIpError>
pub async fn connect_v4( local_addr: Ipv4Addr, multicast: SocketAddrV4, ) -> Result<Self, KnxIpError>
Join an IPv4 KNX multicast group and start receiving routing indications.
§Errors
Returns KnxIpError if the socket cannot be created or joined.
Sourcepub async fn connect_v6(
interface: u32,
multicast: SocketAddrV6,
) -> Result<Self, KnxIpError>
pub async fn connect_v6( interface: u32, multicast: SocketAddrV6, ) -> Result<Self, KnxIpError>
Join an IPv6 multicast group and start receiving routing indications.
Use the target address scope id or pass an explicit interface index for link-local multicast groups.
§Errors
Returns KnxIpError if the socket cannot be created or joined.
Sourcepub async fn connect_multicast(
multicast: SocketAddr,
) -> Result<Self, KnxIpError>
pub async fn connect_multicast( multicast: SocketAddr, ) -> Result<Self, KnxIpError>
Join a KNX multicast group from a generic socket address.
IPv4 uses 0.0.0.0 as the interface selector. IPv6 uses the target
scope id as the interface index when present.
§Errors
Returns KnxIpError if the socket cannot be created or joined.
Sourcepub async fn connect_default(local_addr: Ipv4Addr) -> Result<Self, KnxIpError>
pub async fn connect_default(local_addr: Ipv4Addr) -> Result<Self, KnxIpError>
Connect to the default KNX multicast group (224.0.23.12:3671).
§Errors
Returns KnxIpError if the socket cannot be created.