Devolutions / Devolutions/IronRDP
[ironrdp-rdpeusb] Client libusb backend (rusb)
- Dominant language
- Rust
- Stars
- 3.2k
- Forks
- 275
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 189
Description
Implement a concrete UsbClientBackend using the rusb crate (safe Rust bindings to libusb). This is the bridge between the RDPEUSB protocol state machine and real USB hardware.
**Depends on:**
- #1137 (for the UsbClientBackend trait definition)
### Tasks
- Define UsbClientBackend trait (in ironrdp-rdpeusb, gated behind a feature flag):
```rust
pub trait UsbClientBackend: Send {
fn enumerate_devices(&self) -> Vec;
fn open_device(&mut self, device_id: &str) -> PduResult<()>;
fn close_device(&mut self, device_id: &str);
fn submit_urb(&mut self, request: UsbRequest) -> PduResult<()>;
fn cancel_urb(&mut self, request_id: u32);
}
```
- Implement RusbBackend in a backend/rusb.rs module (feature-gated: feature = "rusb")
- Device enumeration: list connected USB devices with descriptors (VID, PID, manufacturer, product, serial, hardware IDs compatible with MS-RDPEUSB ADD_DEVICE)
- Open/close devices via rusb
- URB submission: translate TS_URB structures to rusb transfer operations (control, bulk, interrupt, isochronous)
- Async completion delivery back to UsbDeviceChannel
- URB cancellation
- NoopUsbClientBackend: no-op implementation for testing
### Acceptance criteria
- A real USB device (e.g. USB flash drive or HID device) can be enumerated and its descriptors sent to the server via ADD_DEVICE
- At minimum bulk and control transfers work end-to-end
- Isochronous transfers stubbed with a clear note (webcams, audio; that’s complex, follow-up scope)
- Tested on Linux; Windows/macOS noted as follow-up
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.