Skip to content

feat: Support option for padding (set all unused bit to 1)#87

Closed
wallem89 wants to merge 3 commits into
oxibus:mainfrom
wallem89:feature/support-padding-when-encoding
Closed

feat: Support option for padding (set all unused bit to 1)#87
wallem89 wants to merge 3 commits into
oxibus:mainfrom
wallem89:feature/support-padding-when-encoding

Conversation

@wallem89

@wallem89 wallem89 commented Nov 5, 2024

Copy link
Copy Markdown

This feature is adding the support for padding. In other words the option to set all unused bits to 1 instead of 0. One use case is when creating SAE J1939 message in which all unused bits so be set to 1.

See also issue 86 .

@felixvanoost
felixvanoost requested a review from trnila July 13, 2026 20:07
@felixvanoost

Copy link
Copy Markdown

I'm also interested in this feature. Any chance we can merge this?

@trnila trnila left a comment

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.

Looks good, if there are not cases of mixed paddings within a single DBC file.

@wallem89 could you please resolve merge conflicts?

Comment thread src/lib.rs

/// Optional: Padding value used; set all unused bits to 1 if true else 0. Default: `false`.
#[builder(default)]
pub padding_value: bool,

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.

or padding_bit/unused_bit_value?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Perhaps padding_bit_value would be the clearest? Since it's a Boolean, padding_bit could be confused with enabling or disabling padding instead of specifying which value we want the padding to be.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I agree and have changed the name

@wallem89

Copy link
Copy Markdown
Author

Sorry I couldn't get rebase to work on this PR so I made a new one based on latest main: #184

@wallem89 wallem89 closed this Jul 17, 2026
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.

3 participants