Page 1 of 1

Usage of second argument to the CAN_FilerAdd function

Posted: Tue 28. Jun 2022, 18:06
by cgmollo62
Regarding the second argument to the CAN_FilterAdd function, does:

Code: Select all

CAN_FilterAdd (CAN_BUS1, CAN_MSGTYPE_FDF | CAN_MSGTYPE_EXTENDED, 0x000, 0x7FF);
mean the message has to be a CAN FD message and have an extended ID, or does it mean the message has to be a CAN FD message or have an extended ID?

I am guessing the former but would like to confirm. Thanks!

Chris

Re: Usage of second argument to the CAN_FilerAdd function

Posted: Wed 29. Jun 2022, 09:54
by PEAK-Support
The "extended" parameter is not yet implemented - so it does not care which value you use in the function.

See can.h

not used yet, 29 bit IDs received always

Code: Select all

//! @brief
//! This function adds CAN-IDs to the filter.
//!
//! @param		hBus				handle for CAN bus, see CAN_BUS...
//! @param		extended			not used yet, 29 bit IDs received always
//! @param		FromID				start ID (including)
//! @param		ToID				end ID (including)
//!
//! @return		CANResult_t		one result of CAN_ERR_...
CANResult_t  CAN_FilterAdd ( CANHandle_t  hBus, uint8_t  extended, uint32_t  FromID, uint32_t  ToID);
That means only 11Bit ID´s could be filtered, all others will be always received.

Re: Usage of second argument to the CAN_FilerAdd function

Posted: Wed 29. Jun 2022, 15:16
by cgmollo62
Great. Thanks! The code I downloaded last February does not have those param descriptions in the comments for the CAN_FilterAdd function. I will download the code again to get the latest and greatest.