AUTOSAR COM

Filters

Not every received value is interesting. A filter is a simple yes-or-no rule that lets a value through to the application, or drops it.

What a filter does

A filter belongs to one received signal. Each time a value for that signal arrives, COM asks the rule one question: pass or block?

Pass

COM stores the value and tells the application, as usual.

Block

COM drops the value. Nothing is stored, nobody is told. A read still gives the previous value.

This saves the application work. An application that only cares about changes does not get woken up for the same value again and again.

The eight rules

Rule in plain wordsAUTOSAR name
Let everything throughALWAYS
Let nothing throughNEVER
Only if it is different from the last value that passedMASKED_NEW_DIFFERS_MASKED_OLD
Only if it equals a fixed value XMASKED_NEW_EQUALS_X
Only if it differs from a fixed value XMASKED_NEW_DIFFERS_X
Only if it is inside a rangeNEW_IS_WITHIN
Only if it is outside a rangeNEW_IS_OUTSIDE
Only every Nth arrivalONE_EVERY_N

"Masked" means the comparison can be limited to some of the value's bits, for example to ignore the lowest bits so that tiny changes do not count.

Try it

Pick a rule, set a value, and let it arrive. Here X is 50, the range is 20 to 60, and N is 3.

Things to notice. With "only if different", send the same value twice: the second is blocked. With "every 3rd", the first arrival passes, then two are blocked.

Same rules, second use. On the sending side these same eight rules serve as the conditions that switch between a packet's two send settings (lesson 4). There they never drop anything.

Check yourself

Optional. Answer from memory.

The AUTOSAR words

Plain word hereAUTOSAR word
Filter, ruleReception filter, filter algorithm
The last value that passedold_value

Source: AUTOSAR COM specification, R25-11, section 7.1.4 (SWS_Com_00695, 00273, 00302, 00303, 00231). Finer points: before anything has passed, "the last value" is the signal's start value (0 in this toy). After a timeout, the "only if different" rule lets the next value through whatever it is. "Every Nth" also has an offset that chooses which arrival in each round passes.