CAN - explicit filters

If I set explicit filters, are all other messages discarded in a way that they will never be in the read buffer? I’m wondering if I still need to account for other messages in setting the buffer size.


@ wolfbuddy -

A message which is not match to the filter won’t be in read buffer at the end, I think

@ Dat - Thanks.

I realise it’s a slightly stupid question, in that the whole point of the filters is to filter out unwanted messages, but I wanted to double check that they still weren’t going to need to be considered when setting the size of the buffer.

The reason I ask is because I did some testing (with a CANalyzer) where I was sending 4 messages every 0.01s and 2 messages every 0.1s but the messages read count was 420 (please tell me that I’m right in thing this should be 42 :think: ) when reading from the buffer at 0.1s intervals. Also, I had the buffer set to 200 and I didn’t get an error which also seemed a bit odd.

@ wolfbuddy -

Your measured read count 420 is correct
Every 0.01s are 100 intervals/s
Every 0.1s are 10 intervals/s
4 * 100 + 2 * 10 = 420

@ flyseven - the read count is taken at 0.1s intervals though, so I’m pretty sure it should be 42.

@ wolfbuddy -
You are right. I did not take your 0,1s read interval into account. Precise reading would have helped, Sorry

@ wolfbuddy -

You have to read messages out instead of just reading the counter. Or because of somehow, the reading interval is not running correctly, 1s instead of 0.1s, or some other threads have higher priority then the event is triggered lately.

Yeah, I’m definitely reading messages but I realised yesterday a simple mistake that I made :-[ when debugging and counting messages so it’s all fine now. Thanks.