Skip to content
New issue

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

get_property() broken on Linux #216

Open
msirringhaus opened this issue Jan 9, 2023 · 0 comments
Open

get_property() broken on Linux #216

msirringhaus opened this issue Jan 9, 2023 · 0 comments

Comments

@msirringhaus
Copy link
Contributor

        let vendor = self
            .get_property("Manufacturer")
            .unwrap_or_else(|_| String::from("Unknown Vendor"));
        let product = self
            .get_property("Product")
            .unwrap_or_else(|_| String::from("Unknown Device"));

always returns "Unkown Vendor/Device", because the function get_property_linux() looks at the wrong udev-device.

We operate on hidraw-devices, but the properties are set on usb_device-types (subsystem="usb", devtype="usb_device"). These are reachable via subsequent .parent()-calls on the hidraw-device, but libudev has a bug in the API that prevents it from being used this way.

From what I can tell, we would need to update libudev to 0.3, then find the correct hidraw-device as we do now in get_property_linux(), but then iterate over its parents until we find the first usb_device-type, and query it for those properties (which are actually attributes and not properties in udev-parlance).
Also, one has to check if the strings are case-sensitive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant