-
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ const REPORT_ID = 63; | |
const TREZOR_DESC = { | ||
vendorId: 0x534c, | ||
productId: 0x0001, | ||
interface: 0, | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
karelbilek
via email
Author
Contributor
|
||
}; | ||
|
||
type TrezorDeviceInfo = {path:string}; | ||
|
@@ -41,7 +42,11 @@ export default class NodeHidPlugin { | |
|
||
async enumerate(): Promise<Array<TrezorDeviceInfo>> { | ||
const devices = HID.devices() | ||
.filter(d => d.vendorId === TREZOR_DESC.vendorId && d.productId === TREZOR_DESC.productId) | ||
.filter(d => | ||
d.vendorId === TREZOR_DESC.vendorId && | ||
d.productId === TREZOR_DESC.productId && | ||
d.interface === TREZOR_DESC.interface | ||
) | ||
.map((device: HIDDeviceDescription): TrezorDeviceInfo => { | ||
const path = device.path; | ||
return { | ||
|
This breaks on macOS, at least - where the interface is always
-1
.