AUTOSAR COM
Signal groups
Some values only make sense together, like the x and y of a position. A signal group makes sure they always travel as a matching set.
The problem
An application writes x, then y. These are two separate steps. If the packet happens to go out between them, it carries the new x with the old y. The receiver gets a position that never existed.
The fix: a staging area
Put x and y into a signal group. Now writing x or y does not touch the packet. The values go into a staging area first. When all of them are written, the application says "hand over the group", and COM copies the whole set into the packet in one uninterruptible step.
Receiving works the same way in reverse: "fetch the group" copies the whole set from the packet into the staging area in one step, and the application then reads x and y from there.
Try it
Move the position from (1, 1) to (2, 2). Try to catch COM in between: write x, then let the packet go out before writing y.
Staging area
Packet
- No packet sent yet.
What belongs to the group, what to its members
The group is treated as one thing. So most extras from the earlier lessons are set once for the whole group, not per member.
| Feature | Set for |
|---|---|
| Update-bit | The whole group |
| Messages to the application, timeouts | The whole group |
| Triggered or pending | The whole group, or finer per member |
| Filter, send-setting condition | Each member |
All or nothing also holds on the receiving side: if a filter blocks one member, the whole group is dropped. If one member carries the "invalid" value, the whole group is treated as invalid.
Check yourself
Optional. Answer from memory.
The AUTOSAR words
| Plain word here | AUTOSAR word |
|---|---|
| Values that belong together | Complex data type (like a struct) |
| Member of a group | Group signal |
| Staging area | Shadow buffer |
| Hand over / fetch the group | Com_SendSignalGroup / Com_ReceiveSignalGroup |
Source: AUTOSAR COM specification, R25-11, section 7.3 (SWS_Com_00050, 00051, Table 7.5, SWS_Com_00836, 00682). Finer point: there is a second way without a staging area. The application hands COM the whole group as one ready-made block of bytes ("array access"). It is used when the data was already put into bytes by another part of the software.