# Message Overview

This implementation sends **6 messages** every 20 ms (50 Hz cycle). All use 29-bit extended IDs and 8 data bytes, conforming to SAE J1939.

### Message table

<div class="overflow-x-auto w-full px-2 mb-6" id="bkmrk-id-%28hex%29-name-pgn-va"><table class="min-w-full border-collapse text-sm leading-[1.7] whitespace-normal"><thead class="text-left"><tr><th class="text-text-100 border-b-0.5 border-border-300/60 py-2 pr-4 align-top font-bold" scope="col">ID (hex)</th><th class="text-text-100 border-b-0.5 border-border-300/60 py-2 pr-4 align-top font-bold" scope="col">Name</th><th class="text-text-100 border-b-0.5 border-border-300/60 py-2 pr-4 align-top font-bold" scope="col">PGN</th><th class="text-text-100 border-b-0.5 border-border-300/60 py-2 pr-4 align-top font-bold" scope="col">Variable</th><th class="text-text-100 border-b-0.5 border-border-300/60 py-2 pr-4 align-top font-bold" scope="col">Active bytes</th></tr></thead><tbody><tr><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top">`0x0CF00400`</td><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top">EEC1 — Engine RPM</td><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top">61444</td><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top">`rpm`</td><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top">3–4</td></tr><tr><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top">`0x0CFE6CEE`</td><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top">TCO1 — Vehicle speed</td><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top">65132</td><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top">`vel`</td><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top">6–7</td></tr><tr><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top">`0x18FEEE00`</td><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top">ET1 — Engine temperature</td><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top">65262</td><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top">`temp`</td><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top">0</td></tr><tr><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top">`0x18FEFC21`</td><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top">ZBR — Throttle</td><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top">65276</td><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top">`gas`</td><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top">1</td></tr><tr><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top">`0x18FEAE0B`</td><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top">EBS — Air pressure</td><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top">65198</td><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top">`aire1`, `aire2`</td><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top">2–3</td></tr><tr><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top">`0x18EEFF21`</td><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top">Heartbeat</td><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top">—</td><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top">—</td><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top">all `0x00`</td></tr></tbody></table>

</div>### 29-bit ID structure

Every J1939 message ID encodes three fields:

<div class="overflow-x-auto w-full px-2 mb-6" id="bkmrk-bits-field-descripti"><table class="min-w-full border-collapse text-sm leading-[1.7] whitespace-normal"><thead class="text-left"><tr><th class="text-text-100 border-b-0.5 border-border-300/60 py-2 pr-4 align-top font-bold" scope="col">Bits</th><th class="text-text-100 border-b-0.5 border-border-300/60 py-2 pr-4 align-top font-bold" scope="col">Field</th><th class="text-text-100 border-b-0.5 border-border-300/60 py-2 pr-4 align-top font-bold" scope="col">Description</th></tr></thead><tbody><tr><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top">28–26</td><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top">Priority</td><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top">0 (highest) to 7 (lowest)</td></tr><tr><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top">25–8</td><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top">PGN</td><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top">Identifies the data type</td></tr><tr><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top">7–0</td><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top">SA</td><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top">Source address — which ECU is sending</td></tr></tbody></table>

</div>### Byte convention

Unused bytes are always set to `0xFF`, which in J1939 means **parameter not available** (SNA — Specific Not Available).

<div aria-label="Code" class="relative group/copy bg-bg-000/50 border-0.5 border-border-400 rounded-lg focus:outline-none focus-visible:ring-2 focus-visible:ring-accent-100" id="bkmrk-" role="group" tabindex="0"><div class="sticky opacity-0 group-hover/copy:opacity-100 group-focus-within/copy:opacity-100 top-2 py-2 h-12 w-0 float-right"><div class="absolute right-0 h-8 px-2 items-center inline-flex z-10"><div class="relative"><div class="transition-all opacity-100 scale-100"><svg aria-hidden="true" class="transition-all opacity-100 scale-100" fill="currentColor" height="20" viewbox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg"><path d="M12.5 3A1.5 1.5 0 0 1 14 4.5V6h1.5A1.5 1.5 0 0 1 17 7.5v8a1.5 1.5 0 0 1-1.5 1.5h-8A1.5 1.5 0 0 1 6 15.5V14H4.5A1.5 1.5 0 0 1 3 12.5v-8A1.5 1.5 0 0 1 4.5 3zm1.5 9.5a1.5 1.5 0 0 1-1.5 1.5H7v1.5a.5.5 0 0 0 .5.5h8a.5.5 0 0 0 .5-.5v-8a.5.5 0 0 0-.5-.5H14zM4.5 4a.5.5 0 0 0-.5.5v8a.5.5 0 0 0 .5.5h8a.5.5 0 0 0 .5-.5v-8a.5.5 0 0 0-.5-.5z"></path></svg></div><div class="absolute inset-0 flex items-center justify-center"><div class="transition-all opacity-0 scale-50"><svg aria-hidden="true" class="transition-all opacity-0 scale-50" fill="currentColor" height="20" viewbox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg"><path d="M15.188 5.11a.5.5 0 0 1 .752.626l-.056.084-7.5 9a.5.5 0 0 1-.738.033l-3.5-3.5-.064-.078a.501.501 0 0 1 .693-.693l.078.064 3.113 3.113 7.15-8.58z"></path></svg></div></div></div></div></div><div class="overflow-x-auto"></div></div>```
Byte:   0     1     2     3     4     5     6     7
      ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐
      │ FF  │ FF  │ FF  │ Lo  │ Hi  │ FF  │ FF  │ FF  │
      └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘
                          ↑     ↑
                    Actual data (little-endian)
```

### Send cycle

All 6 messages are sent sequentially every 20 ms:

<div aria-label="cpp code" class="relative group/copy bg-bg-000/50 border-0.5 border-border-400 rounded-lg focus:outline-none focus-visible:ring-2 focus-visible:ring-accent-100" id="bkmrk--1" role="group" tabindex="0"><div class="sticky opacity-0 group-hover/copy:opacity-100 group-focus-within/copy:opacity-100 top-2 py-2 h-12 w-0 float-right"><div class="absolute right-0 h-8 px-2 items-center inline-flex z-10"><div class="relative"><div class="transition-all opacity-100 scale-100"><svg aria-hidden="true" class="transition-all opacity-100 scale-100" fill="currentColor" height="20" viewbox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg"><path d="M12.5 3A1.5 1.5 0 0 1 14 4.5V6h1.5A1.5 1.5 0 0 1 17 7.5v8a1.5 1.5 0 0 1-1.5 1.5h-8A1.5 1.5 0 0 1 6 15.5V14H4.5A1.5 1.5 0 0 1 3 12.5v-8A1.5 1.5 0 0 1 4.5 3zm1.5 9.5a1.5 1.5 0 0 1-1.5 1.5H7v1.5a.5.5 0 0 0 .5.5h8a.5.5 0 0 0 .5-.5v-8a.5.5 0 0 0-.5-.5H14zM4.5 4a.5.5 0 0 0-.5.5v8a.5.5 0 0 0 .5.5h8a.5.5 0 0 0 .5-.5v-8a.5.5 0 0 0-.5-.5z"></path></svg></div><div class="absolute inset-0 flex items-center justify-center"><div class="transition-all opacity-0 scale-50"><svg aria-hidden="true" class="transition-all opacity-0 scale-50" fill="currentColor" height="20" viewbox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg"><path d="M15.188 5.11a.5.5 0 0 1 .752.626l-.056.084-7.5 9a.5.5 0 0 1-.738.033l-3.5-3.5-.064-.078a.501.501 0 0 1 .693-.693l.078.064 3.113 3.113 7.15-8.58z"></path></svg></div></div></div></div></div><div class="overflow-x-auto"></div></div>```c++
void loop() {
    // send all messages
    // ...
    delay(20);  // 50 Hz
}
```

### Source addresses in use

<div class="overflow-x-auto w-full px-2 mb-6" id="bkmrk-sa-%28hex%29-decimal-ecu"><table class="min-w-full border-collapse text-sm leading-[1.7] whitespace-normal"><thead class="text-left"><tr><th class="text-text-100 border-b-0.5 border-border-300/60 py-2 pr-4 align-top font-bold" scope="col">SA (hex)</th><th class="text-text-100 border-b-0.5 border-border-300/60 py-2 pr-4 align-top font-bold" scope="col">Decimal</th><th class="text-text-100 border-b-0.5 border-border-300/60 py-2 pr-4 align-top font-bold" scope="col">ECU</th></tr></thead><tbody><tr><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top">`0x00`</td><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top">0</td><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top">Engine ECU (RPM, temperature)</td></tr><tr><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top">`0xEE`</td><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top">238</td><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top">Tachograph ECU (speed)</td></tr><tr><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top">`0x21`</td><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top">33</td><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top">Simulator node (throttle, heartbeat)</td></tr><tr><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top">`0x0B`</td><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top">11</td><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top">EBS brake ECU (air pressure)</td></tr></tbody></table>

</div>