We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there any way of opening a specific interface of a composite device?
The text was updated successfully, but these errors were encountered:
Yes, the trick is that each device is enumerated multiple times for each interface / usage page etc...
Here is a modified example of logitech_gprox which opens a specific interface:
/**************************************************************************** Copyright (c) 2022 ruabmbua All Rights Reserved. ****************************************************************************/ //! Sets the sidechannel volume of the logitech gpro x headset extern crate hidapi; use hidapi::HidApi; use std::error::Error; fn main() -> Result<(), Box<dyn Error>> { let vol = std::env::args() .nth(1) .map(|arg| arg.parse::<u8>()) .ok_or("missing sidechannel volume arg")?? .min(100); let api = HidApi::new()?; // let dev = api.open(0x046d, 0x0aaa)?; let Some(devinfo) = api .device_list() .filter(|d| d.vendor_id() == 0x046d && d.product_id() == 0x0aaa && d.interface_number() == 3) .next() else { return Err("device not found".into()); }; let dev = devinfo.open_device(&api)?; println!("Setting sidechannel volume to {}", vol); dev.write(&[0x11, 0xff, 0x05, 0x1c, vol])?; Ok(()) }
Sorry, something went wrong.
No branches or pull requests
Is there any way of opening a specific interface of a composite device?
The text was updated successfully, but these errors were encountered: