Add second mock battery - #37
Open
dymk wants to merge 1 commit into
Open
Conversation
Register a distinct 2S fuel gauge as battery 1 so integration tests can verify that callers select a battery by ID. Assisted-by: GitHub Copilot:gpt-5.6-sol Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: a3539bc8-3a1f-44b3-ba4a-c171a7822595
There was a problem hiding this comment.
Pull request overview
Extends the platform-common mock battery fixture to expose two independently-driven mock fuel gauges, enabling end-to-end validation of battery-ID selection through the battery service.
Changes:
- Expand the mock battery registration from 1 to 2 fuel gauges (battery 0 = 3S, battery 1 = 2S).
- Initialize and drive each mock fuel gauge independently by spawning separate update tasks.
- Increase the Embassy task pool size to allow multiple
update_data_taskinstances.
Comment on lines
+28
to
+33
| for fuel_gauge in [fuel_gauge_0, fuel_gauge_1] { | ||
| bs::mock::init_state_machine(fuel_gauge) | ||
| .await | ||
| .expect("Failed to initialize battery state machine"); | ||
| spawner.spawn(update_data_task(fuel_gauge).expect("Failed to spawn battery update data task")); | ||
| } |
Member
|
@jerrysxie Looks like CI is failing due to |
RobertZ2011
approved these changes
Jul 27, 2026
kurtjd
approved these changes
Jul 27, 2026
Member
|
@dymk Looks like I can merge and bypass the failed job myself, let me know when you want it merged. |
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.
Summary
This fixture enables end-to-end validation of battery-ID selection through OpenDevicePartnership/odp-secure-services#88.
Validation
cargo fmt --checkcargo build --lockedcargo clippy --locked -- -D warnings