[][src]Trait kernel::hil::uart::ReceiveClient

pub trait ReceiveClient {
    fn received_buffer(
        &self,
        rx_buffer: &'static mut [u8],
        rx_len: usize,
        rval: ReturnCode,
        error: Error
    ); fn received_word(&self, _word: u32, _rval: ReturnCode, _error: Error) { ... } }

Required methods

fn received_buffer(
    &self,
    rx_buffer: &'static mut [u8],
    rx_len: usize,
    rval: ReturnCode,
    error: Error
)

A call to Receive::receive_buffer completed. The ReturnCode indicates whether the buffer was successfully received. A call to receive_word or receive_buffer made within this callback SHOULD NOT return EBUSY: when this callback is made the UART should be ready to receive another call.

The rx_len argument specifies how many words were transmitted. An rval of SUCCESS indicates that every requested word was received: rx_len in the callback should be the same as rx_len in the initiating call.

rval is SUCCESS if the full buffer was successfully received, or

  • ECANCEL if the call to received_buffer was cancelled and the buffer was not fully received. rx_len contains how many words were received.
  • ESIZE if the buffer could only be partially received. rx_len contains how many words were transmitted.
  • FAIL if reception failed in some way: error may contain further information.
Loading content...

Provided methods

fn received_word(&self, _word: u32, _rval: ReturnCode, _error: Error)

A call to Receive::receive_word completed. The ReturnCode indicates whether the word was successfully received. A call to receive_word or receive_buffer made within this callback SHOULD NOT return EBUSY: when this callback is made the UART should be ready to receive another call.

rval SUCCESS if the word was successfully received, or

  • ECANCEL if the call to receive_word was cancelled and the word was not received: word should be ignored.
  • FAIL if the reception failed in some way and word should be ignored. error may contain further information on the sort of error.
Loading content...

Implementors

Loading content...