Skip to content

bitrate configuration API#100

Merged
pd0wm merged 15 commits into
mainfrom
bitrate-helpers
Mar 12, 2026
Merged

bitrate configuration API#100
pd0wm merged 15 commits into
mainfrom
bitrate-helpers

Conversation

@pd0wm

@pd0wm pd0wm commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

Resolves #77

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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::bitrate module with BitrateBuilder, timing constants/types, and validation/solve logic (plus tests).
  • Extends CanAdapter with a static timing_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.

Comment thread src/can/mod.rs Outdated
Comment thread src/can/bitrate.rs
Comment thread src/can/bitrate.rs
Comment thread src/vector/types.rs Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Comment thread src/vector/types.rs
Comment thread src/vector/mod.rs
@pd0wm pd0wm merged commit d6fb1cb into main Mar 12, 2026
8 checks passed
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.

[CAN] Add support for bitrate configuration

2 participants