Skip to content

Generate enum-typed setters and constructors for signals with value descriptions#178

Open
felixvanoost wants to merge 9 commits into
oxibus:mainfrom
felixvanoost:allow-enum-values-in-setters
Open

Generate enum-typed setters and constructors for signals with value descriptions#178
felixvanoost wants to merge 9 commits into
oxibus:mainfrom
felixvanoost:allow-enum-values-in-setters

Conversation

@felixvanoost

Copy link
Copy Markdown
  • Updates the generated new() constructors and set_<signal>() setters to accept enums for signals that have an associated enum type (value description in the DBC).
  • Generates additional set_<signal>_raw() setters for signals that have an associated enum type, which matches the existing behaviour of set_<signal> before these changes. This now makes the API for the getters and setters symmetrical.
  • Cleans up the formatting of some generated getter/setter function comments for readability and consistency.

This is a breaking change for DBCs that have signals with value descriptions, but should make these signals much cleaner to handle. The best approach is to directly pass the enum-typed signals into set_<signal>, but you can retain the existing behaviour by simply using set_<signal>_raw instead.

This PR should be stacked on top of #176.

@felixvanoost felixvanoost requested a review from nyurik July 14, 2026 21:05
@felixvanoost felixvanoost self-assigned this Jul 14, 2026
@felixvanoost felixvanoost added the enhancement New feature or request label Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant