项目作者: jiegec

项目描述 :
A Rust library to run a USB/IP server
高级语言: Rust
项目地址: git://github.com/jiegec/usbip.git
创建时间: 2020-05-16T03:19:13Z
项目社区:https://github.com/jiegec/usbip

开源协议:MIT License

下载


usbip

Coverage Status
crates.io

A Rust library to run a USB/IP server to simulate USB devices.

It also enables sharing devices from an OS supporting libusb(libusb claims that it supports Linux, macOS, Windows, OpenBSD/NetBSD, Haiku and Solaris) to another OS supporting USB/IP(Linux, Windows). Sharing an CCID SmartCard from macOS to Linux is tested by running gpg --card-status.

How to use

See examples directory. Three examples are provided:

  1. hid_keyboard: Simulate a hid keyboard that types something every second.
  2. cdc_acm_serial: Simulate a serial that gets a character every second.
  3. host: Act like original usb/ip sharing server, sharing one device from one machine to another. Also supports sharing from macOS to Linux!

To run example, run:

  1. $ env RUST_LOG=info cargo run --example hid_keyboard

Then, in a USB/IP client environment:

  1. $ usbip list -r $remote_ip
  2. $ usbip attach -r $remote_ip -b $bus_id

Then, you can inspect the simulated USB device behavior in both sides.

API

See code comments. Not finalized yet, so get prepared for api breaking changes.