poc in rust
This commit is contained in:
parent
2bfa656855
commit
de55f7fd49
7
POC_in_rust/Cargo.toml
Normal file
7
POC_in_rust/Cargo.toml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
[package]
|
||||||
|
name = "POC_in_rust"
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2024"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
nusb = "0.1.13"
|
11
POC_in_rust/src/main.rs
Normal file
11
POC_in_rust/src/main.rs
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
use nusb;
|
||||||
|
|
||||||
|
static USB_VENDOR: u16 = 0xffff;
|
||||||
|
static USB_PRODUCT: u16 = 0x0035;
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
let dev = nusb::list_devices().unwrap().find(|dev| dev.vendor_id() == USB_VENDOR && dev.product_id() == USB_PRODUCT).expect("Device not connected!");
|
||||||
|
let device = dev.open().expect("failed to open device");
|
||||||
|
let interface = device.claim_interface(0).expect("failed to claim interface");
|
||||||
|
println!("Success")
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user