feat: generate per-sender Rust modules from DBC files#174
Open
ricardo119 wants to merge 1 commit into
Open
Conversation
Add `write_split_by_sender` to `Config` which parses a DBC file, groups messages by their transmitter node, and writes one `.rs` file per sender plus a `mod.rs` with inline `include!` macros into `OUT_DIR`. Refactor `render_dbc` and `render_root_enum` to accept a `&[&Message]` slice so both the single-file and split paths share the same rendering logic. Add `testing/can-messages-split` crate as a workspace member to exercise the split codegen against `multiple_devices.dbc` in CI via `cargo test --all`. There is also an README.md on testing/can-messasge-split with more details of how the logic is working.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add
write_split_by_sendertoConfigwhich parses a DBC file,groups messages by their transmitter node, and writes one
.rsfileper sender plus a
mod.rswith inlineinclude!macros intoOUT_DIR.Refactor
render_dbcandrender_root_enumto accept a&[&Message]slice so both the single-file and split paths share the same rendering
logic.
Add
testing/can-messages-splitcrate as a workspace member to exercisethe split codegen against
multiple_devices.dbcin CI viacargo test --all.There is also an README.md on testing/can-messasge-split with more details of
how the logic is working.