USB PD: deprecated and invalid Passive Cable VDO encodings are rejected instead of normalized
@RobertZ2011 がすでに取り組んでいます。
2026年10月26日 から。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 78/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- rust
- 領域
- embedded-iot
調査の方向性
src/vdm/structured/command/discover_identity/passive_cable_vdo.rsを読み、特に2つのtry_from実装と、名前が挙げられている失敗するテストを確認してください。このファイルのテストを実行して現在の動作を確認し、その後、Table 6.42で指定されている受信側のフォールバックを解析境界で適用してください。無効な現行エンコーディングが3Aに正規化され、非推奨の電圧エンコーディングが20Vに正規化され、有効なバリアントのテストもそれに応じて更新されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Rust
- スター
- 2
- フォーク
- 8
- 平均マージ
- 1日 10時間
- マージ済み PR(30日)
- 9
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
OpenDevicePartnership/embedded-usb-pd のほかの issue
-
bug conformance
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
USB PD: Structured VDM Command accepts values wider than the 5-bit field再び着手できるかも @RobertZ2011 が 35 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンBREAKING CHANGE bug conformance
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
OpenDevicePartnership/embedded-usb-pd#92 · 担当者 1 名 ·
-
USB PD: extended Alert event 5 is rejected although it is defined再び着手できるかも @RobertZ2011 が 36 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンbug conformance
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
OpenDevicePartnership/embedded-usb-pd#90 · コメント 1 件 · 担当者 1 名 ·
-
PD r3.2 v1.1 ->r3.2 v1.2 upgrade再び着手できるかも @RobertZ2011 が 36 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
OpenDevicePartnership/embedded-usb-pd#119 · 担当者 1 名 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
OpenDevicePartnership/embedded-usb-pd の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
roc-lang/basic-webserver#277 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
samkerrcode/opengent#113 ·
メンテナーはふだん 1 日以内に返信
-
app bug session
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信