Support Ledger Flex and Ledger Stax (udev + device detection)#77
Support Ledger Flex and Ledger Stax (udev + device detection)#77
Conversation
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings. WalkthroughUpdates udev rules to consolidate multiple Ledger hardware device rules into a single pattern, and extends device recognition in the Ledger plugin to support new Stax and Flex device models with corresponding vendor IDs and model identifiers. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
contrib/udev/20-hw1.rules (1)
1-8: Approve the udev rule consolidation, but note minor documentation gap.The consolidation of device-specific rules into a single vendor-level rule is a good simplification. The rule correctly matches all Ledger devices with vendor ID 2c97, including the new Stax and Flex models.
However, the comment on line 4 lists "Stax" but omits "Flex" from the enumeration. Consider adding "Flex" to maintain complete documentation.
📝 Suggested comment update
-# Blue, NanoS, Aramis, HW.2, Nano X, NanoSP, Stax, Ledger Test, +# Blue, NanoS, Aramis, HW.2, Nano X, NanoSP, Stax, Flex, Ledger Test,
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
contrib/udev/20-hw1.rules(1 hunks)electrum_dash/plugins/ledger/ledger.py(3 hunks)
🔇 Additional comments (3)
electrum_dash/plugins/ledger/ledger.py (3)
678-679: LGTM! Model ID additions align with modern device recognition.The model IDs 0x60 (Stax) and 0x70 (Flex) are correctly added to support modern firmware where
product_id >> 8extracts the model identifier. This allows recognition of product IDs in ranges 0x6000-0x60FF for Stax and 0x7000-0x70FF for Flex.
721-724: LGTM! Device recognition logic properly extended.The explicit checks for Stax and Flex product keys are correctly added. These handle the legacy product ID format and work in conjunction with the modern recognition system (lines 727-732) to support both old and new firmware versions.
667-668: Product IDs for Stax and Flex are correct and properly implemented.Stax device ID (0x2c97, 0x0006) and Flex device ID 0x0007 / 0x7000 are the official Ledger identifiers. The dual system correctly supports both legacy product IDs in DEVICE_IDS and modern model IDs (0x60 for Stax, 0x70 for Flex) via vendor registration, enabling backward and forward compatibility with both old and new firmware versions.
|
Tested OK on Ledger Nano S (not the target of this PR, just in case things break) |
No description provided.