Skip to content

type-c-service: Pull PortStatus changes from v0.1 - #949

Open
RobertZ2011 wants to merge 1 commit into
OpenDevicePartnership:mainfrom
RobertZ2011:port-port-status-change
Open

type-c-service: Pull PortStatus changes from v0.1#949
RobertZ2011 wants to merge 1 commit into
OpenDevicePartnership:mainfrom
RobertZ2011:port-port-status-change

Conversation

@RobertZ2011

@RobertZ2011 RobertZ2011 commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Pull in changes from PR #941.

Assisted-by: GitHub Copilot:GPT-5.6 Sol

@RobertZ2011 RobertZ2011 self-assigned this Aug 21, 2026
@RobertZ2011
RobertZ2011 force-pushed the port-port-status-change branch 4 times, most recently from 071c2c4 to b088f50 Compare August 26, 2026 20:16
@RobertZ2011
RobertZ2011 requested a lite review from Copilot August 26, 2026 20:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Type-C/PD status surface area by refactoring PortStatus to carry richer negotiated-contract data (SinkContract/SourceContract) including optional PD-specific details, instead of embedding a few boolean flags directly on PortStatus. The Type-C service is adjusted to consume the new contract shape (notably for sink-ready timeout selection), and tests/mocks/examples are updated to construct the new contract structures. This aligns the codebase with the PortStatus changes pulled from the referenced v0.1 work, and centralizes partner-reported PDO flags behind contract methods.

Changes:

  • Introduce SinkContract/SourceContract (+ PdSinkInfo/PdSourceInfo) and update PortStatus to use them.
  • Update Type-C service logic to derive power/timeout decisions from contract capability + PD info (epr_capable(), unconstrained_power(), etc.).
  • Update unit/integration tests, interface mocks, and std examples to build the new contract structures.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
type-c-service/tests/unconstrained.rs Update unconstrained-power test setup to populate SinkContract + PD fixed-data flags.
type-c-service/tests/power.rs Adjust many test fixtures to use SinkContract/SourceContract wrappers instead of raw PowerCapability.
type-c-service/tests/debug_accessory.rs Update debug accessory status fixture to use SourceContract::from_capability.
type-c-service/src/service/ucsi.rs Update UCSI charging-status derivation to read contract.capability.
type-c-service/src/controller/power.rs Use SinkContract helpers and derive sink-ready timeout selection from epr_capable().
type-c-service/src/controller/max_sink_voltage.rs Align sink-ready deadline setup with the new EPR-capable detection on the sink contract.
type-c-interface/src/port/pd.rs Adjust docs referencing removed PortStatus fields (partner PDO info now lives under contracts).
type-c-interface/src/control/pd.rs Add new contract + PD info structs and update PortStatus fields accordingly.
type-c-interface-mocks/tests/connect_disconnect.rs Update assertions to validate contract capability + derived flags rather than removed PortStatus booleans.
type-c-interface-mocks/src/port/mod.rs Update mock plug() to populate the new contract structures and PD fixed-data flags.
examples/std/src/lib/type_c/mock_controller.rs Update std mock controller to populate contract PD info (including unconstrained flag).

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread type-c-interface/src/port/pd.rs
Comment thread type-c-service/src/controller/power.rs
@RobertZ2011
RobertZ2011 force-pushed the port-port-status-change branch from b088f50 to 78f8ca7 Compare August 26, 2026 22:13
@RobertZ2011
RobertZ2011 force-pushed the port-port-status-change branch 2 times, most recently from d240b46 to e6ddd09 Compare September 8, 2026 18:28
@RobertZ2011
RobertZ2011 requested a lite review from Copilot September 8, 2026 18:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The new/modified tests include a timing assertion bug (wrong bounds/constant) and a test-name typo that should be corrected to avoid masking regressions and to keep the suite reliable.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 11/11 changed files
  • Comments generated: 3
  • Review effort level: Lite

Comment thread type-c-service/tests/power.rs
Comment thread type-c-service/tests/power.rs Outdated
Comment thread type-c-service/tests/power.rs Outdated
Pull in changes from PRs OpenDevicePartnership#941.

Assisted-by: GitHub Copilot:GPT-5.6 Sol

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@RobertZ2011
RobertZ2011 force-pushed the port-port-status-change branch from e6ddd09 to e6b6762 Compare September 8, 2026 18:58
@RobertZ2011

Copy link
Copy Markdown
Contributor Author

examples/rt685s-evk failure is expected as the tps6699x crate will need to be updated once these changes land.

@RobertZ2011
RobertZ2011 marked this pull request as ready for review September 8, 2026 20:03
@RobertZ2011
RobertZ2011 requested review from a team as code owners September 8, 2026 20:03
@RobertZ2011
RobertZ2011 enabled auto-merge (squash) September 8, 2026 20:18
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