pub trait ReceiveClient {
    // Required method
    fn received_buffer(
        &self,
        rx_buffer: &'static mut [u8],
        rx_len: usize,
        rval: Result<(), ErrorCode>,
        error: Error
    );

    // Provided method
    fn received_word(
        &self,
        _word: u32,
        _rval: Result<(), ErrorCode>,
        _error: Error
    ) { ... }
}

Required Methods§

source

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

A call to Receive::receive_buffer completed. The Result<(), ErrorCode> indicates whether the buffer was successfully received. A call to receive_word or receive_buffer made within this callback SHOULD NOT return BUSY: when this callback is made the UART should be ready to receive another call.

The rx_len argument specifies how many words were received. An rval of Ok(()) 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 Ok(()) if the full buffer was successfully received, or

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

Provided Methods§

source

fn received_word(&self, _word: u32, _rval: Result<(), ErrorCode>, _error: Error)

A call to Receive::receive_word completed. The Result<(), ErrorCode> indicates whether the word was successfully received. A call to receive_word or receive_buffer made within this callback SHOULD NOT return BUSY: when this callback is made the UART should be ready to receive another call.

rval Ok(()) if the word was successfully received, or

  • CANCEL 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.

Implementors§