accept Nano X over USB

This commit is contained in:
m2049r 2019-07-13 11:55:07 +02:00
parent cf5018be33
commit fa811a39a2
No known key found for this signature in database
GPG Key ID: 4386E69AF260078D
2 changed files with 12 additions and 3 deletions

View File

@ -46,8 +46,12 @@ public class BTChipTransportAndroidHID implements BTChipTransport {
HashMap<String, UsbDevice> deviceList = manager.getDeviceList();
for (UsbDevice device : deviceList.values()) {
Timber.d("%04X:%04X %s, %s", device.getVendorId(), device.getProductId(), device.getManufacturerName(), device.getProductName());
if ((device.getVendorId() == VID) && (device.getProductId() == PID_HID)) {
return device;
if (device.getVendorId() == VID) {
final int deviceProductId = device.getProductId();
for (int pid : PID_HIDS) {
if (deviceProductId == pid)
return device;
}
}
}
return null;
@ -74,7 +78,7 @@ public class BTChipTransportAndroidHID implements BTChipTransport {
}
private static final int VID = 0x2C97;
private static final int PID_HID = 0x0001;
private static final int[] PID_HIDS = {0x0001, 0x0004};
private UsbDeviceConnection connection;
private UsbInterface dongleInterface;

View File

@ -6,4 +6,9 @@
product-id="1"
vendor-id="11415" />
<!-- Ledger Nano X HID: VID=0x2C97 PID=0x0004 -->
<usb-device
product-id="4"
vendor-id="11415" />
</resources>