mirror of
https://github.com/ferrous-systems/embedded-trainings-2020.git
synced 2024-05-19 08:48:17 +00:00
fcf0e310ab
- change the USB PID so it matches the date of the workshop
17 lines
517 B
Rust
17 lines
517 B
Rust
use anyhow::anyhow;
|
|
|
|
fn main() -> Result<(), anyhow::Error> {
|
|
for dev in rusb::devices()?.iter() {
|
|
let dev_desc = dev.device_descriptor()?;
|
|
if dev_desc.vendor_id() == consts::VID && dev_desc.product_id() == consts::PID {
|
|
println!("{:#?}", dev_desc);
|
|
for i in 0..dev_desc.num_configurations() {
|
|
println!("{}: {:#?}", i, dev.config_descriptor(i)?);
|
|
}
|
|
return Ok(());
|
|
}
|
|
}
|
|
|
|
Err(anyhow!("nRF52840 USB device not found"))
|
|
}
|