From 50d1f2e6e95eb94c34c3d1adca722c9f14b57d98 Mon Sep 17 00:00:00 2001 From: G2-Games Date: Fri, 2 Feb 2024 00:23:28 -0600 Subject: [PATCH] Updated `cross_usb`, fixed example to match changes --- Cargo.lock | 9 +++++---- Cargo.toml | 2 +- minidisc-rs/Cargo.toml | 2 +- src/main.rs | 8 ++++---- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8b34b61..d845a1a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -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", diff --git a/Cargo.toml b/Cargo.toml index f9b693a..31e730b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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] diff --git a/minidisc-rs/Cargo.toml b/minidisc-rs/Cargo.toml index aac3551..de83235 100644 --- a/minidisc-rs/Cargo.toml +++ b/minidisc-rs/Cargo.toml @@ -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" diff --git a/src/main.rs b/src/main.rs index 512bfac..d79f409 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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);