2024-01-04 09:33:21 -07:00
|
|
|
For detailed information about the changes below, please see the git log
|
|
|
|
or visit: http://log.libusb.info
|
2012-09-24 16:35:32 -07:00
|
|
|
|
2024-01-31 15:11:14 -07:00
|
|
|
2024-01-31: v1.0.27
|
2024-01-04 09:33:21 -07:00
|
|
|
* New libusb_init_context API to replace libusb_init
|
|
|
|
* New libusb_get_max_alt_packet_size API
|
2023-12-10 04:11:26 -07:00
|
|
|
* New libusb_get_platform_descriptor API (BOS)
|
2024-01-04 09:33:21 -07:00
|
|
|
* Allow setting log callback with libusb_set_option/libusb_init_context
|
2023-12-10 04:11:26 -07:00
|
|
|
* New WebAssembly + WebUSB backend using Emscripten
|
|
|
|
* Fix regression in libusb_set_interface_alt_setting
|
|
|
|
* Fix sync transfer completion race and use-after-free
|
|
|
|
* Fix hotplug exit ordering
|
|
|
|
* Linux: NO_DEVICE_DISCOVERY option set per context
|
|
|
|
* macOS: Fix missing device list cleanup locking
|
|
|
|
* macOS: Do not clear device data toggle for newer OS versions
|
|
|
|
* macOS: Fix running binaries on older OS than build host
|
|
|
|
* Windows: Allow claiming multiple associated interfaces
|
|
|
|
* Windows: Ignore non-configured devices instead of waiting
|
|
|
|
* Windows: Improved root hub detection
|
|
|
|
|
2022-04-10 01:57:16 -07:00
|
|
|
2022-04-10: v1.0.26
|
2022-03-22 15:13:35 -07:00
|
|
|
* Fix regression with transfer free's after closing device
|
|
|
|
* Fix regression with destroyed context if API is misused
|
|
|
|
* Workaround for applications using missing default context
|
|
|
|
* Fix hotplog enumeration regression
|
|
|
|
* Fix Windows isochronous transfer regression since 1.0.24
|
2022-04-10 01:57:16 -07:00
|
|
|
* Fix macOS exit crash in some multi-context cases
|
2022-03-22 15:13:35 -07:00
|
|
|
* Build fixes for various platforms and configurations
|
|
|
|
* Fix Windows HID multi-interface product string retrieval
|
2022-04-10 01:57:16 -07:00
|
|
|
* Update isochronous OUT packet actual lengths on Windows
|
2022-03-22 15:13:35 -07:00
|
|
|
* Add interface bound checking for broken devices
|
|
|
|
* Add umockdev tests on Linux
|
|
|
|
|
2022-01-31 05:56:37 -07:00
|
|
|
2022-01-31: v1.0.25
|
2022-01-21 13:10:16 -07:00
|
|
|
* Linux: Fix regression with some particular devices
|
|
|
|
* Linux: Fix regression with libusb_handle_events_timeout_completed()
|
|
|
|
* Linux: Fix regression with cpu usage in libusb_bulk_transfer
|
2021-05-16 14:18:06 -07:00
|
|
|
* Darwin (macOS): Add support for detaching kernel drivers with authorization.
|
|
|
|
* Darwin (macOS): Do not drop partial data on timeout.
|
2021-01-13 15:59:33 -07:00
|
|
|
* Darwin (macOS): Silence pipe error in set_interface_alt_setting().
|
2022-01-21 13:10:16 -07:00
|
|
|
* Windows: Fix HID backend missing byte
|
|
|
|
* Windows: Fix segfault with libusbk driver
|
|
|
|
* Windows: Fix regression when using libusb0 driver
|
|
|
|
* Windows: Support LIBUSB_TRANSFER_ADD_ZERO_PACKET on winusb
|
|
|
|
* New NO_DEVICE_DISCOVERY option replaces WEAK_AUTHORITY option
|
2022-01-31 05:56:37 -07:00
|
|
|
* Various other bug fixes and improvements
|
2021-01-13 15:59:33 -07:00
|
|
|
|
2020-12-10 11:53:59 -07:00
|
|
|
2020-12-09: v1.0.24
|
|
|
|
* Add new platform abstraction (#252)
|
|
|
|
* Add Null POSIX backend
|
|
|
|
* Add support for eventfd
|
|
|
|
* Add support for thread IDs on Haiku, NetBSD and Solaris
|
|
|
|
* New API libusb_hotplug_get_user_data()
|
|
|
|
* Darwin (macOS): Fix race condition that results in segmentation fault (#701)
|
|
|
|
* Darwin (macOS): Fix stale descriptor information post reset (#733)
|
|
|
|
* Darwin (macOS): use IOUSBDevice as darwin_device_class explicitly (#693)
|
|
|
|
* Linux: Drop support for kernel older than 2.6.32
|
|
|
|
* Linux: Provide an event thread name (#689)
|
2020-12-13 16:46:27 -07:00
|
|
|
* Linux: Wait until all URBs have been reaped before freeing them (#607)
|
2020-12-10 11:53:59 -07:00
|
|
|
* NetBSD: Recognize device timeouts (#710)
|
|
|
|
* OpenBSD: Allow opening ugen devices multiple times (#763)
|
|
|
|
* OpenBSD: Support libusb_get_port_number() (#764)
|
|
|
|
* SunOS: Fix a memory leak (#756)
|
|
|
|
* SunOS: Various fixes (#627, #628, #629)
|
|
|
|
* Windows: Add Visual Studio 2019 support
|
|
|
|
* Windows: Drop support for WinCE and Visual Studio older than 2013
|
|
|
|
* Windows: Drop support for Windows XP
|
|
|
|
* Windows: Support building all examples using Visual Studio (#151)
|
|
|
|
* Documentation fixes and improvements
|
|
|
|
* Various other bug fixes and improvements
|
|
|
|
|
2019-08-28 13:56:18 -07:00
|
|
|
2019-08-28: v1.0.23
|
2018-12-05 10:36:20 -07:00
|
|
|
* Add German translation (#446)
|
|
|
|
* Add Hungarian translation (#493)
|
2019-04-05 11:15:48 -07:00
|
|
|
* Android: Improved support for Android
|
2019-08-09 09:26:41 -07:00
|
|
|
* BSD: Remove infinite recursion in OpenBSD backend
|
2018-12-05 10:36:20 -07:00
|
|
|
* configure.ac: Fix detection of clock_gettime library (#439)
|
2019-08-14 16:20:57 -07:00
|
|
|
* Core: abandon synchronous transfers when device closure is detected.
|
|
|
|
* Core: fix error in handling the removal of file descriptors while handling
|
|
|
|
events.
|
2018-12-05 10:36:20 -07:00
|
|
|
* Darwin(macOS): Switch from using ResetDevice to USBDeviceReEnumerate (#455)
|
|
|
|
* Darwin(macOS): Remove code that changed the device class used (#428)
|
2019-04-05 11:15:48 -07:00
|
|
|
* Darwin(macOS): Reduce hotplug timeout to 1ms (from 5s)
|
2018-12-05 10:36:20 -07:00
|
|
|
* New API libusb_set_log_cb() to redirect global and per context log
|
|
|
|
messages to the provided log handling function
|
2019-04-05 11:15:48 -07:00
|
|
|
* New API libusb_wrap_sys_device to allow the user to specify the
|
|
|
|
usb device to use.
|
2018-12-05 10:36:20 -07:00
|
|
|
* Solaris: Break infinite recursion in backend clock_gettime
|
|
|
|
* Solaris: Enable timerfd on sunos when available
|
2019-04-05 11:15:48 -07:00
|
|
|
* Windows: Add support for isochronous transfers with WinUSB
|
2018-12-05 10:36:20 -07:00
|
|
|
* Various other bug fixes and improvements
|
|
|
|
|
2020-12-10 11:53:59 -07:00
|
|
|
2018-03-24: v1.0.22
|
2018-01-09 00:08:47 -07:00
|
|
|
* New libusb_set_option() API
|
|
|
|
* Fix transfer timeout not being cleared upon resubmission
|
|
|
|
* Report super speed plus devices on modern Linux and macOS
|
2018-01-27 18:29:46 -07:00
|
|
|
* Darwin: Improve support for macOS Sierra and High Sierra
|
2018-01-09 00:08:47 -07:00
|
|
|
* Darwin: SDK fixes and improvements
|
|
|
|
* Linux: Let initialization succeed when no devices are present
|
|
|
|
* Linux: Mark internal file descriptors with CLOEXEC flag
|
|
|
|
* Solaris: Add support for attach/detach kernel driver
|
|
|
|
* Windows: Add dynamic UsbDk backend selection
|
|
|
|
* Windows: Add isochronous transfer support via libusbK
|
|
|
|
* Windows: Add Visual Studio 2017 support
|
|
|
|
* Windows: Fix enumeration problems on Windows 8 and later
|
|
|
|
* Windows: Major rework of poll() emulation
|
|
|
|
* Windows: Numerous HID API fixes
|
2021-10-30 14:15:04 -07:00
|
|
|
* Windows: Support cancellation of individual transfers (Vista and later)
|
2018-01-09 00:08:47 -07:00
|
|
|
* Various other bug fixes and improvements
|
|
|
|
|
2020-12-10 11:53:59 -07:00
|
|
|
2016-10-01: v1.0.21
|
2016-08-21 19:32:39 -07:00
|
|
|
* Core: Refactor code related to transfer flags and timeout handling
|
2016-07-21 22:12:56 -07:00
|
|
|
* Darwin: Ignore root hub simulation devices
|
|
|
|
* Darwin: Improved support for OS X El Capitan
|
2016-09-12 20:42:23 -07:00
|
|
|
* Darwin: Work around devices with buggy endpoint descriptors
|
|
|
|
* Darwin: Do not use objc_registerThreadWithCollector after its deprecation
|
|
|
|
* Darwin: Use C11 atomics on 10.12+ as the OS atomics are now deprecated
|
2016-07-22 05:38:09 -07:00
|
|
|
* Linux: Support preallocating kernel memory for zerocopy USB
|
2016-08-21 19:32:39 -07:00
|
|
|
* Linux: Deal with receiving POLLERR before all transfers have completed
|
2016-07-24 19:01:15 -07:00
|
|
|
* Solaris: Add solaris backend
|
2016-07-21 22:12:56 -07:00
|
|
|
* Windows: Add Visual Studio 2015 support
|
2016-09-14 11:32:54 -07:00
|
|
|
* Windows: Add usbdk backend
|
2016-08-21 19:32:39 -07:00
|
|
|
* Prevent attempts to recursively handle events
|
2016-07-21 22:12:56 -07:00
|
|
|
* Fix race condition in handle_timeout()
|
|
|
|
* Allow transferred argument to be optional in bulk APIs
|
|
|
|
* Various other bug fixes and improvements
|
|
|
|
|
2015-09-13 17:37:12 -07:00
|
|
|
2015-09-13: v1.0.20
|
2015-07-29 01:06:37 -07:00
|
|
|
* Add Haiku support
|
|
|
|
* Fix multiple memory and resource leaks (#16, #52, #76, #81)
|
|
|
|
* Fix possible deadlock when executing transfer callback
|
|
|
|
* New libusb_free_pollfds() API
|
|
|
|
* Darwin: Fix devices not being detected on OS X 10.8 (#48)
|
|
|
|
* Linux: Allow larger isochronous transfer submission (#23)
|
|
|
|
* Windows: Fix broken builds Cygwin/MinGW builds and compiler warnings
|
|
|
|
* Windows: Fix broken bus number lookup
|
|
|
|
* Windows: Improve submission of control requests for composite devices
|
2015-09-02 19:54:44 -07:00
|
|
|
* Examples: Add two-stage load support to fxload (#12)
|
|
|
|
* Correctly report cancellations due to timeouts
|
2015-07-29 01:06:37 -07:00
|
|
|
* Improve efficiency of event handling
|
|
|
|
* Improve speed of transfer submission in multi-threaded environments
|
|
|
|
* Various other bug fixes and improvements
|
|
|
|
The (#xx) numbers are libusb issue numbers, see ie:
|
|
|
|
https://github.com/libusb/libusb/issues/16
|
|
|
|
|
2014-05-30 05:48:28 -07:00
|
|
|
2014-05-30: v1.0.19
|
2014-05-02 06:25:26 -07:00
|
|
|
* Add support for USB bulk streams on Linux and Mac OS X (#11)
|
|
|
|
* Windows: Add AMD and Intel USB-3.0 root hub support
|
|
|
|
* Windows: Fix USB 3.0 speed detection on Windows 8 or later (#10)
|
2014-05-19 02:33:03 -07:00
|
|
|
* Added Russian translation for libusb_strerror strings
|
2014-05-02 06:25:26 -07:00
|
|
|
* All: Various small fixes and cleanups
|
|
|
|
|
2014-01-25 15:43:39 -07:00
|
|
|
2014-01-25: v1.0.18
|
2014-01-08 16:51:38 -07:00
|
|
|
* Fix multiple memory leaks
|
|
|
|
* Fix a crash when HID transfers return no data on Windows
|
|
|
|
* Ensure all pending events are consumed
|
|
|
|
* Improve Android and ucLinux support
|
|
|
|
* Multiple Windows improvements (error logging, VS2013, VIA xHCI support)
|
|
|
|
* Multiple OS X improvements (broken compilation, SIGFPE, 64bit support)
|
|
|
|
|
2013-09-06 02:20:53 -07:00
|
|
|
2013-09-06: v1.0.17
|
2013-08-28 01:17:53 -07:00
|
|
|
* Hotplug callbacks now always get passed a libusb_context, even if it is
|
|
|
|
the default context. Previously NULL would be passed for the default context,
|
|
|
|
but since the first context created is the default context, and most apps
|
|
|
|
use only 1 context, this meant that apps explicitly creating a context would
|
|
|
|
still get passed NULL
|
|
|
|
* Android: Add .mk files to build with the Android NDK
|
|
|
|
* Darwin: Add Xcode project
|
|
|
|
* Darwin: Fix crash on unplug (#121)
|
|
|
|
* Linux: Fix hang (deadlock) on libusb_exit
|
2014-01-08 16:50:34 -07:00
|
|
|
* Linux: Fix libusb build failure with --disable-udev (#124)
|
2013-08-28 01:17:53 -07:00
|
|
|
* Linux: Fix libusb_get_device_list() hang with --disable-udev (#130)
|
|
|
|
* OpenBSD: Update OpenBSD backend with support for control transfers to
|
|
|
|
non-ugen(4) devices and make get_configuration() no longer generate I/O.
|
2014-01-08 16:50:34 -07:00
|
|
|
Note that using this libusb version on OpenBSD requires using
|
2013-08-28 01:17:53 -07:00
|
|
|
OpenBSD 5.3-current or later. Users of older OpenBSD versions are advised
|
|
|
|
to stay with the libusb shipped with OpenBSD (mpi)
|
|
|
|
* Windows: fix libusb_dll_2010.vcxproj link errors (#129)
|
|
|
|
* Various other bug fixes and improvements
|
|
|
|
|
2013-07-11 02:04:02 -07:00
|
|
|
2013-07-11: v1.0.16
|
2013-06-20 06:18:10 -07:00
|
|
|
* Add hotplug support for Darwin and Linux (#9)
|
|
|
|
* Add superspeed endpoint companion descriptor support (#15)
|
|
|
|
* Add BOS descriptor support (#15)
|
|
|
|
* Make descriptor parsing code more robust
|
|
|
|
* New libusb_get_port_numbers API, this is libusb_get_port_path without
|
|
|
|
the unnecessary context parameter, libusb_get_port_path is now deprecated
|
|
|
|
* New libusb_strerror API (#14)
|
|
|
|
* New libusb_set_auto_detach_kernel_driver API (#17)
|
2013-07-06 00:09:25 -07:00
|
|
|
* Improve topology API docs (#95)
|
2013-07-01 04:00:43 -07:00
|
|
|
* Logging now use a single write call per log-message, avoiding log-message
|
|
|
|
"interlacing" when using multiple threads.
|
2013-06-20 06:18:10 -07:00
|
|
|
* Android: use Android logging when building on Android (#101)
|
|
|
|
* Darwin: make libusb_reset reenumerate device on descriptors change (#89)
|
|
|
|
* Darwin: add support for the LIBUSB_TRANSFER_ADD_ZERO_PACKET flag (#91)
|
|
|
|
* Darwin: add a device cache (#112, #114)
|
|
|
|
* Examples: Add sam3u_benchmark isochronous example by Harald Welte (#109)
|
|
|
|
* Many other bug fixes and improvements
|
|
|
|
The (#xx) numbers are libusbx issue numbers, see ie:
|
|
|
|
https://github.com/libusbx/libusbx/issues/9
|
|
|
|
|
2013-04-15 15:15:10 -07:00
|
|
|
2013-04-15: v1.0.15
|
2013-04-04 11:03:15 -07:00
|
|
|
* Improve transfer cancellation and avoid short read failures on broken descriptors
|
2013-04-02 11:52:16 -07:00
|
|
|
* Filter out 8-bit characters in libusb_get_string_descriptor_ascii()
|
|
|
|
* Add WinCE support
|
|
|
|
* Add library stress tests
|
2013-04-04 11:03:15 -07:00
|
|
|
* Add Cypress FX3 firmware upload support for fxload sample
|
2013-04-02 11:52:16 -07:00
|
|
|
* Add HID and kernel driver detach support capabilities detection
|
|
|
|
* Add SuperSpeed detection on OS X
|
2013-04-15 15:15:10 -07:00
|
|
|
* Fix bInterval value interpretation on OS X
|
2013-04-02 11:52:16 -07:00
|
|
|
* Fix issues with autoclaim, composite HID devices, interface autoclaim and
|
2013-04-04 11:03:15 -07:00
|
|
|
early abort in libusb_close() on Windows. Also add VS2012 solution files.
|
2013-04-02 11:52:16 -07:00
|
|
|
* Improve fd event handling on Linux
|
|
|
|
* Other bug fixes and improvements
|
|
|
|
|
2012-09-24 16:35:32 -07:00
|
|
|
2012-09-26: v1.0.14
|
|
|
|
* Reverts the previous API change with regards to bMaxPower.
|
|
|
|
If this doesn't matter to you, you are encouraged to keep using v1.0.13,
|
|
|
|
as it will use the same attribute as v2.0, to be released soon.
|
2014-01-08 16:50:34 -07:00
|
|
|
* Note that LIBUSB_API_VERSION is *decreased* to 0x010000FF and the previous
|
2013-04-15 15:15:10 -07:00
|
|
|
guidelines with regards to concurrent use of MaxPower/bMaxPower still apply.
|
2012-09-24 16:35:32 -07:00
|
|
|
|
|
|
|
2012-09-20: v1.0.13
|
|
|
|
* [MAJOR] Fix a typo in the API with struct libusb_config_descriptor where
|
|
|
|
MaxPower was used instead of bMaxPower, as defined in the specs. If your
|
|
|
|
application was accessing the MaxPower attribute, and you need to maintain
|
|
|
|
compatibility with libusb or older versions, see APPENDIX A below.
|
|
|
|
* Fix broken support for the 0.1 -> 1.0 libusb-compat layer
|
|
|
|
* Fix unwanted cancellation of pending timeouts as well as major timeout related bugs
|
|
|
|
* Fix handling of HID and composite devices on Windows
|
2014-01-08 16:50:34 -07:00
|
|
|
* Introduce LIBUSB_API_VERSION macro
|
2012-09-24 16:35:32 -07:00
|
|
|
* Add Cypress FX/FX2 firmware upload sample, based on fxload from
|
|
|
|
http://linux-hotplug.sourceforge.net
|
|
|
|
* Add libusb0 (libusb-win32) and libusbK driver support on Windows. Note that while
|
2014-01-08 16:50:34 -07:00
|
|
|
the drivers allow it, isochronous transfers are not supported yet in libusb. Also
|
2012-09-24 16:35:32 -07:00
|
|
|
not supported yet is the use of libusb-win32 filter drivers on composite interfaces
|
|
|
|
* Add support for the new get_capabilities ioctl on Linux and avoid unnecessary
|
|
|
|
splitting of bulk transfers
|
|
|
|
* Improve support for newer Intel and Renesas USB 3.0 controllers on Windows
|
|
|
|
* Harmonize the device number for root hubs across platforms
|
|
|
|
* Other bug fixes and improvements
|
|
|
|
|
|
|
|
2012-06-15: v1.0.12
|
|
|
|
* Fix a potential major regression with pthread on Linux
|
|
|
|
* Fix missing thread ID from debug log output on cygwin
|
|
|
|
* Fix possible crash when using longjmp and MinGW's gcc 4.6
|
|
|
|
* Add topology calls: libusb_get_port_number(), libusb_get_parent() & libusb_get_port_path()
|
|
|
|
* Add toggleable debug, using libusb_set_debug() or the LIBUSB_DEBUG environment variable
|
|
|
|
* Define log levels in libusb.h and set timestamp origin to first libusb_init() call
|
|
|
|
* All logging is now sent to to stderr (info was sent to stdout previously)
|
|
|
|
* Update log messages severity and avoid polluting log output on OS-X
|
|
|
|
* Add HID driver support on Windows
|
|
|
|
* Enable interchangeability of MSVC and MinGW DLLs
|
|
|
|
* Additional bug fixes and improvements
|
|
|
|
|
|
|
|
2012-05-08: v1.0.11
|
|
|
|
* Revert removal of critical Windows event handling that was introduced in 1.0.10
|
|
|
|
* Fix a possible deadlock in Windows when submitting transfers
|
|
|
|
* Add timestamped logging
|
|
|
|
* Add NetBSD support (experimental) and BSD libusb_get_device_speed() data
|
|
|
|
* Add bootstrap.sh alongside autogen.sh (bootstrap.sh doesn't invoke configure)
|
|
|
|
* Search for device nodes in /dev for Android support
|
|
|
|
* Other bug fixes
|
|
|
|
|
|
|
|
2012-04-17: v1.0.10
|
|
|
|
* Public release
|
|
|
|
* Add libusb_get_version
|
|
|
|
* Add Visual Studio 2010 project files
|
|
|
|
* Some Windows code cleanup
|
|
|
|
* Fix xusb sample warnings
|
|
|
|
|
|
|
|
2012-04-02: v1.0.9
|
|
|
|
* First libusbx release
|
|
|
|
* Add libusb_get_device_speed (all, except BSD) and libusb_error_name
|
|
|
|
* Add Windows support (WinUSB driver only)
|
|
|
|
* Add OpenBSD support
|
|
|
|
* Add xusb sample
|
|
|
|
* Tons of bug fixes
|
|
|
|
|
|
|
|
2010-05-07: v1.0.8
|
|
|
|
* Bug fixes
|
|
|
|
|
|
|
|
2010-04-19: v1.0.7
|
|
|
|
* Bug fixes and documentation tweaks
|
|
|
|
* Add more interface class definitions
|
|
|
|
|
|
|
|
2009-11-22: v1.0.6
|
|
|
|
* Bug fixes
|
|
|
|
* Increase libusb_handle_events() timeout to 60s for powersaving
|
|
|
|
|
|
|
|
2009-11-15: v1.0.5
|
|
|
|
* Use timerfd when available for timer management
|
|
|
|
* Small fixes/updates
|
|
|
|
|
|
|
|
2009-11-06: v1.0.4 release
|
|
|
|
* Bug fixes including transfer locking to fix some potential threading races
|
|
|
|
* More flexibility with clock types on Linux
|
|
|
|
* Use new bulk continuation tracking in Linux 2.6.32 for improved handling
|
|
|
|
of short/failed transfers
|
|
|
|
|
|
|
|
2009-08-27: v1.0.3 release
|
|
|
|
* Bug fixes
|
|
|
|
* Add libusb_get_max_iso_packet_size()
|
|
|
|
|
|
|
|
2009-06-13: v1.0.2 release
|
|
|
|
* Bug fixes
|
|
|
|
|
|
|
|
2009-05-12: v1.0.1 release
|
|
|
|
* Bug fixes
|
|
|
|
* Darwin backend
|
|
|
|
|
|
|
|
2008-12-13: v1.0.0 release
|
|
|
|
* Bug fixes
|
|
|
|
|
|
|
|
2008-11-21: v0.9.4 release
|
|
|
|
* Bug fixes
|
|
|
|
* Add libusb_attach_kernel_driver()
|
|
|
|
|
|
|
|
2008-08-23: v0.9.3 release
|
|
|
|
* Bug fixes
|
|
|
|
|
|
|
|
2008-07-19: v0.9.2 release
|
|
|
|
* Bug fixes
|
|
|
|
|
|
|
|
2008-06-28: v0.9.1 release
|
|
|
|
* Bug fixes
|
|
|
|
* Introduce contexts to the API
|
|
|
|
* Compatibility with new Linux kernel features
|
|
|
|
|
|
|
|
2008-05-25: v0.9.0 release
|
|
|
|
* First libusb-1.0 beta release
|
|
|
|
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
APPENDIX A - How to maintain code compatibility with versions of libusb and
|
2014-01-08 16:50:34 -07:00
|
|
|
libusb that use MaxPower:
|
2012-09-24 16:35:32 -07:00
|
|
|
|
|
|
|
If you must to maintain compatibility with versions of the library that aren't
|
|
|
|
using the bMaxPower attribute in struct libusb_config_descriptor, the
|
2014-01-08 16:50:34 -07:00
|
|
|
recommended way is to use the new LIBUSB_API_VERSION macro with an #ifdef.
|
2012-09-24 16:35:32 -07:00
|
|
|
For instance, if your code was written as follows:
|
|
|
|
|
|
|
|
if (dev->config[0].MaxPower < 250)
|
|
|
|
|
|
|
|
Then you should modify it to have:
|
|
|
|
|
2014-01-08 16:50:34 -07:00
|
|
|
#if defined(LIBUSB_API_VERSION) && (LIBUSB_API_VERSION >= 0x01000100)
|
2012-09-24 16:35:32 -07:00
|
|
|
if (dev->config[0].bMaxPower < 250)
|
|
|
|
#else
|
|
|
|
if (dev->config[0].MaxPower < 250)
|
|
|
|
#endif
|