diff options
Diffstat (limited to 'utils/hwstub/include/hwstub_usb.hpp')
-rw-r--r-- | utils/hwstub/include/hwstub_usb.hpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/utils/hwstub/include/hwstub_usb.hpp b/utils/hwstub/include/hwstub_usb.hpp index 579594067c..0fa64a4f63 100644 --- a/utils/hwstub/include/hwstub_usb.hpp +++ b/utils/hwstub/include/hwstub_usb.hpp @@ -34,6 +34,7 @@ class context : public hwstub::context { protected: context(libusb_context *ctx, bool cleanup_ctx); + context(libusb_context *ctx, bool cleanup_ctx, std::string *error, device_filter_t f); public: virtual ~context(); /** Return native libusb context */ @@ -42,7 +43,7 @@ public: * called on the context on deletion of this class. If ctx is NULL, libusb_init() * will be called with NULL so there is no need to init the default context. */ static std::shared_ptr<context> create(libusb_context *ctx, bool cleanup_ctx = false, - std::string *error = nullptr); + std::string *error = nullptr, device_filter_t f = [](ctx_dev_t d){(void)d; return true;}); protected: /* NOTE ctx_dev_t = libusb_device* */ @@ -77,6 +78,8 @@ public: uint16_t get_vid(); /** Get device PID */ uint16_t get_pid(); + /** Return true if device matches provided bus and address */ + static bool is_bus_addr_device(libusb_device *dev, uint8_t bus, uint8_t addr); protected: /** Return true if this might be a hwstub device and should appear in the list */ |