Skip to content

Commit 67e9048

Browse files
committed
Add NANOXRP USB vendor/product support
Introduce USB_VENDOR_ID_NANOXRP (0x2E8A) and USB_PRODUCT_ID_NANOXRP (0x110A) constants and extend USB device detection to recognize the Nano XRP device. Also add the corresponding USB filter to the connection filters so the device can be auto- or manually selected.
1 parent 8461a40 commit 67e9048

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/connections/usbconnection.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@ export class USBConnection extends Connection {
1818
// Define USB connection constants
1919
readonly USB_VENDOR_ID_BETA: number = 11914; // For filtering ports during auto or manual selection
2020
readonly USB_VENDOR_ID: number = 6991; // For filtering ports during auto or manual selection
21+
readonly USB_VENDOR_ID_NANOXRP: number = 0x2E8A; // For filtering ports during auto or manual selection
2122
readonly USB_PRODUCT_ID_BETA: number = 5; // For filtering ports during auto or manual selection
2223
readonly USB_PRODUCT_ID: number = 70; // For filtering ports during auto or manual selection
24+
readonly USB_PRODUCT_ID_NANOXRP: number = 0x110A; // For filtering ports during auto or manual selection
2325

2426
constructor(connMgr: ConnectionMgr) {
2527
super();
@@ -128,7 +130,9 @@ export class USBConnection extends Connection {
128130
if (
129131
(info.usbProductId == this.USB_PRODUCT_ID && info.usbVendorId == this.USB_VENDOR_ID) ||
130132
(info.usbProductId == this.USB_PRODUCT_ID_BETA &&
131-
info.usbVendorId == this.USB_VENDOR_ID_BETA)
133+
info.usbVendorId == this.USB_VENDOR_ID_BETA) ||
134+
(info.usbProductId == this.USB_PRODUCT_ID_NANOXRP &&
135+
info.usbVendorId == this.USB_VENDOR_ID_NANOXRP)
132136
) {
133137
return true;
134138
}
@@ -272,6 +276,7 @@ export class USBConnection extends Connection {
272276
const filters = [
273277
{ usbVendorId: this.USB_VENDOR_ID_BETA, usbProductId: this.USB_PRODUCT_ID_BETA },
274278
{ usbVendorId: this.USB_VENDOR_ID, usbProductId: this.USB_PRODUCT_ID },
279+
{ usbVendorId: this.USB_VENDOR_ID_NANOXRP, usbProductId: this.USB_PRODUCT_ID_NANOXRP },
275280
];
276281

277282
if (!autoConnected) {

0 commit comments

Comments
 (0)