This project includes a minimal CAN frame deserializer that converts a raw binary buffer into a structured CanFrame object.
12 34 56 78 04 AA BB CC
This represents:
- ID:
0x12345678 - DLC:
0x04 - Data bytes:
AA BB CC(remaining bytes padded with00)
{
id: 0x12345678,
dlc: 4,
data: [AA, BB, CC, 00]
}
This is exactly what the parser returns internally and what the unit tests print to the terminal and CI logs.
When running tests locally or in GitHub Actions, you will see output like:
Input buffer:
12 34 56 78 04 AA BB CC
Output struct:
ID=0x12345678
DLC=4
Data=[AA BB CC 00]
The parser reads:
- 4 bytes → 32‑bit CAN ID (big‑endian)
- 1 byte → DLC
- N bytes → Data payload
- Pads remaining bytes with
0x00to reach 8 bytes
This matches typical automotive ECU expectations.
cmake -S . -B build
cmake --build build
./build/tests
GitHub Actions runs the same tests automatically on:
- Ubuntu
- Windows
- macOS