[prev in list] [next in list] [prev in thread] [next in thread] 

List:       libusb-devel
Subject:    [libusb] How to close device after hotplug disconnection notification
From:       Alessio Sangalli <alesan () manoweb ! com>
Date:       2017-01-12 8:45:01
Message-ID: 00f5c668-d4b6-9a94-5992-2b41ed268a8d () manoweb ! com
[Download RAW message or body]

Hello. Suppose I have several devices open with libusb, in particular I
have a bunch of libusb_device_handle*.

I am listening for hotplug events, and I correctly receive
LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT notifications.

At this point, I need to libusb_close() the right handle, and also
manage in my software that a specific device has left.

How to find out which handle needs to be closed?

I thought to use libusb_get_device() on all my handles and see if the
result matches the libusb_device passed by the callback, but it seems
the API won't allow this approach.

Any other way? This is the only feature that is missing in my code,
libusb has been extremely helpful in every other respect.


bye
as


------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
libusb-devel mailing list
libusb-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusb-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic