Trait autd3_driver::link::Link
source · pub trait Link: Send + Sync {
// Required methods
fn close(&mut self) -> Result<(), AUTDInternalError>;
fn send(&mut self, tx: &TxDatagram) -> Result<bool, AUTDInternalError>;
fn receive(
&mut self,
rx: &mut [RxMessage]
) -> Result<bool, AUTDInternalError>;
fn is_open(&self) -> bool;
fn timeout(&self) -> Duration;
// Provided methods
fn send_receive(
&mut self,
tx: &TxDatagram,
rx: &mut [RxMessage],
timeout: Option<Duration>
) -> Result<bool, AUTDInternalError> { ... }
fn wait_msg_processed(
&mut self,
tx: &TxDatagram,
rx: &mut [RxMessage],
timeout: Duration
) -> Result<bool, AUTDInternalError> { ... }
}Expand description
Link is a interface to the AUTD device
Required Methods§
sourcefn close(&mut self) -> Result<(), AUTDInternalError>
fn close(&mut self) -> Result<(), AUTDInternalError>
Close link
sourcefn send(&mut self, tx: &TxDatagram) -> Result<bool, AUTDInternalError>
fn send(&mut self, tx: &TxDatagram) -> Result<bool, AUTDInternalError>
Send data to devices
Provided Methods§
sourcefn send_receive(
&mut self,
tx: &TxDatagram,
rx: &mut [RxMessage],
timeout: Option<Duration>
) -> Result<bool, AUTDInternalError>
fn send_receive( &mut self, tx: &TxDatagram, rx: &mut [RxMessage], timeout: Option<Duration> ) -> Result<bool, AUTDInternalError>
Send and receive data
sourcefn wait_msg_processed(
&mut self,
tx: &TxDatagram,
rx: &mut [RxMessage],
timeout: Duration
) -> Result<bool, AUTDInternalError>
fn wait_msg_processed( &mut self, tx: &TxDatagram, rx: &mut [RxMessage], timeout: Duration ) -> Result<bool, AUTDInternalError>
Wait until message is processed
Trait Implementations§
source§impl Link for Box<dyn Link>
impl Link for Box<dyn Link>
source§fn send(&mut self, tx: &TxDatagram) -> Result<bool, AUTDInternalError>
fn send(&mut self, tx: &TxDatagram) -> Result<bool, AUTDInternalError>
Send data to devices
source§fn receive(&mut self, rx: &mut [RxMessage]) -> Result<bool, AUTDInternalError>
fn receive(&mut self, rx: &mut [RxMessage]) -> Result<bool, AUTDInternalError>
Receive data from devices
source§fn send_receive(
&mut self,
tx: &TxDatagram,
rx: &mut [RxMessage],
timeout: Option<Duration>
) -> Result<bool, AUTDInternalError>
fn send_receive( &mut self, tx: &TxDatagram, rx: &mut [RxMessage], timeout: Option<Duration> ) -> Result<bool, AUTDInternalError>
Send and receive data
source§fn wait_msg_processed(
&mut self,
tx: &TxDatagram,
rx: &mut [RxMessage],
timeout: Duration
) -> Result<bool, AUTDInternalError>
fn wait_msg_processed( &mut self, tx: &TxDatagram, rx: &mut [RxMessage], timeout: Duration ) -> Result<bool, AUTDInternalError>
Wait until message is processed