Conversation
Add PowerStatusV2 (40 B, version byte = 2) with offset-checked decode and a known-bytes round-trip test that locks the wire layout. The dispatcher branches on the payload version byte and down-converts v2 -> PowerStatusV1 for storage (host stays v1-native for now), so the strict decoder no longer rejects v2 frames emitted by the CH32X.
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.
Why
The firmware now emits
power.statusv2 (40-bytewups_power_status_v2_t, version byte = 2) — merged inWeb3-Pi-UPSPR #3 (2026-06-21). The agent onmain(e58083a) runs the v1-strictcheck_version()and rejects any frame whose version byte ≠ 1, so a Pi running an agent built frommain/release v2.0.1 would drop all UPS telemetry from v2 firmware — leaving the safe-shutdown logic blind to battery state.This branch (
fe4e768) adds the matching v2 decoder.What
src/proto/payloads.rs:PowerStatusV2(40 B, offset-checked) with a known-bytes round-trip test locking the wire layout.src/dispatcher.rs: branch on the version byte; down-convert v2 →PowerStatusV1for storage so the rest of the host stays v1-native.Verification
cargo test→ 82/82 passing (incl. the v2 round-trip test).Follow-up
After merge, tag
v2.1.0sorelease.ymlbuilds the aarch64 artifact andWeb3-Pi-vOSpicks it up via the latest-release install path.