Struct CanFilter
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
IduintThe identifier to match.
MaskuintThe identifier bits that have to match.
ExtendedboolWhether 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
Id
The identifier to match.
public uint Id { get; init; }
Property Value
Mask
The identifier bits that have to match.
public uint Mask { get; init; }
Property Value
Methods
Exact(uint, bool)
A filter that passes one identifier and nothing else.
public static CanFilter Exact(uint id, bool extended = false)
Parameters
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
Returns
- bool
truewhen 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
pgnuintThe parameter group number.
Returns
- CanFilter
The filter.