This ensures the `tokio` feature is additive, because `tokio::task::spawn_blocking`
will panic if called from a thread without an active tokio runtime. If you
intentionally want the blocking behavior, you can always use `.wait()` instead
of `.await`.
The default mapping from OS error codes to io::Error's messages is often wrong
or misleading. We can do a lot better, but it takes a lot of error-handling code.
* fix(macos): claiming interface on macOS treats interface number as index
Bug is exposed when connected device has not continuous interface numbers. Then getting nth interface is not the same as getting interface of specific number.
This commit fixes it by getting and comparing bInterfaceNumber instead of using `nth(interface_number)` function on iterator.
* refactor: reformatted find closure in claim_interface
Extracted `get_integer_property` usage into a local variable for clarity and improved readability. This refactor maintains existing functionality while simplifying the comparison logic.
* feat: Add debug logging for interface discovery in macOS IOKit
This change introduces a debug log to provide more visibility during the interface discovery process. It logs the target interface number and the current interface being examined, noting whether a match was found. This aids debugging and troubleshooting in device enumeration scenarios.
* refactor: Rephrase debug log for interface claim process.
Introduced a new `usb_version` field to represent the encoded USB specification version (`bcdUSB`) in DeviceInfo struct. This change includes updates to data structure, a new accessor method, and enhanced debug formatting to display the `usb_version` field.