From 10ba59c1ecca47581a33e7a1be958ed7410dfef0 Mon Sep 17 00:00:00 2001 From: Gwenhael Goavec-Merou Date: Sat, 24 May 2025 07:46:58 +0200 Subject: [PATCH] libusb_ll,ftdipp_mpsse: Bus and Device must be both == 0 to use filter or uses VID/PID --- src/ftdipp_mpsse.cpp | 2 +- src/libusb_ll.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ftdipp_mpsse.cpp b/src/ftdipp_mpsse.cpp index 81c6ece..0c13a4e 100644 --- a/src/ftdipp_mpsse.cpp +++ b/src/ftdipp_mpsse.cpp @@ -173,7 +173,7 @@ void FTDIpp_MPSSE::open_device(const std::string &serial, unsigned int baudrate) throw std::runtime_error(err); } - if (_bus == 0 || _addr == 0) + if (_bus == 0 && _addr == 0) ret = ftdi_usb_open_desc_index(_ftdi, _vid, _pid, NULL, serial.empty() ? NULL : serial.c_str(), _index); else #if (FTDI_VERSION < 104) diff --git a/src/libusb_ll.cpp b/src/libusb_ll.cpp index ce5915f..c7cc966 100644 --- a/src/libusb_ll.cpp +++ b/src/libusb_ll.cpp @@ -57,7 +57,7 @@ int libusb_ll::get_devices_list(const cable_t *cable) bus_addr = cable->bus_addr; device_addr = cable->device_addr; vid_pid_filter = (vid != 0) && (pid != 0); - bus_dev_filter = (bus_addr != 0) && (device_addr != 0); + bus_dev_filter = ~(bus_addr == 0 && device_addr == 0); } int i = 0;