pub struct ControlChannel<T: UsbTransfer> { /* private fields */ }Expand description
GenCP control channel over a USB3 Vision bulk endpoint pair.
Sends READMEM and WRITEMEM commands and receives their acknowledges, splitting a large access across the device’s maximum transfer sizes.
Implementations§
Source§impl<T: UsbTransfer> ControlChannel<T>
impl<T: UsbTransfer> ControlChannel<T>
Sourcepub fn new(
transport: Arc<T>,
ep_in: u8,
ep_out: u8,
max_cmd_transfer: u32,
max_ack_transfer: u32,
) -> Self
pub fn new( transport: Arc<T>, ep_in: u8, ep_out: u8, max_cmd_transfer: u32, max_ack_transfer: u32, ) -> Self
Create a new control channel.
max_cmd_transfer and max_ack_transfer cap the largest single bulk
transfer each way; the SBRM has the device’s values, which
set_max_transfer applies once read.
Sourcepub fn set_max_transfer(&mut self, max_cmd_transfer: u32, max_ack_transfer: u32)
pub fn set_max_transfer(&mut self, max_cmd_transfer: u32, max_ack_transfer: u32)
Use the device’s transfer limits from now on, keeping the request id sequence: a device answers a repeated id with its previous acknowledge (GenCP §3.1), so the sequence must not restart mid-session.
Sourcepub fn set_timeout(&mut self, timeout: Duration)
pub fn set_timeout(&mut self, timeout: Duration)
Override the control transaction timeout.
Sourcepub fn transport(&self) -> &Arc<T> ⓘ
pub fn transport(&self) -> &Arc<T> ⓘ
Access the underlying transport (e.g. to share with a stream).
Auto Trait Implementations§
impl<T> Freeze for ControlChannel<T>
impl<T> RefUnwindSafe for ControlChannel<T>where
T: RefUnwindSafe,
impl<T> Send for ControlChannel<T>
impl<T> Sync for ControlChannel<T>
impl<T> Unpin for ControlChannel<T>
impl<T> UnsafeUnpin for ControlChannel<T>
impl<T> UnwindSafe for ControlChannel<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