mirror of
https://gitlab.com/gabmus/envision.git
synced 2025-08-07 00:28:48 +00:00
Merge branch 'migrate-to-rusb' into 'main'
Migrate to rusb Crate See merge request gabmus/envision!46
This commit is contained in:
commit
bafcb649ce
3 changed files with 19 additions and 32 deletions
46
Cargo.lock
generated
46
Cargo.lock
generated
|
@ -88,21 +88,6 @@ dependencies = [
|
|||
"which",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bit-set"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e6e1e6fb1c9e3d6fcdec57216a74eaa03e41f52a22f13a16438251d8e88b89da"
|
||||
dependencies = [
|
||||
"bit-vec",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bit-vec"
|
||||
version = "0.6.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb"
|
||||
|
||||
[[package]]
|
||||
name = "bitflags"
|
||||
version = "1.3.2"
|
||||
|
@ -292,13 +277,13 @@ dependencies = [
|
|||
"lazy_static",
|
||||
"libadwaita",
|
||||
"libmonado-rs",
|
||||
"libusb",
|
||||
"nix",
|
||||
"phf",
|
||||
"phf_macros",
|
||||
"relm4",
|
||||
"relm4-components",
|
||||
"reqwest",
|
||||
"rusb",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"tracker",
|
||||
|
@ -1108,24 +1093,15 @@ dependencies = [
|
|||
]
|
||||
|
||||
[[package]]
|
||||
name = "libusb"
|
||||
version = "0.3.0"
|
||||
name = "libusb1-sys"
|
||||
version = "0.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5f990ddd929cbe53de4ecd6cf26e1f4e0c5b9796e4c629d9046570b03738aa53"
|
||||
dependencies = [
|
||||
"bit-set",
|
||||
"libc",
|
||||
"libusb-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "libusb-sys"
|
||||
version = "0.2.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4c53b6582563d64ad3e692f54ef95239c3ea8069e82c9eb70ca948869a7ad767"
|
||||
checksum = "da050ade7ac4ff1ba5379af847a10a10a8e284181e060105bf8d86960ce9ce0f"
|
||||
dependencies = [
|
||||
"cc",
|
||||
"libc",
|
||||
"pkg-config",
|
||||
"vcpkg",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -1686,6 +1662,16 @@ dependencies = [
|
|||
"winreg",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rusb"
|
||||
version = "0.9.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ab9f9ff05b63a786553a4c02943b74b34a988448671001e9a27e2f0565cc05a4"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"libusb1-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustc-demangle"
|
||||
version = "0.1.23"
|
||||
|
|
|
@ -19,7 +19,7 @@ libadwaita = { version = "0.6.0", features = [
|
|||
"v1_4"
|
||||
] }
|
||||
libmonado-rs = { git = "https://github.com/technobaboo/libmonado-rs", version = "0.1.0" }
|
||||
libusb = "0.3.0"
|
||||
rusb = "0.9.4"
|
||||
nix = { version = "0.29.0", features = [
|
||||
"fs",
|
||||
"signal"
|
||||
|
|
|
@ -2,6 +2,7 @@ use crate::{
|
|||
profile::Profile,
|
||||
profiles::{lighthouse::lighthouse_profile, wivrn::wivrn_profile, wmr::wmr_profile},
|
||||
};
|
||||
use rusb::UsbContext;
|
||||
use std::fmt::Display;
|
||||
|
||||
#[derive(Debug, PartialEq, Eq)]
|
||||
|
@ -137,7 +138,7 @@ impl PhysicalXRDevice {
|
|||
* Returns a Vec of tuples, each representing (vendor_id, product_id)
|
||||
*/
|
||||
fn list_usb_devs() -> Vec<(u16, u16)> {
|
||||
let ctx = libusb::Context::new().expect("Failed to create libusb context");
|
||||
let ctx = rusb::Context::new().expect("Failed to create libusb context");
|
||||
let devs = ctx
|
||||
.devices()
|
||||
.expect("Failed to list devices from libusb context");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue