AUTOSAR的COM模块从本质上来讲就是处理信号的接收和发送事宜,简化后就像下图这个样子,一进一出,有来有回:
-
信号滤波
COM支持的信号级滤波算法见下表:
Name |
Algorithm |
Description |
ALWAYS |
True |
No filtering is performed so that the message always passes. |
NEVER |
False |
The filter removes all messages. |
MASKED_NEW_EQUALS_X |
(new_value&mask) == x |
Pass messages whose masked value is equal to a specific value. |
MASKED_NEW_DIFFERS_X |
(new_value&mask) != x |
Pass messages whose masked value is not equal to a specific value. |
MASKED_NEW_DIFFERS_MASKED_OLD |
(new_value&mask) != (old_value&mask) |
Pass messages where the masked value has changed. |
NEW_IS_WITHIN |
min <= new_value <= max |
Pass a message if its value is within a predefined boundary. |
NEW_IS_OUTSIDE |
(min > new_value) || (new_value > max) |
Pass a message if its value is outside a predefined boundary. |
ONE_EVERY_N |
Occurrence%period == offset |
Pass a message once every N message occurrences. Start: occurrence=0. Each time the message is received or transmitted, occurrence is incremented by 1 after filtering. Length of occurrence is 8 bit(minimum). |
表中前7种算法结合描述比较容易理解,最后一种ONE_EVERY_N是指在period次filter中只有第offset次才能通过,打个比方有8个跑马灯编号0-7,循环点亮,指定编号2的灯亮时滤波通过。
-
信号组
COM模块提供将多个信号打包成组看作一个整体来处理的功能: