mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
rogcore: match interface with keyboard endpoint instead
This commit is contained in:
@@ -38,7 +38,7 @@ pub async fn start_daemon() -> Result<(), Box<dyn Error>> {
|
||||
let mut rogcore = RogCore::new(
|
||||
laptop.usb_vendor(),
|
||||
laptop.usb_product(),
|
||||
laptop.led_endpoint(),
|
||||
laptop.key_endpoint(),
|
||||
)
|
||||
.map_or_else(
|
||||
|err| {
|
||||
|
||||
@@ -33,7 +33,7 @@ pub struct RogCore {
|
||||
}
|
||||
|
||||
impl RogCore {
|
||||
pub fn new(vendor: u16, product: u16, led_endpoint: u8) -> Result<RogCore, Box<dyn Error>> {
|
||||
pub fn new(vendor: u16, product: u16, match_endpoint: u8) -> Result<RogCore, Box<dyn Error>> {
|
||||
let mut dev_handle = RogCore::get_device(vendor, product).map_err(|err| {
|
||||
error!("Could not get keyboard device handle: {:?}", err);
|
||||
err
|
||||
@@ -50,12 +50,13 @@ impl RogCore {
|
||||
for iface in dev_config.interfaces() {
|
||||
for desc in iface.descriptors() {
|
||||
for endpoint in desc.endpoint_descriptors() {
|
||||
if endpoint.address() == led_endpoint {
|
||||
if endpoint.address() == match_endpoint {
|
||||
info!("INTERVAL: {:?}", endpoint.interval());
|
||||
info!("MAX_PKT_SIZE: {:?}", endpoint.max_packet_size());
|
||||
info!("SYNC: {:?}", endpoint.sync_type());
|
||||
info!("TRANSFER_TYPE: {:?}", endpoint.transfer_type());
|
||||
info!("ENDPOINT: {:X?}", endpoint.address());
|
||||
info!("INTERFACE: {:X?}", desc.interface_number());
|
||||
interface = desc.interface_number();
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user