-
Notifications
You must be signed in to change notification settings - Fork 72
Learning USB
The Universal Serial Bus (USB) is a huge subject and anyone developing code for devices that use it should spend some time learning it. To help you out I've curated a set of useful links that I think will help.
The Beyond Logic USB in a Nutshell articles offer a down to earth explanation of how the various parts of USB fit together. As of October 2020 the site covers up to USB 2.0 but the wealth of information within makes it a "must read" reference.
This article provides a useful explanation of HID report descriptors in the context of joysticks. It's a good way to cement the knowledge you've gained from the USB in a Nutshell reference.
The hid4java
project does provide a basic packet monitor (see HidApi.logTraffic
) but sometimes it's better to use a dedicated tool for the job. Support across operating systems for USB varies wildly so you may find that your system needs a different approach.
Wireshark is considered the best free and open source general purpose packet traffic analyser. To use it with USB you'll need to do some extra work, detailed here.
The hid-tools project on GitLab offers several useful command line HID debugging tools (decoding reports, recording etc).
Ever wanted to know where the vendorId
and productId
come from? Look right here: http://www.linux-usb.org/usb.ids
If you need the final word on how USB is expected to behave this is the definitive resource: https://www.usb.org/documents