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§
sourcefn message_received(
&self,
id: Id,
buffer: &mut [u8; PACKET_SIZE],
len: usize,
status: Result<(), Error>,
)
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 messagebuffer
- 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 thestart_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 bufferstatus
- The status for the requestOk()
- There was no error during the reception processErr(Error)
- The error that occurred during the reception process
sourcefn stopped(&self, buffer: &'static mut [u8; PACKET_SIZE])
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 thestart_receive_process
function