Skip to content

Commit 4b008a0

Browse files
committed
anlogicCable: refresh with new VID
1 parent 7ed6260 commit 4b008a0

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

src/anlogicCable.cpp

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@
1717

1818
using namespace std;
1919

20-
#define ANLOGICCABLE_VID 0x0547
21-
#define ANLOGICCABLE_PID 0x1002
20+
#define ANLOGICCABLE_VIDv1 0x336C
21+
#define ANLOGICCABLE_VIDv2 0x336C
22+
#define ANLOGICCABLE_PID 0x1002
2223

2324
#define ANLOGICCABLE_CONF_EP 0x08
2425
#define ANLOGICCABLE_WRITE_EP 0x06
@@ -54,12 +55,19 @@ AnlogicCable::AnlogicCable(uint32_t clkHZ):
5455
throw std::exception();
5556
}
5657

58+
/* First: Try with original (old) VID */
5759
dev_handle = libusb_open_device_with_vid_pid(usb_ctx,
58-
ANLOGICCABLE_VID, ANLOGICCABLE_PID);
60+
ANLOGICCABLE_VIDv1, ANLOGICCABLE_PID);
61+
/* If not found: try with new VID */
5962
if (!dev_handle) {
60-
cerr << "fails to open device" << endl;
61-
libusb_exit(usb_ctx);
62-
throw std::exception();
63+
dev_handle = libusb_open_device_with_vid_pid(usb_ctx,
64+
ANLOGICCABLE_VIDv2, ANLOGICCABLE_PID);
65+
66+
if (!dev_handle) {
67+
cerr << "fails to open device" << endl;
68+
libusb_exit(usb_ctx);
69+
throw std::exception();
70+
}
6371
}
6472

6573
ret = libusb_claim_interface(dev_handle, 0);

0 commit comments

Comments
 (0)