Skip to content

Releases: kevinmehall/nusb

v0.2.0-beta.2

15 Jun 21:25
Compare
Choose a tag to compare
v0.2.0-beta.2 Pre-release
Pre-release

Changes since v0.2.0-beta.1

  • Add EndpointRead and EndpointWrite types that wrap an Endpoint and buffer data to implement std::io::{Read, Write} and related async traits from Tokio and Smol (#141)
  • Define a new Error type instead of re-exporting std::io::Error (#142)
  • Panic if awaiting a blocking syscall without smol or tokio features. (#147)
  • Linux: Canonicalize sysfs paths (#138)
  • Linux: remove BusInfo::parent_path (#138)
  • macOS: Copy configuration descriptors when opening device (#140)
  • macOS: Update core-foundation, switch to IOUSBInterfaceInterface700 and IOUSBDeviceInterface650 (#148)

v0.2.0-beta.1

25 May 21:38
Compare
Choose a tag to compare
v0.2.0-beta.1 Pre-release
Pre-release

This is a pre-release for anyone interested in testing the new functionality and APIs in v0.2.

New Features

  • Redesigned Endpoint API. (#117)
  • Configuration functions that were previously blocking are available as blocking or async via MaybeFuture. If you are using them asynchronously, you will want to enable the smol or tokio features to defer the blocking syscalls to the corresponding runtime's blocking thread pool. (#100)
  • Add DeviceInfo::port_chain with the path of port numbers from the root hub to this device. (#71)
  • Add list_buses() and BusInfo for information on USB buses. (#77)
  • Include error code in TransferError::Unknown. (#64)
  • Add Device::device_descriptor for access to device details from an opened device. (#102)
  • Windows: Enable RAW_IO for bulk IN endpoints for improved performance. (#6)
  • Linux: Enable zero-copy IO with buffers allocated by Endpoint::allocate. (#11)

Fixes

  • Windows: Allow claiming associated interfaces of multi-interface functions.
  • Windows: List interfaces of composite devices that are bound to WinUSB at the device level.
  • Windows: Include hubs in the device list. (#85)

Breaking Changes

  • list_devices DeviceInfo::open, Device::from_fd, Device::set_configuration, Device::reset, Interface::set_alt_setting, Device::claim_interface Device::detach_and_claim_interface, and Endpoint::clear_halt now return impl MaybeFuture. Add use nusb::MaybeFuture and call .wait() for previous blocking functionality.
  • Queue has been replaced by Endpoint.
  • Interface methods for single bulk and interupt transfers with TransferFuture have been removed -- use Endpoint or upcoming IO wrappers.
  • Interface and Device methods control_in_blocking / control_out_blocking have been replaced with control_in / control_out with .wait() from MaybeFuture.
  • Interface and Device methods control_in / control_out now accept a timeout. Dropping the returned Future no longer cancels the transfer.
  • Bulk and Interrupt IN transfers that are not a multiple of the max packet size return an error.
  • DeviceInfo::bus_number (integer) has been replaced with DeviceInfo::bus_id (string).
  • Renamed EndpointType to TransferType.
  • Renamed descriptor types (#115)
  • Use NonZeroU8 for string descriptor indexes.
  • Descriptor constructors return Option instead of panic.
  • TransferError::Unknown has an integer field for the error code.
  • Linux: Root hubs are no longer included in the device list.

Minimum Rust version is now 1.79.

Remaining for v0.2

  • High-level transfer APIs wrapping Endpoint and managing transfers and buffers to implement BufRead, AsyncBufRead, Write, AsyncWrite to replace removed Interface methods for simple use cases.
  • Comprehensive tests.
  • Control transfer timeouts for Windows.
  • Ensure API is compatible with WebUSB.

Contributors

@kevinmehall @pgorgon-hem @kirisauce @tuna-f1sh @CCnut @martinling

v0.1.14

10 May 23:16
Compare
Choose a tag to compare

Fixes

  • Fix race condition in transfer cancellation that could lead to a crash on any OS when a transfer is cancelled at the exact moment it completes, and additionally on macOS when cancelling several transfers simultaneously by dropping or cancelling a Queue. (#130)
  • macOS: Fix claiming interfaces on a device where interfaces are not numbered contiguously (#132)

Contributors

@kevinmehall @pgorgon-hem

v0.1.13

15 Feb 23:31
Compare
Choose a tag to compare

Fixes

  • Make HotplugWatch Send + Sync on all platforms (#105)
  • macOS: check kUSBProductString and kUSBSerialNumberString properties (#109)
  • Windows: Error instead of panic on invalid device descriptor when opening a device while it is being disconnected (#113)

Contributors

@kevinmehall @erkki-silvola

v0.1.12

21 Nov 06:10
Compare
Choose a tag to compare

Fixes

  • Fix race condition that could lose a transfer completion wakeup. (#92)
  • windows: Use a different method to obtain DeviceInfo::serial_number that properly handles lowercase letters, spaces, and duplicate serial numbers. (77b195c)

Contributors

@kevinmehall

v0.1.11

03 Nov 21:45
Compare
Choose a tag to compare

Fixes

  • macOS: Fix Device::set_configuration and Device::reset (#88)
  • macOS: Fix detection of TransferError::Stall (#88)

New Features

  • Hotplug events: nusb::watch_devices() API for device connect / disconnect event notifications, supported on Windows, macOS, and Linux. (#20)
  • Device::from_fd for wrapping an already-opened usbfs file descriptor. This can be used with the Android APIs for requesting USB device permissions on a non-rooted Android device. (#80)
  • Device::detach_kernel_driver and Device::attach_kernel_driver for controlling kernel drivers on Linux without claiming an interface (#65)

Contributors

@kevinmehall @TroyNeubauer @TheButlah

v0.1.10

28 Jul 16:12
Compare
Choose a tag to compare

Fixes

New Contributors

Full Changelog: v0.1.9...v0.1.10

v0.1.9

30 Apr 05:18
Compare
Choose a tag to compare

Fixes

  • macOS: Update endpoints when interface alt setting is changed by @alexmoon in #50
  • macOS: Don't panic when passed an invalid endpoint address

Improvements

  • Extend the lifetime of objects returned from Configuration::descriptors, Configuration::interface_alt_settings, and Configuration::interfaces by @kevinmehall in #51
  • Add Interface::interface_number and Interface::descriptors methods by @kevinmehall in #51

Full Changelog: v0.1.8...v0.1.9

v0.1.8

21 Apr 17:24
Compare
Choose a tag to compare

Fixes

  • Fix RequestBuffer::reuse (#49). This bug leads to a transfer writing out-of-bounds if RequestBuffer::reuse is called with a larger len than the passed Vec's capacity.

v0.1.7

03 Mar 22:04
Compare
Choose a tag to compare

New features

  • Add Interface::clear_halt and Queue::clear_halt - #46

Fixes

  • windows: Allow opening interfaces of a composite device that use the registry key DeviceInterfaceGUID rather than DeviceInterfaceGUIDs - #39
  • windows: Fix crash when calling Interface::set_alt_setting
  • windows: Improve error message when attempting to claim an interface not associated with WinUSB driver - #41
  • windows: Document and warn on case where WinUSB changes the passed control transfer index field to the interface number - #45
  • linux: Fix build on s390x and when using rustix libc backend - #44
  • Lower log level to debug!() for errors in enumeration. - #40

Contributors

@elfmimi @jonlamb-gh @kevinmehall

Full Changelog: v0.1.6...v0.1.7