pub struct RoutePath { /* private fields */ }Expand description
Route path for PLC communication.
Implementations§
Source§impl RoutePath
impl RoutePath
Sourcepub fn add_port(self, port: u8) -> Self
pub fn add_port(self, port: u8) -> Self
Sets the network port for the most recently added Ethernet hop.
If no Ethernet hop exists yet, the port is staged and applied to the next
add_address call, so both add_address(a).add_port(p) and
add_port(p).add_address(a) produce the intended port. Previously the
latter ordering silently dropped the port.
Sourcepub fn add_address(self, address: String) -> Self
pub fn add_address(self, address: String) -> Self
Adds a network address to the route
Sourcepub fn add_backplane(self, port: u8, slot: u8) -> Self
pub fn add_backplane(self, port: u8, slot: u8) -> Self
Adds a backplane hop with an explicit port number.
Sourcepub fn add_ethernet(self, address: impl Into<String>) -> Self
pub fn add_ethernet(self, address: impl Into<String>) -> Self
Adds an Ethernet hop using the common Rockwell Ethernet port number, 2.
Sourcepub fn add_ethernet_with_port(
self,
port: u8,
address: impl Into<String>,
) -> Self
pub fn add_ethernet_with_port( self, port: u8, address: impl Into<String>, ) -> Self
Adds an Ethernet hop with an explicit port number.
Sourcepub fn slots(&self) -> Vec<u8> ⓘ
pub fn slots(&self) -> Vec<u8> ⓘ
Returns legacy grouped backplane slots derived from the ordered hops.
Sourcepub fn ports(&self) -> Vec<u8> ⓘ
pub fn ports(&self) -> Vec<u8> ⓘ
Returns legacy grouped Ethernet ports derived from the ordered hops.
Sourcepub fn addresses(&self) -> Vec<String>
pub fn addresses(&self) -> Vec<String>
Returns legacy grouped Ethernet addresses derived from the ordered hops.
Sourcepub fn to_cip_bytes(&self) -> Vec<u8> ⓘ
pub fn to_cip_bytes(&self) -> Vec<u8> ⓘ
Builds CIP route path bytes
Reference: EtherNetIP_Connection_Paths_and_Routing.md, Port Segment Encoding According to the examples: Port 1 (backplane), Slot X = [0x01, X] The 0x01 byte encodes both “Port Segment (8-bit link)” AND “Port 1 (backplane)” Examples from documentation:
- Slot 0:
01 00 - Slot 1:
01 01 - Slot 2:
01 02