USB PD: extended Alert event 5 is rejected although it is defined
@RobertZ2011 is already working on this.
Since Oct 26, 2026.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 73/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- rust
- Domain
- embedded-iot
Research direction
Read the extended-alert conversion in src/ado.rs around lines 124–130 and the test_ado_try_from_standard_alerts test around lines 220–279. Add support for event 5 and its encode path as suggested, then run the relevant tests and confirm the event is accepted; consider the noted downstream exhaustive-match compatibility impact.
Written by the indexing model from the issue text.
Description
Summary
The extended alert parser handles events 1 through 4 only. Event 5 is defined by the current PD specification and is rejected.
What the specification requires
USB PD R3.2 V1.2 S6.4.5, Table 6.25 (Extended Alert Event Type):
5 - Source is about to reduce Source Capabilities
What the code does
0x80 => match raw.extended_alert_type() {
0x01 => Ok(Ado::PowerStateChange),
0x02 => Ok(Ado::PowerButtonPress),
0x03 => Ok(Ado::PowerButtonRelease),
0x04 => Ok(Ado::ControllerInitiatedWake),
_ => Err(InvalidType(raw.0)),
},
A conforming 0x80000005 alert is rejected rather than reporting impending capability reduction.
Failing test
test_ado_try_from_standard_alerts on branch audit. The test previously asserted that event 5 is invalid; that assertion is now inverted:
raw.set_extended_alert_type(0x04);
assert_eq!(Ado::try_from(raw).unwrap(), Ado::ControllerInitiatedWake);
// USB PD R3.2 V1.2 Table 6.25 (Extended Alert Event Type) defines:
// "5 - Source is about to reduce Source Capabilities"
// A conforming extended alert carrying event 5 must not be rejected.
raw.set_extended_alert_type(0x05);
assert!(
Ado::try_from(raw).is_ok(),
"extended alert event 5 (Source about to reduce Source Capabilities) is defined by \
USB PD R3.2 V1.2 Table 6.25 and must be accepted"
);
}
Suggested fix
Add the variant and its encode path. Adding an enum variant is breaking for downstream exhaustive matches.
- 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: deprecated and invalid Passive Cable VDO encodings are rejected instead of normalizedMay 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 78/100
OpenDevicePartnership/embedded-usb-pd#91 · 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