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 | |||
34 | { | 34 | { |
35 | protected: | 35 | protected: |
36 | context(libusb_context *ctx, bool cleanup_ctx); | 36 | context(libusb_context *ctx, bool cleanup_ctx); |
37 | context(libusb_context *ctx, bool cleanup_ctx, std::string *error, device_filter_t f); | ||
37 | public: | 38 | public: |
38 | virtual ~context(); | 39 | virtual ~context(); |
39 | /** Return native libusb context */ | 40 | /** Return native libusb context */ |
@@ -42,7 +43,7 @@ public: | |||
42 | * called on the context on deletion of this class. If ctx is NULL, libusb_init() | 43 | * called on the context on deletion of this class. If ctx is NULL, libusb_init() |
43 | * will be called with NULL so there is no need to init the default context. */ | 44 | * will be called with NULL so there is no need to init the default context. */ |
44 | static std::shared_ptr<context> create(libusb_context *ctx, bool cleanup_ctx = false, | 45 | static std::shared_ptr<context> create(libusb_context *ctx, bool cleanup_ctx = false, |
45 | std::string *error = nullptr); | 46 | std::string *error = nullptr, device_filter_t f = [](ctx_dev_t d){(void)d; return true;}); |
46 | 47 | ||
47 | protected: | 48 | protected: |
48 | /* NOTE ctx_dev_t = libusb_device* */ | 49 | /* NOTE ctx_dev_t = libusb_device* */ |
@@ -77,6 +78,8 @@ public: | |||
77 | uint16_t get_vid(); | 78 | uint16_t get_vid(); |
78 | /** Get device PID */ | 79 | /** Get device PID */ |
79 | uint16_t get_pid(); | 80 | uint16_t get_pid(); |
81 | /** Return true if device matches provided bus and address */ | ||
82 | static bool is_bus_addr_device(libusb_device *dev, uint8_t bus, uint8_t addr); | ||
80 | 83 | ||
81 | protected: | 84 | protected: |
82 | /** Return true if this might be a hwstub device and should appear in the list */ | 85 | /** Return true if this might be a hwstub device and should appear in the list */ |