Skip to content

Latest commit

 

History

History
41 lines (32 loc) · 1.52 KB

README.md

File metadata and controls

41 lines (32 loc) · 1.52 KB

usbfs-device

A Rust API for accessing the Linux usbfs API, based on Rust's Futures, version 0.1.

NB so far only supports control messages; probably not useful for real USB devices yet.

This API provides,

  • A safe wrapper around underlying ioctl() operations of Linux usbfs
  • Means to take control of some interface of a device (detaching any Kernel driver if needed)
  • The ability to exchange data with a given endpoint of an interface

These are not features of the API,

  • No cross platform support -- use libusb if you want Windows and MacOS support too.
  • No support for parsing USB descriptors
  • No support for discovering the devices attached to the system (i.e. there's no API wrapper to find the relevant entries in Linux sysfs etc.)

(Maybe other crates will pick up some of those.)

Supported usbfs features

  • Device management
    • Current kernel driver name retrieval
    • Device reset
    • Capability query
    • Device configuration selection
    • Device connection info (speed)
  • Interface Management
    • Interface claiming (with optional automatic release)
    • Interface 'alternate setting' selection
  • Endpoint management
    • Clear halt-condition (seems this has to be blocking though?)
    • Control transfers
    • Isochronous transfers
    • Bulk transfers
    • Interrupt transfers