commit | a0b5d27fa7f2bba11965e2b70533f925a5772808 | [log] [tgz] |
---|---|---|
author | Nathan Hjelm <hjelmn@me.com> | Thu Apr 04 12:02:25 2019 -0600 |
committer | Nathan Hjelm <hjelmn@cs.unm.edu> | Thu Apr 04 19:08:51 2019 -0600 |
tree | 0e9089f36a5ed203b13cfe016857b3d9cc5a4a73 | |
parent | 2a7372db54094a406a755f0b8548b614ba8c78ec [diff] |
darwin: fix reset device This commit fixes the backend of reset device to restore the state of the device if possible. This fixes a bug introduced in c14ab5fc4d22749aab9e3534d56012718a0b0f67. The previous commit was necessary due to changes in the system USB stack that essentially turned the ResetDevice function into a no-op. This required libusb to move to USBDevuceReEnumerate to effectively reset the device. The problem is that both the device handle and libusb devices became invalid. This commit fixes the bug by waiting for the re-enumeration to complete then 1) checking whether the descriptors changed, 2) restoring the active configuration, and 3) restoring claimed interfaces. Closes #523 Signed-off-by: Nathan Hjelm <hjelmn@me.com>
libusb is a library for USB device access from Linux, macOS, Windows, OpenBSD/NetBSD and Haiku userspace. It is written in C (Haiku backend in C++) and licensed under the GNU Lesser General Public License version 2.1 or, at your option, any later version (see COPYING).
libusb is abstracted internally in such a way that it can hopefully be ported to other operating systems. Please see the PORTING file for more information.
libusb homepage: http://libusb.info/
Developers will wish to consult the API documentation: http://api.libusb.info
Use the mailing list for questions, comments, etc: http://mailing-list.libusb.info
(Please use the mailing list rather than mailing developers directly)