Skip to content

Allow RBR To Recognize Device When Bootstraping And Hotswaping#388

Merged
matt001k merged 2 commits into
developfrom
fix/rbr_bootstrapping_hot_swap
May 26, 2026
Merged

Allow RBR To Recognize Device When Bootstraping And Hotswaping#388
matt001k merged 2 commits into
developfrom
fix/rbr_bootstrapping_hot_swap

Conversation

@matt001k
Copy link
Copy Markdown
Contributor

@matt001k matt001k commented May 26, 2026

What changed?

Check the last time data has been received from the RBR agnostic of the value being properly parsed.
Always probe for attached RBR if _type is UNKNOWN.

How does it make Bristlemouth better?

This allows the RBR application to set the RBR if one has not been set yet and reinstates hot swapping RBR modules as this bug also broke that functionality.

This happened due to the fact that _last_data_time would never get set because handleDataString would always return false (the function could not parse the string because the application did not know the _type of RBR attached).
_last_data_time should be set no matter if handleDataString returns true or false as this variable is meant to be used to determine when valid data was last received, not if the data was parsed properly. This allows the application to properly probe the RBR sensor.

Testing

The following setup was used for testing:

  • RS232 RBR module on v0.13.11-rc.3
  • 1 RBR coda³ T.D
  • 1 RBR coda³ T

Initially I deleted the rbrCodaType config in the system configs:

Screenshot 2026-05-26 at 10 14 13 AM

I would repeatedly get attempting FTL recovery print statements and the rbrCodaType would never get set.

Screenshot 2026-05-26 at 10 14 02 AM

I then proceeded to flash the fix in this PR.
Immediately the rbrCodaType was set:

Screenshot 2026-05-26 at 10 15 58 AM

I then hot swapped from the RBR coda³ T.D to the RBR coda³ T and was able to see the config get set and changed upon the next probing window:

Screenshot 2026-05-26 at 10 34 11 AM Screenshot 2026-05-26 at 10 34 38 AM

I then hot-swapped back to the RBR coda³ T.D and it was properly recognized and the configuration was set upon the next probing window:

Screenshot 2026-05-26 at 10 35 18 AM

Where should reviewers focus?

I added an extra safety rail when the _type is not set (UNKNOWN).
Do you believe this is needed?
It could mess with the probing window, but also data should not be getting transmitted up Bristlemouth if _type is not set.

Checklist

  • Add or update unit tests for changed code
  • Ensure all submodules up to date. If this PR relies on changes in submodules, merge those PRs first, then point this PR at/after the merge commit
  • Ensure code is formatted correctly with clang-format. If there are large formatting changes, they should happen in a separate whitespace-only commit on this PR after all approvals.

@matt001k matt001k requested review from towynlin and victorsowa12 May 26, 2026 18:33
@matt001k matt001k self-assigned this May 26, 2026
Copy link
Copy Markdown
Collaborator

@victorsowa12 victorsowa12 left a comment

Choose a reason for hiding this comment

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

Nice find! LGTM!

@matt001k matt001k merged commit 05d8ab7 into develop May 26, 2026
1 check passed
@matt001k matt001k deleted the fix/rbr_bootstrapping_hot_swap branch May 26, 2026 22:27
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.

2 participants