Struct serial_win::Connection
[-] [+]
[src]
pub struct Connection { // some fields omitted }
A serial connection
Methods
impl Connection
fn new(port: &str, baud_rate: u32) -> Result<Connection>
Open a new connection via port port
with baud rate baud_rate
fn set_timeout(&mut self, timeout_ms: u32) -> Result<()>
Set interval and total timeouts to timeout_ms
fn baud_rate(&self) -> Result<u32>
fn set_baud_rate(&mut self, baud_rate: u32) -> Result<()>
fn byte_size(&self) -> Result<u8>
fn set_byte_size(&mut self, byte_size: u8) -> Result<()>
fn parity(&self) -> Result<Parity>
fn set_parity(&mut self, parity: Parity) -> Result<()>
fn stop_bits(&self) -> Result<StopBits>
fn set_stop_bits(&mut self, stop_bits: StopBits) -> Result<()>
fn read_until(&mut self, delim: u8, buf: &mut Vec<u8>) -> Result<usize>
Read into buf
until delim
is encountered. Return n.o. bytes read on success,
and an IO error on failure.
fn read_line(&mut self, buf: &mut Vec<u8>) -> Result<usize>
Read until newline. Return n.o. bytes read on success