File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed
Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change 1717
1818using 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 );
You can’t perform that action at this time.
0 commit comments