How to uniquely identify USB HID class device?

I think it will vary by manufacturer. There is a serial number field, but many don't fill it in. USBDeview is a free app that will let you peek at all the fields for all the installed devices (http://www.nirsoft.net/utils/usb_devices_view.html). A screen capture for an HID device on my system is attached below. Install it (actually, no need to even unzip, it runs as an executable), and see if there's a unique ID in the devices you're talking about.

enter image description here


The USB Serial Number is what you want. And Atmel has a small datasheet on how to implement it with their usb stack here.

Additionally, any of the user configurable USB descriptors could be used. Assuming you are using the same VID/PID pair, you still have the Device Release Number, Manufacturer String Descriptor (Manufacturer Name), Product String Descriptor (Product name), and the Serial Number Descriptor, all of which go into the basic usb device descriptor that is mandatory for any usb device. They are independent of the usb class (HID, CDC, Proprietary etc), all major OS can read them, and can be as unique as you need them to be.

Tags:

Keyboard

Usb

Hid