[][src]Trait embedded_hal_can::Filter

pub trait Filter {
    type Id: Id;
    fn from_id(id: Self::Id) -> Self;
fn accept_all() -> Self;
fn from_mask(mask: u32, filter: u32) -> Self; }

A type that will either accept or filter a Frame. The filtering is done solely on the ID of the Frame.

Associated Types

type Id: Id

The Id type this filter works on

Loading content...

Required methods

fn from_id(id: Self::Id) -> Self

Constructs a filter that only accepts Frames with the provided identifier.

fn accept_all() -> Self

Constructs a filter that will accept any Frame.

fn from_mask(mask: u32, filter: u32) -> Self

Create a Filter from a filter/mask combination.

  • Bit 0..11 is used when matching against base id
  • Bit 0..29 is used when matching against extended_id
  • Bit 29 matches the extended frame flag (can be used for only matching against base/extended ids)
  • Bit 30..32 must be 0

Note: When filtering base id any rule put on bit_pos >= 11 will (for implementers: must) be ignored

Panic

(for implementers: must) panic if mask have bits equal to 1 for bit_position >= 30.

Loading content...

Implementors

Loading content...