Serial CAN bus bit rate selector#69
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a selectable (and persisted) CAN nominal bit rate for Serial/SLCAN connections, threading the chosen rate from UI → settings → connection source → driver open.
Changes:
- Introduces
CanBusSpeedand extendsConnectionSource::Serialto carry the selected bit rate. - Updates the SLCAN serial driver to open the CAN channel at the selected nominal bit rate.
- Adds a sidebar UI control to select CAN speed and persists it via
settings.json.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
src/ui/sidebar.rs |
Adds CAN speed ComboBox and threads speed into Serial source selection. |
src/settings.rs |
Persists a default CAN speed in settings. |
src/connection.rs |
Adds CanBusSpeed and extends ConnectionSource::Serial to include it. |
src/can/driver.rs |
Passes selected speed into SerialDriver and opens SLCAN with it. |
src/app.rs |
Stores can_bus_speed in app state and saves/loads it via settings. |
Comments suppressed due to low confidence (1)
src/app.rs:74
- Speed is being persisted in two places (
Settings.selected_speed/DAQApp.can_bus_speedand also insideselected_sourcefor the Serial variant). This duplication makes it easy to persist/load inconsistent state (especially if only one is updated). It would be more robust to have a single source of truth (store speed only inConnectionSource::Serialor only inSettings/DAQApp) or to explicitly reconcile them when saving/loading.
pub fn save_settings(&self) {
let settings = settings::Settings {
dbc_path: self.parser.as_ref().map(|p| p.dbc_path.clone()),
selected_source: self.selected_source.clone(),
selected_speed: self.can_bus_speed,
udp_port: self.udp_port,
theme: self.theme_selection,
pixels_per_point: self.pixels_per_point,
};
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
44546ad to
913c2fa
Compare
Member
|
r we waiting to test this one? |
Member
Author
|
We can if you want to wait, but it might be easier to merge it and then if it has problems fix it later? |
irvingywang
approved these changes
May 30, 2026
… trying to auto update it less UI desync and less weirdness in general
913c2fa to
355aacf
Compare
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.
No description provided.