Electronic – How to uniquely identify USB HID class device

hidkeyboardusb

I would like to identify a USB keyboard uniquely(something equivalent to unique mac-id for the Ethernet cards) on a computer. Does the USB HID profile has a support for such identification ? If so what is the field called ?
I understand that VID and PID uniquely identify a make of keyboard from a vendor, but I am looking forward to identifying each keyboard separately.

PS : Asking the question on Elex SE, since I would have to implement this USB profile on AVR32.

Best Answer

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.