pub trait Filter {
    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

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

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

Returns the number of filters the peripheral provides

Implementors