1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use super::coils::Coil;
use super::exception_code::Result;
pub trait Requests {
fn read_discrete_inputs(&mut self, address: u16, quantity: u16) -> Result<Vec<Coil>>;
fn read_coils(&mut self, address: u16, quantity: u16) -> Result<Vec<Coil>>;
fn write_single_coil(&mut self, address: u16, value: Coil) -> Result<()>;
fn write_multiple_coils(&mut self, address: u16, coils: &[Coil]) -> Result<()>;
fn read_input_registers(&mut self, address: u16, quantity: u16) -> Result<Vec<u16>>;
fn read_holding_registers(&mut self, address: u16, quantity: u16) -> Result<Vec<u16>>;
fn write_single_register(&mut self, address: u16, value: u16) -> Result<()>;
fn write_multiple_registers(&mut self, address: u16, values: &[u16]) -> Result<()>;
}