mirror of
https://github.com/G2-Games/minidisc-cli.git
synced 2025-05-03 02:02:54 -05:00
Updated cross_usb
, fixed example to match changes
This commit is contained in:
parent
9784e32f99
commit
50d1f2e6e9
4 changed files with 11 additions and 10 deletions
9
Cargo.lock
generated
9
Cargo.lock
generated
|
@ -235,12 +235,13 @@ checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f"
|
|||
|
||||
[[package]]
|
||||
name = "cross_usb"
|
||||
version = "0.1.2"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "589d7b1ec3835e46f62faf18e61d91d9b8c2eb0539184ac5ce26d42154b55b9c"
|
||||
checksum = "593be0c698ea71d9cf2a4db52151b93bc35ae24b40e7db8b1580f5169dc3079d"
|
||||
dependencies = [
|
||||
"js-sys",
|
||||
"nusb",
|
||||
"thiserror",
|
||||
"wasm-bindgen",
|
||||
"wasm-bindgen-futures",
|
||||
"web-sys",
|
||||
|
@ -811,9 +812,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "nusb"
|
||||
version = "0.1.5"
|
||||
version = "0.1.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a55e7a6cacb59ce4c392f78754ce5b98c73d16a0d2db04c3d7f11d10ac62ec2c"
|
||||
checksum = "b5f8adce0565ec457ca66a47721a20c72d180be44f444b6cf9539c47b52c653e"
|
||||
dependencies = [
|
||||
"atomic-waker",
|
||||
"core-foundation",
|
||||
|
|
|
@ -10,7 +10,7 @@ license = "AGPL-3.0"
|
|||
|
||||
[dependencies]
|
||||
hex = "0.4.3"
|
||||
cross_usb = "0.1"
|
||||
cross_usb = "0.2"
|
||||
tokio = { version = "1.35.1", features = ["macros", "rt", "rt-multi-thread"] }
|
||||
|
||||
[dependencies.minidisc_rs]
|
||||
|
|
|
@ -20,7 +20,7 @@ unicode-normalization = "0.1.22"
|
|||
hex = "0.4.3"
|
||||
regex = "1.10.2"
|
||||
lazy_static = "1.4.0"
|
||||
cross_usb = "0.1"
|
||||
cross_usb = "0.2"
|
||||
num-derive = "0.3.3"
|
||||
num-traits = "0.2.14"
|
||||
rand = "0.8.5"
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
use minidisc_rs::netmd::interface;
|
||||
use cross_usb::usb::Device;
|
||||
use cross_usb::device_filter;
|
||||
use cross_usb::{device_filter, get_device};
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
// Can find devices this way
|
||||
let filter = vec![
|
||||
device_filter!{vendor_id:0x054c,product_id:0x0186}, // MZ-NH600
|
||||
device_filter!{vendor_id:0x054c,product_id:0x00c9}, // MZ-NF610
|
||||
device_filter!{vendor_id:0x054c, product_id:0x0186}, // MZ-NH600
|
||||
device_filter!{vendor_id:0x054c, product_id:0x00c9}, // MZ-NF610
|
||||
];
|
||||
|
||||
let device = cross_usb::get_device_filter(filter).await.expect("No device found matching critera");
|
||||
let device = get_device(filter).await.expect("No device found matching critera");
|
||||
|
||||
dbg!(device.vendor_id().await);
|
||||
|
||||
|
|
Loading…
Reference in a new issue