Trait erdnuss_comms::FrameSerial
source · pub trait FrameSerial {
type SerError;
// Required methods
async fn send_frame(
&mut self,
data: &[u8]
) -> Result<(), Error<Self::SerError>>;
async fn recv<'a>(
&mut self,
frame: &'a mut [u8]
) -> Result<TimedFrame<'a>, Error<Self::SerError>>;
}
Expand description
A trait representing the communication interface of the RS-485 bus
Required Associated Types§
Required Methods§
sourceasync fn send_frame(&mut self, data: &[u8]) -> Result<(), Error<Self::SerError>>
async fn send_frame(&mut self, data: &[u8]) -> Result<(), Error<Self::SerError>>
Send a single frame.
The hardware should begin sending the data as soon as possible, and the future MUST not return until the data is completely done sending, e.g. all data is “flushed”.
This function is responsible for activating the “send mode” of the transceiver on entry (e.g. asserting DE), and disabling it on exit (e.g. deasserting DE).
This function MUST be cancellation safe, including the de-assertion of the “send mode”.
Object Safety§
This trait is not object safe.