libusb-rs icon indicating copy to clipboard operation
libusb-rs copied to clipboard

hotplug callback

Open gad2103 opened this issue 8 years ago • 2 comments

hi. thanks for making this library wrapper. one thing i would love to use but don't see implemented is the hotplug functionality. from the docs:


int libusb_hotplug_register_callback | ( | libusb_context * | ctx,
-- | -- | -- | --
  |   | libusb_hotplug_event | events,
  |   | libusb_hotplug_flag | flags,
  |   | int | vendor_id,
  |   | int | product_id,
  |   | int | dev_class,
  |   | libusb_hotplug_callback_fn | cb_fn,
  |   | void * | user_data,
  |   | libusb_hotplug_callback_handle * | handle
  | )

is this already available and i'm missing something?

gad2103 avatar Jan 24 '18 15:01 gad2103

Taking a look about two years later: it looks like this isn't currently supported.

I could take a stab at implementing it, if nobody else is currently trying.

woodruffw avatar Dec 21 '20 22:12 woodruffw

Looks like rusb, which is the actively maintained fork of this crate, already has hotplug support: https://docs.rs/rusb/0.6.5/rusb/trait.UsbContext.html#method.register_callback

woodruffw avatar Dec 21 '20 23:12 woodruffw