kernel::hil::can

Trait Filter

Source
pub trait Filter {
    // Required methods
    fn enable_filter(&self, filter: FilterParameters) -> Result<(), ErrorCode>;
    fn disable_filter(&self, number: u32) -> Result<(), ErrorCode>;
    fn filter_count(&self) -> usize;
}
Expand description

The Filter trait is used to enable and disable a filter bank.

When the receiving process starts by calling the start_receiving_process in the Receive trait, there MUST be no filter enabled.

Required Methods§

Source

fn enable_filter(&self, filter: FilterParameters) -> Result<(), ErrorCode>

Enables a filter for message reception.

§Arguments:
  • filter - A FilterParameters structure to define the filter configuration
§Return values:
  • Ok() - The filter was successfully configured.
  • Err(ErrorCode) - indicates the error because of which the request cannot be completed
Source

fn disable_filter(&self, number: u32) -> Result<(), ErrorCode>

Disables a filter.

§Arguments:
  • number - The filter Id to identify the filter bank to disable
§Return values:
  • Ok() - The filter was successfully disabled.
  • Err(ErrorCode) - indicates the error because of which the request cannot be completed
Source

fn filter_count(&self) -> usize

Returns the number of filters the peripheral provides

Implementors§