Trait autd3_driver::link::Link

source ·
pub trait Link<T: Transducer>: Send {
    // Required methods
    fn open(&mut self, devices: &[Device<T>]) -> Result<(), AUTDInternalError>;
    fn close(&mut self) -> Result<(), AUTDInternalError>;
    fn send(&mut self, tx: &TxDatagram) -> Result<bool, AUTDInternalError>;
    fn receive(
        &mut self,
        rx: &mut RxDatagram
    ) -> Result<bool, AUTDInternalError>;
    fn is_open(&self) -> bool;
    fn timeout(&self) -> Duration;

    // Provided methods
    fn send_receive(
        &mut self,
        tx: &TxDatagram,
        rx: &mut RxDatagram,
        timeout: Duration
    ) -> Result<bool, AUTDInternalError> { ... }
    fn wait_msg_processed(
        &mut self,
        tx: &TxDatagram,
        rx: &mut RxDatagram,
        timeout: Duration
    ) -> Result<bool, AUTDInternalError> { ... }
    fn check(&self, tx: &TxDatagram, rx: &mut RxDatagram) -> Vec<bool> { ... }
}
Expand description

Link is a interface to the AUTD device

Required Methods§

source

fn open(&mut self, devices: &[Device<T>]) -> Result<(), AUTDInternalError>

Open link

source

fn close(&mut self) -> Result<(), AUTDInternalError>

Close link

source

fn send(&mut self, tx: &TxDatagram) -> Result<bool, AUTDInternalError>

Send data to devices

source

fn receive(&mut self, rx: &mut RxDatagram) -> Result<bool, AUTDInternalError>

Receive data from devices

source

fn is_open(&self) -> bool

Check if link is open

source

fn timeout(&self) -> Duration

Get timeout

Provided Methods§

source

fn send_receive( &mut self, tx: &TxDatagram, rx: &mut RxDatagram, timeout: Duration ) -> Result<bool, AUTDInternalError>

Send and receive data

source

fn wait_msg_processed( &mut self, tx: &TxDatagram, rx: &mut RxDatagram, timeout: Duration ) -> Result<bool, AUTDInternalError>

Wait until message is processed

source

fn check(&self, tx: &TxDatagram, rx: &mut RxDatagram) -> Vec<bool>

Trait Implementations§

source§

impl<T: Transducer> Link<T> for Box<dyn Link<T>>

source§

fn open(&mut self, devices: &[Device<T>]) -> Result<(), AUTDInternalError>

Open link
source§

fn close(&mut self) -> Result<(), AUTDInternalError>

Close link
source§

fn send(&mut self, tx: &TxDatagram) -> Result<bool, AUTDInternalError>

Send data to devices
source§

fn receive(&mut self, rx: &mut RxDatagram) -> Result<bool, AUTDInternalError>

Receive data from devices
source§

fn is_open(&self) -> bool

Check if link is open
source§

fn timeout(&self) -> Duration

Get timeout
source§

fn send_receive( &mut self, tx: &TxDatagram, rx: &mut RxDatagram, timeout: Duration ) -> Result<bool, AUTDInternalError>

Send and receive data
source§

fn wait_msg_processed( &mut self, tx: &TxDatagram, rx: &mut RxDatagram, timeout: Duration ) -> Result<bool, AUTDInternalError>

Wait until message is processed
source§

fn check(&self, tx: &TxDatagram, rx: &mut RxDatagram) -> Vec<bool>

Implementations on Foreign Types§

source§

impl<T: Transducer> Link<T> for Box<dyn Link<T>>

source§

fn open(&mut self, devices: &[Device<T>]) -> Result<(), AUTDInternalError>

source§

fn close(&mut self) -> Result<(), AUTDInternalError>

source§

fn send(&mut self, tx: &TxDatagram) -> Result<bool, AUTDInternalError>

source§

fn receive(&mut self, rx: &mut RxDatagram) -> Result<bool, AUTDInternalError>

source§

fn is_open(&self) -> bool

source§

fn timeout(&self) -> Duration

Implementors§