Repository navigation
feat: v2.9.0 — Power Management Rebuild (§Phase 14 milestone 53) - #48
Merged
Merged
Conversation
Replaces rcp/powerstate.hpp in full, per the Satellite Package Disposition table's entry for this file: the pre-replacement ad-hoc Active/Sleeping/BusOff model built on rcp.hpp's Zone/CommandType/ Controller is discarded, not adapted. Nothing else in the tree depended on that old API (only this file's own test did), so no legacy shim was needed, same as rcp/e2e.hpp's equivalent note at v2.6.0. - PowerMode gains the specification's actual four modes (Normal, StandBy, Sleep, Unpowered); start_kind_on_exit fixes StandBy as always a hot start and Sleep as always a cold start, exposed on PowerManager as pending_start_kind(). - PowerManager::enter_standby/enter_sleep apply the three documented entry-refusal conditions in a fixed order: an unacknowledged wake-up event (queried directly from rcp::wakeup::WakeupEndpoint::wakeup_message_pending()), a non-idle endpoint, and a non-empty response/ack queue — the latter two exposed as caller-supplied Hooks::endpoints_idle/ Hooks::response_ack_queues_empty predicates rather than a direct rcp/regmap.hpp dependency, mirroring rcp/lifecycle.hpp's PlausibilityCheck pattern. - resume_from_standby implements StandBy's hot-start rule directly (no handshake, straight back to Normal). - begin_wake_from_sleep/note_wakeup_attempt_sent/acknowledge_wakeup implement the hot-start-from-Sleep handshake by directly driving WakeupEndpoint::wakeup_message_pending()/acknowledge_wakeup() in a repeat-until-echoed-or-limit loop (Config::wakeup_repeat_limit, default 8, this implementation's own choice), with Hooks::reenable_network_interface/ Hooks::reenable_response_ack_queues covering the handshake's step 1 and step 3. - notify_power_removed/notify_power_restored model Unpowered as a hardware-driven, unconditional transition with no refusal path. New coverage lives in tests/test_powerstate.cpp (REQ-PWR-001..014, entirely rewritten), traced in .fusa-reqs.json. Bumps kVersion/project version to 2.9.0. Updates ROADMAP.md with a Done (v2.9.0) summary for milestone 53. Signed-off-by: Matt <47545907+SoundMatt@users.noreply.github.com>
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
Implements ROADMAP.md milestone 53, "Power Management Rebuild (v2.9.0)", opening Phase 14. This is a REPLACE of
rcp/powerstate.hppper the Satellite Package Disposition table: the pre-replacement ad-hocActive/Sleeping/BusOffmodel built onrcp.hpp'sZone/CommandType/Controlleris discarded entirely, not adapted, following the OPEN Alliance TC18 Remote Control Protocol Specification v0.5.1_RC's actual power-mode behavior.PowerModegains the specification's actual four modes:Normal/StandBy/Sleep/Unpowered.start_kind_on_exitfixesStandByas always a hot start andSleepas always a cold start (PowerManager::pending_start_kind()).PowerManager::enter_standby/enter_sleepapply the three documented entry-refusal conditions in a fixed order: an unacknowledged wake-up event (queried directly fromrcp::wakeup::WakeupEndpoint::wakeup_message_pending(), v2.7.0), a non-idle endpoint, and a non-empty response/ack queue — the latter two exposed as caller-suppliedHooks::endpoints_idle/Hooks::response_ack_queues_emptypredicates rather than a directrcp/regmap.hppdependency, mirroringrcp/lifecycle.hpp's (v2.1.0)PlausibilityCheckpattern.resume_from_standbyimplements StandBy's hot-start rule directly — no handshake, straight back toNormal.begin_wake_from_sleep/note_wakeup_attempt_sent/acknowledge_wakeupimplement the hot-start-from-Sleep handshake by directly drivingWakeupEndpoint::wakeup_message_pending()/acknowledge_wakeup()in a repeat-until-echoed-or-limit loop, withHooks::reenable_network_interface/Hooks::reenable_response_ack_queuescovering the handshake's network-reenablement and queue-reenablement steps.notify_power_removed/notify_power_restoredmodelUnpoweredas a hardware-driven, unconditional transition with no refusal path.Nothing else in the tree depended on the old
powerstate::ManagerAPI (only its own test did), so no legacy shim was needed, same precedent asrcp/e2e.hpp's REPLACE at v2.6.0.New coverage lives in
tests/test_powerstate.cpp(REQ-PWR-001..014, entirely rewritten), traced in.fusa-reqs.json. BumpskVersion/project version to2.9.0. UpdatesROADMAP.mdwith aDone (v2.9.0)summary for milestone 53.Per the confidentiality constraint on the source specification, no spec text is reproduced anywhere in code/comments/this description — only cited by name.
Test plan
cmake --build build --parallel— full local build (AppleClang 21, C++17 and C++20) green, no new warnings under-Wall -Wextra -Wpedantic -Wshadow -Wnon-virtual-dtor -Wold-style-cast -Wcast-align -Wunused -Woverloaded-virtualctest --test-dir build --output-on-failure— all 59 test suites pass (includingrcp_powerstate, 17 cases / 78 assertions)cpp-rcpCLI target still builds (RELAY_BUILD_CLI=ON).fusa-reqs.jsonis valid JSON;REQ-PWR-001..014traced 1:1 againsttests/test_powerstate.cpp'sfusa:testtags