Simplify documentation (fixes #59)
Remove redundant sections from README and update LICENSE copyright year. Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
parent
c8cd214e1d
commit
a19bfe8301
2 changed files with 42 additions and 17 deletions
4
LICENSE
4
LICENSE
|
|
@ -1,6 +1,6 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2020 Jiajie Chen
|
||||
Copyright (c) 2020-2025 Jiajie Chen
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
|
@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
SOFTWARE.
|
||||
|
|
|
|||
55
README.md
55
README.md
|
|
@ -3,33 +3,58 @@
|
|||
[](https://coveralls.io/github/jiegec/usbip?branch=master)
|
||||
[](https://crates.io/crates/usbip)
|
||||
|
||||
A Rust library to run a USB/IP server to simulate USB devices.
|
||||
A Rust library to run a USB/IP server to simulate USB devices and share real USB devices over a network.
|
||||
|
||||
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`.
|
||||
## What is USB/IP?
|
||||
|
||||
USB/IP is a network protocol that allows USB devices to be shared between computers over a network. It enables:
|
||||
|
||||
- **Device simulation**: Create virtual USB devices that can be accessed remotely
|
||||
- **Device sharing**: Share physical USB devices from one machine to another
|
||||
- **Cross-platform**: Works across different operating systems (Linux, etc.)
|
||||
|
||||
## Installation
|
||||
|
||||
### Prerequisites
|
||||
|
||||
Install Rust from the [official documentation](https://www.rust-lang.org/tools/install).
|
||||
|
||||
### Building from source
|
||||
|
||||
```bash
|
||||
git clone https://github.com/jiegec/usbip.git
|
||||
cd usbip
|
||||
cargo build --release
|
||||
```
|
||||
|
||||
## How to use
|
||||
|
||||
See examples directory. Three examples are provided:
|
||||
### Examples
|
||||
|
||||
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!
|
||||
The `examples/` directory contains three example programs:
|
||||
|
||||
To run example, run:
|
||||
1. **hid_keyboard**: Simulate a HID keyboard that types something every second
|
||||
2. **cdc_acm_serial**: Simulate a CDC ACM serial device that receives a character every second
|
||||
3. **host**: Act as a USB/IP server, sharing physical devices from the host machine to remote clients
|
||||
|
||||
#### Running an example
|
||||
|
||||
```bash
|
||||
$ env RUST_LOG=info cargo run --example hid_keyboard
|
||||
cargo run --example hid_keyboard
|
||||
```
|
||||
|
||||
Then, in a USB/IP client environment:
|
||||
#### Connecting from a USB/IP client
|
||||
|
||||
On the client machine (e.g. Linux with USB/IP support):
|
||||
|
||||
```bash
|
||||
$ usbip list -r $remote_ip
|
||||
$ usbip attach -r $remote_ip -b $bus_id
|
||||
# List available devices
|
||||
usbip list -r $remote_ip
|
||||
|
||||
# Attach to a device
|
||||
usbip attach -r $remote_ip -b $bus_id
|
||||
```
|
||||
|
||||
Then, you can inspect the simulated USB device behavior in both sides.
|
||||
## License
|
||||
|
||||
## API
|
||||
|
||||
See code comments. Not finalized yet, so get prepared for api breaking changes.
|
||||
MIT License - see [LICENSE](LICENSE) file for details.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue