Skip to content

Support relation attributes in attribute_structs - #192

Open
felixvanoost wants to merge 6 commits into
oxibus:mainfrom
felixvanoost:support-ba-rel-attributes
Open

Support relation attributes in attribute_structs#192
felixvanoost wants to merge 6 commits into
oxibus:mainfrom
felixvanoost:support-ba-rel-attributes

Conversation

@felixvanoost

Copy link
Copy Markdown
Contributor

Adds support for DBC BA_DEF_REL_/BA_REL_ relation attributes to the existing attribute_structs option. This is useful for DBCs that define per-node/signal or per-node/message metadata, like a per-receiver GenSigTimeoutTime, that can't be expressed as a plain message or signal attribute. I have added an example in the README to show the syntax.

@felixvanoost
felixvanoost requested review from nyurik and trnila August 24, 2026 16:46
@felixvanoost felixvanoost self-assigned this Aug 24, 2026
@felixvanoost felixvanoost added the enhancement New feature or request label Aug 24, 2026
@codecov

codecov Bot commented Aug 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.29078% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/lib.rs 99.27% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@felixvanoost
felixvanoost force-pushed the support-ba-rel-attributes branch from fa35025 to 180dcce Compare August 24, 2026 16:49
Comment thread README.md

```rust,ignore
impl SomeMessage {
pub const SOME_SIGNAL_ECU2_SIG_TIMEOUT: relation::SigTimeoutInfo =

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense as a use case to filter only the attributes for a specific node/ECU without including the node name (like SOME_SIGNAL_SIG_TIMEOUT)? The code wouldn’t have to hardcode the nodename for reusability?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, I've added an optional for_node argument that generates constants only for a specific node/ECU and removes the node prefix from the generated constant names.

Comment thread src/lib.rs Outdated
continue;
}
let node_ident =
sanitize_name(node, "x", ToSnakeCase::to_snake_case).to_uppercase();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

used on two places, can we unify like its done with MessageExt?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

Comment thread src/lib.rs Outdated
dbc: &'a Dbc,
node_name: &str,
message_id: MessageId,
signal_name: &str,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(could passing Option<&str> reduce duplication with resolved_node_message_attribute?)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@felixvanoost
felixvanoost force-pushed the support-ba-rel-attributes branch from 824df38 to a7d891d Compare August 25, 2026 15:03
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.

2 participants