pub struct Slave(pub SlaveId);
Expand description
A single byte for addressing Modbus slave devices.
Tuple Fields§
§0: SlaveId
Implementations§
Source§impl Slave
impl Slave
Sourcepub const fn broadcast() -> Self
pub const fn broadcast() -> Self
The special address for sending a broadcast message to all connected Modbus slave devices at once. Broadcast messages are one-way and sent from the master to all slaves, i.e. a request without a response.
Some devices may use a custom id from the reserved range 248-255 for broadcasting.
Sourcepub const fn min_device() -> Self
pub const fn min_device() -> Self
The minimum address of a single Modbus slave device.
Sourcepub const fn max_device() -> Self
pub const fn max_device() -> Self
The maximum address of a single Modbus slave device.
Sourcepub const fn tcp_device() -> Self
pub const fn tcp_device() -> Self
The reserved address for sending a message to a directly connected Modbus TCP device, i.e. if not forwarded through a TCP/RTU gateway according to the unit identifier.
Modbus Messaging on TCP/IP Implementation Guide, page 23 “On TCP/IP, the Modbus server is addressed using its IP address; therefore, the Modbus Unit Identifier is useless. The value 0xFF has to be used.”
Sourcepub fn is_broadcast(self) -> bool
pub fn is_broadcast(self) -> bool
Check if the SlaveId
is used for broadcasting
Sourcepub fn is_single_device(self) -> bool
pub fn is_single_device(self) -> bool
Check if the SlaveId
addresses a single device
Sourcepub fn is_reserved(self) -> bool
pub fn is_reserved(self) -> bool
Check if the SlaveId
is reserved