diff --git a/src/anlogicCable.cpp b/src/anlogicCable.cpp index d6f6ffb..35eec39 100644 --- a/src/anlogicCable.cpp +++ b/src/anlogicCable.cpp @@ -17,8 +17,9 @@ using namespace std; -#define ANLOGICCABLE_VID 0x0547 -#define ANLOGICCABLE_PID 0x1002 +#define ANLOGICCABLE_VIDv1 0x336C +#define ANLOGICCABLE_VIDv2 0x336C +#define ANLOGICCABLE_PID 0x1002 #define ANLOGICCABLE_CONF_EP 0x08 #define ANLOGICCABLE_WRITE_EP 0x06 @@ -54,12 +55,19 @@ AnlogicCable::AnlogicCable(uint32_t clkHZ): throw std::exception(); } + /* First: Try with original (old) VID */ dev_handle = libusb_open_device_with_vid_pid(usb_ctx, - ANLOGICCABLE_VID, ANLOGICCABLE_PID); + ANLOGICCABLE_VIDv1, ANLOGICCABLE_PID); + /* If not found: try with new VID */ if (!dev_handle) { - cerr << "fails to open device" << endl; - libusb_exit(usb_ctx); - throw std::exception(); + dev_handle = libusb_open_device_with_vid_pid(usb_ctx, + ANLOGICCABLE_VIDv2, ANLOGICCABLE_PID); + + if (!dev_handle) { + cerr << "fails to open device" << endl; + libusb_exit(usb_ctx); + throw std::exception(); + } } ret = libusb_claim_interface(dev_handle, 0);