pub struct U3vStream<T: UsbTransfer> { /* private fields */ }Expand description
U3V stream receiver that reads frames from a USB bulk endpoint.
Implementations§
Source§impl<T: UsbTransfer> U3vStream<T>
impl<T: UsbTransfer> U3vStream<T>
Sourcepub fn new(
transport: Arc<T>,
ep_in: u8,
max_leader_size: usize,
max_trailer_size: usize,
payload_size: usize,
) -> Self
pub fn new( transport: Arc<T>, ep_in: u8, max_leader_size: usize, max_trailer_size: usize, payload_size: usize, ) -> Self
Create a new stream receiver.
max_leader_size, max_trailer_size and payload_size come
from the SIRM registers. payload_size is the exact number of
payload bytes per frame (configured in the SIRM).
Sourcepub fn set_timeout(&mut self, timeout: Duration)
pub fn set_timeout(&mut self, timeout: Duration)
Override the default bulk read timeout.
Sourcepub fn next_frame(&mut self) -> Result<RawFrame, U3vError>
pub fn next_frame(&mut self) -> Result<RawFrame, U3vError>
Receive the next complete frame.
Blocks until a full leader + payload + trailer sequence is read from the stream endpoint. Returns the parsed leader, raw payload, and trailer.
Auto Trait Implementations§
impl<T> Freeze for U3vStream<T>
impl<T> RefUnwindSafe for U3vStream<T>where
T: RefUnwindSafe,
impl<T> Send for U3vStream<T>
impl<T> Sync for U3vStream<T>
impl<T> Unpin for U3vStream<T>
impl<T> UnsafeUnpin for U3vStream<T>
impl<T> UnwindSafe for U3vStream<T>where
T: RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more