Giter Club home page Giter Club logo

Comments (4)

rene-aguirre avatar rene-aguirre commented on September 26, 2024

@NicoPy
In your scenario if you have 2 input reports those should be declared in the HID descriptor.

The Windows HID API will pass your descriptor and provide individual details.

This is where there might be a some confusion: This library creates a helper instance of HidReport class for each exposed report in the HID descriptor.

If you support other transactions with an implicit descriptor interface you might need to manage your self the raw data.

from pywinusb.

NicoPy avatar NicoPy commented on September 26, 2024

I modified HidReport() source code to get access to self.__raw_report_size through a report_size property.
I then display report_size for each report. I get the following :
Report ID - report size
FEATURE 1 5
FEATURE 2 5
FEATURE 3 5
FEATURE 4 5
FEATURE 5 5
FEATURE 6 5
IN 10 49
IN 11 49
IN 12 49
IN 13 49
IN 14 49
IN 15 49
IN 16 49
IN 17 49
OUT 8 2
OUT 9 2

This is not correct. Each report shall have a different size.
Here, all report sizes are the max of all reports of the same type.

When receiving data in raw report callback, data passed to the callback should be the message content. This is not the case, data passed to the callback is the message content plus some data whose length is variable and make the whole data length equal to what is displayed above for a report type.

Hmmm, this might not be very clear.
For example, report ID 10 is declared to be 10 bytes in length. When a report ID 10 message is received, the callback is called with 49 bytes (10 bytes of the message plus 39 bytes).

This makes the user code harder to debug : message length can't be checked, accessing data outside message content without error...

from pywinusb.

rene-aguirre avatar rene-aguirre commented on September 26, 2024

Check this info: https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/content/hidpi/ns-hidpi-_hidp_caps

It seems that the only way to report different report sizes is to separate each report in a different collection, otherwise Windows might be just giving the maximum size value.

from pywinusb.

NicoPy avatar NicoPy commented on September 26, 2024

I thought there is a way to know each report size as described in configuration descriptor.
Thanks for your support.

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.