-
-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HID Device Descriptor support #15
Comments
Here's a different example with a CDC descriptor (looks like it can show the whole thing in this case). Though (I have a udev rule for this device so it might have some extra permissions). [udev_istring_support]: lsusb -d 03eb: -v
Bus 005 Device 006: ID 03eb:6124 Atmel Corp. at91sam SAMBA bootloader
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10
bDeviceClass 2 Communications
bDeviceSubClass 0 [unknown]
bDeviceProtocol 0
bMaxPacketSize0 8
idVendor 0x03eb Atmel Corp.
idProduct 0x6124 at91sam SAMBA bootloader
bcdDevice 1.10
iManufacturer 0
iProduct 0
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 0x0043
bNumInterfaces 2
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xc0
Self Powered
MaxPower 0mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 2 Communications
bInterfaceSubClass 2 Abstract (modem)
bInterfaceProtocol 0
iInterface 0
CDC Header:
bcdCDC 1.10
CDC ACM:
bmCapabilities 0x00
CDC Union:
bMasterInterface 0
bSlaveInterface 1
CDC Call Management:
bmCapabilities 0x00
bDataInterface 1
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x83 EP 3 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0008 1x 8 bytes
bInterval 255
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 10 CDC Data
bInterfaceSubClass 0 [unknown]
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x01 EP 1 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Device Status: 0x0000
(Bus Powered) |
Yes I agree and this is something I've had on my feature list for a while after looking at the lsusb code. I believe the information can be grabbed from the attributes on sysfs or udev. So the main task it porting the formatting and also adding to the current structs in a nice way. Then it can be printed with |
It should be possible with the rusb extra bytes: https://docs.rs/rusb/latest/rusb/struct.InterfaceDescriptor.html#method.extra and then processing the raw buffer depending on a class match like |
Working branch for this https://github.com/tuna-f1sh/cyme/tree/dumps in case anyone is interested. |
You might be interested, I've been working on and off on this. It's quite a lot of grunt work porting the descriptors and the exact formatting from Most the class specific descriptors are now implemented including the CDC. I'm left to implement (but started) the Audio Class descriptors since they are much more comprehensive and even the Here's a CDC device:
And also the Video descriptors are quite interesting from my display:
|
I don't need this right now, but it's something missing on Linux (and I think there's an opportunity to show more info than lsusb, even with root).
lsusb
susb lsusb (to show that UNAVAILABLE doesn't change)
cyme --lsusb
The main issue is that cyme doesn't attempt to look at the HID Device Descriptor.
On Linux there (usually) is a cached sysfs copy of the
report_descriptor
if there is an associated driver with the device (hid generic, hid raw, etc.).(these descriptors can be read using
hid-decode
).I'll have to dig up another keyboard and I can show what it looks like when you unbind the driver (as per https://www.slashdev.ca/2010/05/08/get-usb-report-descriptor-with-linux/)
The text was updated successfully, but these errors were encountered: