USB PD: deprecated and invalid Passive Cable VDO encodings are rejected instead of normalized
@RobertZ2011 is already working on this.
Since Oct 26, 2026.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- rust
- Domain
- embedded-iot
Research direction
Read src/vdm/structured/command/discover_identity/passive_cable_vdo.rs, especially the two try_from implementations and the named failing tests. Run the tests for this file to confirm the current behavior, then apply Table 6.42’s specified receive-side fallbacks at the parse boundary. Done means the invalid current encodings normalize to 3A and deprecated voltage encodings normalize to 20V, with the valid-variant test updated accordingly.
Written by the indexing model from the issue text.
Description
Summary
Table 6.42 specifies receive-side fallbacks for four encodings. The parser treats all four as errors, so conforming cables are rejected.
What the specification requires
USB PD R3.2 V1.2 S6.4.12.3.8, Table 6.42 (Passive Cable VDO).
Maximum VBUS Voltage:
00b - 20V
01b..10b - Deprecated, receiver Shall assume 00b (20V).
11b - 50V
VBUS Current Handling Capability:
00b - Invalid; receiver Shall assume 01b (3A).
01b - 3A
10b - 5A
11b - Invalid; receiver Shall assume 01b (3A).
These are mandated normalizations (Shall assume), not parse errors.
What the code does
VbusCurrentHandlingCapability::try_from returns Err(()) for 00b and 11b. MaximumVbusVoltage maps 01b/10b to ThirtyVolt/FortyVolt, which are not reportable values for a passive cable at all.
Failing tests
On branch audit:
/// USB PD R3.2 V1.2 Table 6.42 (Passive Cable VDO), VBUS Current Handling Capability:
/// "00b - Invalid; receiver Shall assume 01b (3A)."
/// "11b - Invalid; receiver Shall assume 01b (3A)."
///
/// These are specified receive-side fallbacks, not parse errors. A conforming
/// receiver normalizes both to 3A rather than rejecting the cable.
#[test]
fn invalid_values_fall_back_to_three_amps() {
for v in [0u8, 3] {
assert_eq!(
VbusCurrentHandlingCapability::try_from(v),
Ok(VbusCurrentHandlingCapability::ThreeAmps),
"raw={v} must be normalized to 3A per USB PD R3.2 V1.2 Table 6.42"
);
}
}
/// USB PD R3.2 V1.2 Table 6.42 (Passive Cable VDO), Maximum VBUS Voltage:
/// "01b..10b - Deprecated, receiver Shall assume 00b (20V)."
///
/// Encodings 01b and 10b are deprecated, not alternative voltages. A conforming
/// receiver reports 20V for both rather than 30V/40V.
#[test]
fn deprecated_values_fall_back_to_twenty_volts() {
for v in [0b01u8, 0b10] {
assert_eq!(
MaximumVbusVoltage::try_from(v),
Ok(MaximumVbusVoltage::TwentyVolt),
"raw={v} is deprecated and must be reported as 20V per USB PD R3.2 V1.2 Table 6.42"
);
}
}
The companion all_valid_variants was also corrected: it previously asserted 01b -> 30V and 10b -> 40V.
Suggested fix
Apply the specified fallbacks at the parse boundary. Consider whether ThirtyVolt/FortyVolt should remain inhabitants of MaximumVbusVoltage at all, since no conforming passive cable can report them. Note Table 6.45 specifies a different mapping for VPDs (encodings 1..3 all become 20V) and Table 6.43 repeats the cable mapping for active cables; both are out of scope here.
- Dominant language
- Rust
- Stars
- 2
- Forks
- 8
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 9
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from OpenDevicePartnership/embedded-usb-pd
-
bug conformance
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
USB PD: Structured VDM Command accepts values wider than the 5-bit fieldMay be free again @RobertZ2011 claimed this 35 days ago, and no pull request is open. OpenBREAKING CHANGE bug conformance
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
OpenDevicePartnership/embedded-usb-pd#92 · 1 assignee ·
-
USB PD: extended Alert event 5 is rejected although it is definedMay be free again @RobertZ2011 claimed this 36 days ago, and no pull request is open. Openbug conformance
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
OpenDevicePartnership/embedded-usb-pd#90 · 1 comment · 1 assignee ·
-
PD r3.2 v1.1 ->r3.2 v1.2 upgradeMay be free again @RobertZ2011 claimed this 36 days ago, and no pull request is open. Open
OpenDevicePartnership/embedded-usb-pd#119 · 1 assignee ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
All issues in OpenDevicePartnership/embedded-usb-pd
Similar issues
-
app bug session
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
marketing
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 92/100
Maintainers usually reply within 1 day
-
macOS autosubmit enable passes unsupported --wait to launchctl bootoutPossibly taken @iqdoctor claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
junhoyeo/tokscale#1713 · 3 comments ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day