pub struct SafeClient { /* private fields */ }safe-client-sync and (crate features tokio-rtu-sync or tokio-tcp-sync) only.Expand description
Synchronous client for interacting with the R4DCB08 temperature module over Modbus.
This struct provides methods to read sensor data and configure the module’s
operational parameters by wrapping tokio-modbus synchronous operations.
Implementations§
Source§impl SafeClient
impl SafeClient
Sourcepub fn new(ctx: Context) -> Self
pub fn new(ctx: Context) -> Self
Creates a new SafeClient with a given tokio-modbus synchronous context.
Creates a new SafeClient from a shared tokio-modbus synchronous context.
Clones the shared tokio-modbus synchronous context.
Sourcepub fn read_temperatures(&mut self) -> Result<Temperatures, Error>
pub fn read_temperatures(&mut self) -> Result<Temperatures, Error>
Reads the current temperatures from all 8 available channels in degrees Celsius (°C).
Sourcepub fn read_temperature_correction(
&mut self,
) -> Result<TemperatureCorrection, Error>
pub fn read_temperature_correction( &mut self, ) -> Result<TemperatureCorrection, Error>
Reads the configured temperature correction values (°C) for all 8 channels.
Sourcepub fn set_temperature_correction(
&mut self,
channel: Channel,
correction: Temperature,
) -> Result<(), Error>
pub fn set_temperature_correction( &mut self, channel: Channel, correction: Temperature, ) -> Result<(), Error>
Sets a temperature correction value for a specific channel.
Sourcepub fn read_automatic_report(&mut self) -> Result<AutomaticReport, Error>
pub fn read_automatic_report(&mut self) -> Result<AutomaticReport, Error>
Reads the automatic temperature reporting interval.
Sourcepub fn set_automatic_report(
&mut self,
report: AutomaticReport,
) -> Result<(), Error>
pub fn set_automatic_report( &mut self, report: AutomaticReport, ) -> Result<(), Error>
Sets the automatic temperature reporting interval.
Sourcepub fn read_baud_rate(&mut self) -> Result<BaudRate, Error>
pub fn read_baud_rate(&mut self) -> Result<BaudRate, Error>
Reads the current Modbus communication baud rate setting from the device.
Sourcepub fn set_baud_rate(&mut self, baud_rate: BaudRate) -> Result<(), Error>
pub fn set_baud_rate(&mut self, baud_rate: BaudRate) -> Result<(), Error>
Sets the Modbus communication baud rate for the device.
Sourcepub fn factory_reset(&mut self) -> Result<(), Error>
pub fn factory_reset(&mut self) -> Result<(), Error>
Resets the R4DCB08 module to its factory default settings.
Sourcepub fn read_address(&mut self) -> Result<Address, Error>
pub fn read_address(&mut self) -> Result<Address, Error>
Reads the current Modbus device address (Slave ID) from the module.
Trait Implementations§
Source§impl Clone for SafeClient
impl Clone for SafeClient
Source§fn clone(&self) -> SafeClient
fn clone(&self) -> SafeClient
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more