From 4b008a01968f2c1a9bcbeb82ce71d5c26e35631a Mon Sep 17 00:00:00 2001 From: Gwenhael Goavec-Merou Date: Sun, 23 Feb 2025 08:59:08 +0100 Subject: [PATCH] anlogicCable: refresh with new VID --- src/anlogicCable.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) 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);