HID descriptor blocks
Rick Murray (539) 13840 posts |
How would I read HID data from USB devices? I have played with the CallDevice SWI and I can retrieve the USB ID (vendor, device, etc), the textual name, etc. But I’ve tried feeding all sorts of values to the SWI and it looks as if the HID should be a setting with a specific country code, but I just can’t find anything that matches the data shown in USBInfo. I’m using code like this:
It seems like the language code for HID is &04FF, but this doesn’t seem to return anything resembling the USBInfo data, given various offsets in the low byte of wValue. |
Glen Walker (2585) 469 posts |
If you have access to a Linux machine then you could give uinput a try to see what the device is sending/receiving? There is an old guide here: Using uinput driver in Linux-2.6.x to send user input But there are doubtless more up-to-date offerings… Might be work having a dig around StackOverflow. If you just want to read out device information in linux you can use “lsusb” to print out the shortened identifiers for your connected devices and then use “lsusb -v” to get the full info and hunt through it for the device you are using. Sorry if this is all too “Other OS” but I don’t know enough about RISC OS yet…my thinking was that if you wanted to identify and test the device you could use Linux and then use that data in RISC OS. |
Steve Pampling (1551) 8170 posts |
I think that’s basically a Pi running Rasbian isn’t it? |
Rick Murray (539) 13840 posts |
Yes. Um… I didn’t understand much of it, given my Linux experience is finding broken stuff in Ubuntu. :-) Or OSMC, but that pretty much bends over backwards to hide its Linuxness. I know what the device is, I can read its HID using a program called USBInfo. My question was how can I read the HID stuff myself, primarily for determining the capabilities of the device (as described in the HID…). Unfortunately USBInfo is compiled with ABC, so I can’t just look and see how that works (either BASIC code, or pulling apart the executable if in C; but ABC is a whole different kettle of deuterostome coelomates).
Well, that’s what we’re here for. 😜 |
Colin (478) 2433 posts |
Not sure exactly what you mean. Does USBDescriptors show what you want? In which case the sources are included. |