Skip to content

Generate portable payload accessors and clarify embedded output - #14

Merged
ip332 merged 1 commit into
mainfrom
feat/portable-payload-accessors
Nov 23, 2026
Merged

ip332 merged 1 commit into
mainfrom
feat/portable-payload-accessors

Conversation

@ip332

@ip332 ip332 commented Nov 23, 2026

Copy link
Copy Markdown
Owner

Add dbc_compiler -accessor_path to generate standalone C11/C++14 payload accessors using explicit byte shifts and masks. Support mixed Intel/Motorola signals, raw writes preserving surrounding bits, signed physical reads, byte strings, multiplex alternatives, VAL_ constants, and selecting individual messages at include time.

Keep the legacy packed-union output for compatibility. Document its ABI limitations and direct embedded lookup users to the existing plain-C const database. Correct the README’s allocation claims: the C++ PGN map allocates during initialization.

Accessors require a full-sized payload. Callers choose the active multiplex alternative and set the switch separately. Invalid layouts and identifier collisions fail generation without partial output.

Validation: 354 tests passed in Linux Docker, including generated code compiled and executed as strict C11 and C++14, known wire-byte checks, signed 64-bit values, byte strings, selection, label collisions, invalid layouts, and full-log replays. Coverage gate passed: 98.2% lines, 94.2% branches. Seven existing tests remain disabled.

Closes #6.
Closes #7.

@ip332
ip332 merged commit 6cdd563 into main Nov 23, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Union output is not a portable C lookup table Generated PGN table builds a std::map at startup and is not allocation-free

1 participant