Table of Contents

Struct CanFilter

Namespace
Pamoja.Can
Assembly
Pamoja.Can.dll

A frame a node keeps: one whose identifier, masked, equals Id, masked, and whose format is the filter's.

public readonly record struct CanFilter : IEquatable<CanFilter>
Implements
Inherited Members

Constructors

CanFilter(uint, uint, bool)

A frame a node keeps: one whose identifier, masked, equals Id, masked, and whose format is the filter's.

public CanFilter(uint Id, uint Mask, bool Extended = false)

Parameters

Id uint

The identifier to match.

Mask uint

The identifier bits that have to match.

Extended bool

Whether the identifier is a 29-bit extended one.

Properties

Extended

Whether the identifier is a 29-bit extended one.

public bool Extended { get; init; }

Property Value

bool

Id

The identifier to match.

public uint Id { get; init; }

Property Value

uint

Mask

The identifier bits that have to match.

public uint Mask { get; init; }

Property Value

uint

Methods

Exact(uint, bool)

A filter that passes one identifier and nothing else.

public static CanFilter Exact(uint id, bool extended = false)

Parameters

id uint

The identifier.

extended bool

Whether it is a 29-bit extended identifier.

Returns

CanFilter

The filter.

Matches(uint, bool)

Reports whether a frame with an identifier passes the filter.

public bool Matches(uint id, bool extended = false)

Parameters

id uint

The frame's identifier.

extended bool

Whether it is a 29-bit extended identifier.

Returns

bool

true when the formats agree and the masked bits are equal.

Pgn(uint)

A filter that passes one J1939 parameter group at any priority, from any source, and for an addressed group, to any destination.

public static CanFilter Pgn(uint pgn)

Parameters

pgn uint

The parameter group number.

Returns

CanFilter

The filter.