poc in rust

This commit is contained in:
Martin Quarda 2025-05-08 07:59:38 +02:00
parent 2bfa656855
commit de55f7fd49
3 changed files with 18 additions and 0 deletions

7
POC_in_rust/Cargo.toml Normal file
View 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
View 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")
}

0
run.sh Executable file → Normal file
View File