Struct framed_serial::FramedConnection
[−]
[src]
pub struct FramedConnection<S> where
S: NonBlockingRx + NonBlockingTx, { /* fields omitted */ }
Wrapper around a serial port to provide framed connections.
See the module level documentation for more information.
Methods
impl<S> FramedConnection<S> where
S: NonBlockingRx + NonBlockingTx,
[src]
S: NonBlockingRx + NonBlockingTx,
fn new(s: S) -> FramedConnection<S>
Create a new FramedConnection
. Takes ownership of the serial device.
fn schedule_send(&mut self, frame: Vec<u8>) -> Result<(), Error>
Schedule a frame to be sent. Returns Err(Error)
if the frame is too long,
otherwise returns immediately with Ok(())
.
fn block_until_send_done(&mut self) -> Result<(), Error>
Wait until previous send is done.
fn tick(&mut self) -> Result<TickProgress, Error>
Service the connection.
fn get_frame(&mut self) -> Result<Vec<u8>, Error>
Get completed frame.