Giter Club home page Giter Club logo

Comments (4)

rene-aguirre avatar rene-aguirre commented on June 24, 2024

@micjoc00, your device HID descriptor has non consistent usage ids, the Windows HID descriptor parser is kind of picky about value arrays, and looks like the Silicon Labs took a shortcut trying to simplify the descriptor.

Anyway... by default, .get() tries to parse the retrieved device data using the device supplied HID descriptors.

Actually here, everything is usage id '1', even for some items that are not value arrays, like you mentioned as in feature report 3 (report_count=1), which doesn't even follow the AN495 specification that states that there are actually 2 bytes on it, is likely windows matches the wrong capabilities due the id/page match but different report count field: result, the usage in report 3 is not a value array as reported in report 5.

If this is about something you can provide technical feedback, try suggesting using consistent (separate values, specially dedicated ones for different fields not actually only for full reports) usage IDs.

This would avoid the "byte and offset" specification at all, the HID descriptor would provide the right schema for how to access and find specific fields. This is the purpose of having standard usage pages, and that's why your USB HID button controls for volume just work, regardless of the report id a device would use or the actual byte and bit offset for button toggles.

Anyway, just use raw reports to avoid the broken device descriptor Windows can't cope with.

Try calling report.get(do_process_raw_report = False) or just report.get(False), this will skip any attempt to decode the usages based on the device HID report.

from pywinusb.

micjoc00 avatar micjoc00 commented on June 24, 2024

I suspected that the device is the cause of this, but i don't have enough knowledge about the HID descriptors. I will try to give feedback to SiLabs for future devices. Sadly the firmware is programmed by the vendor and cannot be changed by the user. I will have to live with it.

I already tried to specify the do_process_raw_report=False, but the parsing happens in the set_raw_data method. The argument do_process_raw_report is checked one line after calling that method. Thanks for the fast response and help so far!

from pywinusb.

rene-aguirre avatar rene-aguirre commented on June 24, 2024

Hello @micjoc00, sorry for the late reply, please take a look to this change: 721cf63

Please let me know if this is good enough for you.

from pywinusb.

micjoc00 avatar micjoc00 commented on June 24, 2024

Hi @rene-aguirre, it's working perfectly now. Thank you!

from pywinusb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.