pub trait ReceiveClient<const PACKET_SIZE: usize> {
    fn message_received(
        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

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

  • 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

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

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