Trait tokio_modbus::slave::SlaveContext

source ·
pub trait SlaveContext {
    // Required method
    fn set_slave(&mut self, slave: Slave);
}
Expand description

Stateful management of the currently active device.

RTU devices are addressed by their assigned slave id.

TCP devices are either addressed directly (= implicitly) by using the reserved unit id Slave::tcp_device() = 0xFF (default) or indirectly through an TCP/RTU gateway by setting the unit id to the desired slave id.

The names slave id and unit id are used synonymously depending on the context. This library consistently adopted the term slave.

Required Methods§

source

fn set_slave(&mut self, slave: Slave)

Select a slave device for all subsequent outgoing requests.

Implementors§

source§

impl SlaveContext for tokio_modbus::client::Context

source§

impl SlaveContext for tokio_modbus::client::sync::Context