[][src]Trait embedded_can::Can

pub trait Can {
    type Frame: Frame;
    type Error;
    pub fn try_transmit(
        &mut self,
        frame: &Self::Frame
    ) -> Result<Option<Self::Frame>, Self::Error>;
pub fn try_receive(&mut self) -> Result<Self::Frame, Self::Error>; }

A CAN interface that is able to transmit and receive frames.

Associated Types

type Frame: Frame[src]

Associated frame type.

type Error[src]

Associated error type.

Loading content...

Required methods

pub fn try_transmit(
    &mut self,
    frame: &Self::Frame
) -> Result<Option<Self::Frame>, Self::Error>
[src]

Puts a frame in the transmit buffer to be sent on the bus.

If the transmit buffer is full, this function will try to replace a pending lower priority frame and return the frame that was replaced. Returns Err(WouldBlock) if the transmit buffer is full and no frame can be replaced.

Notes for implementers

  • Frames of equal identifier shall be transmited in FIFO fashion when more than one transmit buffer is available.
  • When replacing pending frames make sure the frame is not in the process of being send to the bus.

pub fn try_receive(&mut self) -> Result<Self::Frame, Self::Error>[src]

Returns a received frame if available.

Loading content...

Implementors

Loading content...