diff options
| author | Yuval Adam <_@yuv.al> | 2018-07-23 12:07:53 +0300 |
|---|---|---|
| committer | Yuval Adam <_@yuv.al> | 2018-07-23 12:07:53 +0300 |
| commit | 42b95915c11780a796f32ca9c35cb286155da7cc (patch) | |
| tree | cf875e901544962ccc53d26c82b1fc36d1ba9f0b /src | |
| parent | b4975f7e0c42b60350a0b5b98c5e3f8302427cf0 (diff) | |
Add basic USB device enumeration
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..697912b --- /dev/null +++ b/src/main.rs @@ -0,0 +1,14 @@ +extern crate libusb; + +fn main() { + println!("Running"); + let ctx = libusb::Context::new().unwrap(); + for mut dev in ctx.devices().unwrap().iter() { + let desc = dev.device_descriptor().unwrap(); + println!("Bus {:03} Device {:03} ID {:04x}:{:04x}", + dev.bus_number(), + dev.address(), + desc.vendor_id(), + desc.product_id()); + } +} |
