Do I need a unique VID/PID for different HID descriptors?

USB PICs and the UBW

Moderator: phalanx

Post Reply
qwertymodo
Posts: 118
Joined: Tue Jul 17, 2012 6:18 pm

Do I need a unique VID/PID for different HID descriptors?

Post by qwertymodo » Mon Feb 09, 2015 8:23 pm

I have a project implementing a single HID class gamepad, but during initialization, it detects the number of joysticks/buttons connected, and adjusts the HID profile accordingly. So, for instance I have one gamepad profile that has a single X/Y axis pair and 8 buttons, and another with 2 X/Y axis pairs and 11 buttons. Do I need a separate VID/PID pair for each configuration? I would also like to switch the string descriptors at runtime to indicate which profile is in use, but I'm not sure if that would cause issues as well. Other than the HID report descriptor and (potentially) the device string descriptor, the rest of the USB configuration will remain 100% the same between profiles. Since it isn't really an option to acquire a very large number of VID/PID pairs in order to support all of the possible profiles, the only real option would be to implement it as a single profile with a least common denominator of buttons and axes, and just have the unused buttons/axes show up in the report descriptor even though they can't be used...

jkinkennon
Posts: 4
Joined: Sun Apr 29, 2012 10:37 am
Location: Vancouver, WA
Contact:

Re: Do I need a unique VID/PID for different HID descriptors

Post by jkinkennon » Tue Feb 10, 2015 8:51 pm

If your project is purely for your personal use then it is ok to use the Microchip VID that you have probably seen in their example applications. I have a project where I used four sequential PIDs and four unique string descriptors that were selected by a pair of switches. Check out the Virtual Organ page at http://www.kinkennon.com and download the source code for the MIDI75Encoder project. I have contact info on that site if there are any questions. For my primary project, the first one on the Virtual Organ page, I requested a PID assignment from Microchip. They are good about providing a PID that can be used with their VID (Vendor ID) for quite a large number of units before it is necessary to spend the big bucks for your own ID numbers.

qwertymodo
Posts: 118
Joined: Tue Jul 17, 2012 6:18 pm

Re: Do I need a unique VID/PID for different HID descriptors

Post by qwertymodo » Wed Feb 11, 2015 1:05 am

I have several VID/PID pairs of my own from Microchip, I just don't want to have to use them all if I don't have to, as this project could potentially support a dozen or more gamepad configurations. The question is in regard to the USB spec and whether or not unique IDs are required when the device descriptor remains the same for all aspects except the HID report descriptor, and possibly the string descriptor. If the report descriptor is ok but the string descriptor isn't that would be ok too.

ulao
Posts: 3
Joined: Fri Feb 20, 2015 6:18 am

Re: Do I need a unique VID/PID for different HID descriptors

Post by ulao » Sun Feb 22, 2015 8:15 am

If I understand you right, you are saying you have certain descriptors you are patching depending on some criteria. I.e. If condition A use descriptor A of condition b use descriptor B, etc..

You can use the same Vid/Pid with no issues as your device is still just one device. Though the user will not know what from what as it will show the same name in your list of controllers no matter what descriptor is used.

Post Reply