bitrate configuration API#100
Merged
Merged
Conversation
ae49314 to
ef1719c
Compare
There was a problem hiding this comment.
Pull request overview
Adds a generic bitrate/timing configuration helper API across CAN adapters to support issue #77 (bitrate configuration), including adapter timing metadata and Vector XL CAN-FD configuration conversion.
Changes:
- Introduces
can::bitratemodule withBitrateBuilder, timing constants/types, and validation/solve logic (plus tests). - Extends
CanAdapterwith a statictiming_const()API and implements it for Vector, SocketCAN, and Panda adapters. - Adds
From<BitrateConfig> for XLcanFdConf, plus Vector-specific timing constants and a regression test against the predefined Vector config.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/can/mod.rs | Exposes new bitrate module and adds timing_const() requirement to CanAdapter. |
| src/can/bitrate.rs | New bitrate/timing solver and builder API with extensive unit tests. |
| src/vector/types.rs | Adds equality for XLcanFdConf and conversion from BitrateConfig to Vector CAN-FD config. |
| src/vector/mod.rs | Updates predefined Vector config values, adds Vector timing constants, implements timing_const(), and adds a builder-vs-constant test. |
| src/socketcan/mod.rs | Adds timing metadata implementation (currently dummy) to satisfy the new CanAdapter API. |
| src/panda/mod.rs | Adds timing metadata implementation (currently dummy) to satisfy the new CanAdapter API. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Resolves #77