Trait kernel::hil::can::ReceiveClient

source ·
pub trait ReceiveClient<const PACKET_SIZE: usize> {
    // Required methods
    fn message_received(
        &self,
        id: Id,
        buffer: &mut [u8; PACKET_SIZE],
        len: usize,
        status: Result<(), Error>,
    );
    fn stopped(&self, buffer: &'static mut [u8; PACKET_SIZE]);
}
Expand description

Client interface for capsules that implement the Receive trait.

Required Methods§

source

fn message_received( &self, id: Id, buffer: &mut [u8; PACKET_SIZE], len: usize, status: Result<(), Error>, )

The driver calls this function when a new message has been received on the given FIFO.

§Arguments:
  • id - The identifier of the received message
  • buffer - A reference to the buffer where the data is stored. This data must be stored. This buffer is usually a slice to the original buffer that was supplied to the start_receive_process. It must be used within this function call. In most cases the data is copied to a driver or application buffer.
  • len - The length of the buffer
  • status - The status for the request
    • Ok() - There was no error during the reception process
    • Err(Error) - The error that occurred during the reception process
source

fn stopped(&self, buffer: &'static mut [u8; PACKET_SIZE])

The driver calls this function when the reception of messages has been stopped.

§Arguments:
  • buffer - The buffer that was given as an argument to the start_receive_process function

Implementors§