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

Hotplug support

Open mcuee opened this issue 2 years ago • 6 comments

It may be good to provide hotplug support.

As of now, libusb-win32 does not support hotplug. libusb-1.0 does not support hotplug under Windows. libusbK has hotplug support.

mcuee avatar Oct 10 '23 23:10 mcuee

Please clarify what exactly you mean by hotplug.

Do you mean generating a callback when a new device is enumerated ?

dontech avatar Oct 12 '23 01:10 dontech

Please clarify what exactly you mean by hotplug.

Do you mean generating a callback when a new device is enumerated ?

Yes, something along that line -- notification about device hotplug event.

libusbK hotplug APIs: https://libusbk.sourceforge.net/UsbK3/group__hotk.html

libusb-1.0 hotplug APIs: (not yet implemented on Windows platform) https://libusb.sourceforge.io/api-1.0/group__libusb__hotplug.html

mcuee avatar Oct 12 '23 01:10 mcuee

@mcuee : Quick question: what about fully implementing hotplug directly inside libusb-1.0 (supposing it is possible using win32-like API)? Would there be any downside as compare to implementing the core functionality inside libusb0.sys and only calling it from libusb-1.0? I mean: appart from the fact that having hotplug insde libusb0.sys would allow program not using libusb-1.0 to have the feature as well.

sonatique avatar Dec 08 '23 09:12 sonatique

I think typical hotplug implementation is in the user mode side and not on the kernel side. For example you can look at libusbK.

BTW, libusb-win32 API (libusb0.dll) is a superset of libusb-0.1, so it is not compatible with libusb-1.0 API.

mcuee avatar Dec 08 '23 15:12 mcuee

@dontech

Please check if this is worth the efforts or not, if not, we can close this issue as not planned.

mcuee avatar Feb 20 '24 01:02 mcuee

We can still provide hotplug support to libusb-1.0 in the future I think, so lets keep this one open for now.

dontech avatar Feb 20 '24 02:02 dontech