Skip to content

Adopt public fields for UCSI types - #974

Merged
RobertZ2011 merged 2 commits into
OpenDevicePartnership:mainfrom
RobertZ2011:pull-in-embedded-usb-pd-ucsi-no-bincode
Nov 2, 2026
Merged

RobertZ2011 merged 2 commits into
OpenDevicePartnership:mainfrom
RobertZ2011:pull-in-embedded-usb-pd-ucsi-no-bincode

Conversation

@RobertZ2011

Copy link
Copy Markdown
Contributor

embedded-usb-pd now exposes UCSI struct fields directly instead of through getters and setters, and LPM commands carry the connector number in their arguments. Update tcpm-service, its tests and the std example to use the fields, and retarget LPM commands to the local port with MapPort.

Assisted-by: GitHub Copilot:claude-sonnet-5.5

@RobertZ2011 RobertZ2011 self-assigned this Oct 19, 2026
@RobertZ2011 RobertZ2011 added this to EC Oct 19, 2026
@RobertZ2011 RobertZ2011 moved this to In Progress in EC Oct 19, 2026
@RobertZ2011
RobertZ2011 requested a balanced review from Copilot October 19, 2026 17:30

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.

🟢 Approval recommended

Static review found no blocking issues in this narrowly scoped API migration; tests were not run.

No open issues 🎉

What changed in this PR

Updates TCPM service integration with embedded-usb-pd’s public UCSI fields and connector-bearing command arguments.

Changes:

  • Replaces UCSI getters and setters with direct field access.
  • Maps global connector IDs to local ports using MapPort.
  • Adapts integration tests and the std mock controller to the updated API.
File Description
tcpm-service/​tests/​ucsi.rs Updates command construction, assertions, and shared helpers.
tcpm-service/​src/​service/​ucsi.rs Migrates field access and local command mapping.
tcpm-service/​src/​service/​power.rs Reads notification flags directly.
examples/​std/​src/​lib/​type_c/​mock_controller.rs Updates connector logging and command matching.

Review effort: Balanced

@RobertZ2011
RobertZ2011 force-pushed the pull-in-embedded-usb-pd-ucsi-no-bincode branch from 047c3d6 to 4596864 Compare October 19, 2026 18:23
@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Cargo Vet Audit Passed

cargo vet has passed in this PR. No new unvetted dependencies were found.

@github-actions github-actions Bot added the cargo vet PRs pending auditor review label Oct 19, 2026
@RobertZ2011
RobertZ2011 force-pushed the pull-in-embedded-usb-pd-ucsi-no-bincode branch from 4596864 to ec448a4 Compare October 19, 2026 18:40
@RobertZ2011
RobertZ2011 marked this pull request as ready for review October 19, 2026 18:45
@RobertZ2011
RobertZ2011 requested review from a team as code owners October 19, 2026 18:46
@RobertZ2011
RobertZ2011 enabled auto-merge (squash) October 19, 2026 18:46
@RobertZ2011
RobertZ2011 requested a review from tullom October 20, 2026 18:42
jerrysxie
jerrysxie previously approved these changes Oct 20, 2026
Comment thread tcpm-service/tests/ucsi.rs Resolved
Comment thread Cargo.lock Resolved
Comment thread tcpm-service/src/service/ucsi.rs Resolved
Comment thread tcpm-service/tests/ucsi.rs Resolved
@RobertZ2011
RobertZ2011 marked this pull request as draft October 21, 2026 20:16
auto-merge was automatically disabled October 21, 2026 20:16

Pull request was converted to draft

@RobertZ2011
RobertZ2011 force-pushed the pull-in-embedded-usb-pd-ucsi-no-bincode branch from 2d6aa9e to 45def63 Compare October 27, 2026 15:49
@RobertZ2011
RobertZ2011 marked this pull request as ready for review October 27, 2026 16:10
@RobertZ2011
RobertZ2011 enabled auto-merge (squash) October 27, 2026 16:10
@RobertZ2011
RobertZ2011 force-pushed the pull-in-embedded-usb-pd-ucsi-no-bincode branch 2 times, most recently from 706ed49 to 14efe9d Compare October 27, 2026 21:43
RobertZ2011 and others added 2 commits November 2, 2026 14:31
embedded-usb-pd now exposes UCSI struct fields directly instead of
through getters and setters, and LPM commands carry the connector
number in their arguments. Update tcpm-service, its tests and the std
example to use the fields, and retarget LPM commands to the local port
with MapPort.

Assisted-by: GitHub Copilot:claude-sonnet-5.5

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: c9a94a93-729f-451c-b08e-78887f5542e8
@RobertZ2011
RobertZ2011 force-pushed the pull-in-embedded-usb-pd-ucsi-no-bincode branch from 14efe9d to 93f57bb Compare November 2, 2026 21:31
@RobertZ2011
RobertZ2011 merged commit 4051b1d into OpenDevicePartnership:main Nov 2, 2026
16 of 32 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in EC Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cargo vet PRs pending auditor review

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

6 participants