Comments (4)
@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.
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.
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.
Hi @rene-aguirre, it's working perfectly now. Thank you!
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.