CANpie FD
CAN programming interface environment - Version 3.08
|
Public Types | |
enum | FilterType_e { , eFILTER_ACCEPT, eFILTER_REJECT } |
Public Member Functions | |
QCanFilter () | |
bool | acceptFrame (const QCanFrame::FrameFormat_e &teFormatR, const uint32_t ulIdentifierLowV, const uint32_t ulIdentifierHighV) |
bool | match (const QCanFrame &clFrameR) const |
FilterType_te | type (void) const |
QCanFilter::QCanFilter | ( | ) |
Constructs an empty filter
bool QCanFilter::acceptFrame | ( | const QCanFrame::FrameFormat_e & | teFormatR, |
const uint32_t | ulIdentifierLowV, | ||
const uint32_t | ulIdentifierHighV | ||
) |
[in] | clFrameR | - CAN frame |
TRUE
if parameter values are valid The function configures an acceptance filter for CAN frames with a frame format defined by teFormatR
. All CAN frames with an identifier value within the range from ulIdentifierLowV
to ulIdentifierHighV
will match the filter condition.
In case the supplied parameters for ulIdentifierLowV
and ulIdentifierHighV
are not valid (e.g. identifier value > QCAN_FRAME_ID_MASK_STD for Extended frames) the function will return FALSE
and the filter type is set to QCanFilter::eFILTER_OFF.
bool QCanFilter::match | ( | const QCanFrame & | clFrameR | ) | const |
[in] | clFrameR | - CAN frame |
TRUE
if filter condition is metThe function tests the CAN frame clFrameR
with regards to to configured filter type. For an acceptance filter (QCanFilter::eFILTER_ACCEPT) the function returns TRUE
if the CAN frame meets the acceptance condition (e.g. identifier value).
For a rejection filter (QCanFilter::eFILTER_REJECT) the function returns TRUE
if the CAN frame meets the rejection condition (e.g. identifier value).
|
inline |
The function returns the current filter type, which is implicitly set by the functions acceptFrame() or rejectFrame().