Comments (4)
@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.
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.
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.
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)
- Running show_hids.py - A USB HID not showing in the list HOT 10
- Question about get input and send output from my custom USB device. HOT 5
- pywinusb vs pyusb HOT 2
- Options to get input reports
- InputReportProcessingThread is never closed
- Can't see all the HID devices connected to the PC HOT 1
- How do I send a simple feature report? HOT 2
- Set Feature Report data last byte corrupted HOT 4
- WinError 2 HOT 1
- Can I use this library to emulate HID mouse drivers without additional hardware? HOT 1
- PNP for tkinter HOT 4
- USB device isn't found
- HID RFID Tag Reading Issue HOT 3
- Reading Data from Device connected through USB using pywinusb
- Data reading! HOT 1
- core.py collections callable error
- ValueError: not open
- not getting "raw_data_handler" events with keyboard HID devices
- instance_id unable to be used as HID filter
- core.py Issues with sending output report to HID device
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pywinusb.