CAN filter mask #44
-
|
I would like to kindly ask if it is possible to set custom mask for CAN filters? Upon setting filter using StartMsgFilter (PASS or BLOCK - it does not matter) mask is set to 0xFFFF. |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 5 replies
-
You should be able to specify any ushort for the mask and use a hard cast to pass it in. |
Beta Was this translation helpful? Give feedback.
-
|
not very clear. maskMsg, patternMsg, flowControlMsg. why is there three? with FLOW_CONTROL_FILTER type it seems only patternMsg matters, this exact value passes. nothing in the maskMsg seems to matter. with PASS_FILTER type i get errors not matter whats in the 3. trying to pass all 7xx messages. |
Beta Was this translation helpful? Give feedback.
-
|
I was mistaken in my comment specifying a ushort and a hard cast to pass it in. You could try this As for why there are three filter parameters, you should reference the SAE J2534 standard. I didn't create it, I just follow it. Brian |
Beta Was this translation helpful? Give feedback.
-
|
Also, for anyone else that reads this, I don't remember where I read it, but I seem to remember somewhere that wildecards (eg: mask other than 0xFF) are not supported in the mask. I think that is a totally ridiculous design decision, but some Drewtech drivers won't use them. |
Beta Was this translation helpful? Give feedback.
-
|
PASS_FILTER doesnt work with a GM MDI2 or a scanmatik2. both give invlalid_filter_id or invalid_msg errors. it seems to work with an intrepidcs valuecan4-2. |
Beta Was this translation helpful? Give feedback.
I was mistaken in my comment specifying a ushort and a hard cast to pass it in.
You could try this
var filter = new MessageFilter()
{
Mask = 0xF00,
Pattern = 0x700,
FilterType = Filter.PASS_FILTER
};
As for why there are three filter parameters, you should reference the SAE J2534 standard. I didn't create it, I just follow it.
Brian