Understanding vid/pid pairs
Posted: Wed Dec 07, 2011 11:44 pm
Hi Gents,
I think I'm grasping some of the usbconfig.h defines, but have a problem here!
As an example I want to use a keyboard.
so;
USB-IDs-for-free.txt suggests preference to using "discrimination by serial number string"
Which makes me think I need to use
discrimination by serial number string:
---------------+---------------+-------------------------------------------
10203 (0x27db) | 5824 (0x16c0) | For USB Keyboards
---------------+---------------+-------------------------------------------
Yet in the statements within usbconfig.h it gives a keyboard example using "discrimination by textual name"
discrimination by textual name:
--------------+---------------+--------------------------------------------
1503 (0x05df) | 5824 (0x16c0) | For generic HID class devices (which are
| | NOT mice, keyboards or joysticks)
--------------+---------------+--------------------------------------------
But as you can see above it expressly says NOT for keyboards etc.
Can anyone shed some light? The vids are the same in both cases but the pids aren't.
Which should I use?
Second question is I don't understand to process to convert either of the above combinations into these hex number pairs?
#define USB_CFG_VENDOR_ID 0x42, 0x42
#define USB_CFG_DEVICE_ID 0x31, 0xe1 (example taken from 1-key-keyboard project)
Any help appreciated!
Edit.................
Think I can answer my own questions!
Q2) I think is someone elses vid/pid pair or just made up! that happens to work...
q1) I have ignored all else and chosen the recomended pair as per "USB-IDs-for-free.txt
10203 (0x27db) | 5824 (0x16c0) | For USB Keyboards
#define USB_CFG_VENDOR_ID 0xc0, 0x16
#define USB_CFG_DEVICE_ID 0xdb, 0x27
and it works fine!
I think I'm grasping some of the usbconfig.h defines, but have a problem here!
As an example I want to use a keyboard.
so;
USB-IDs-for-free.txt suggests preference to using "discrimination by serial number string"
Which makes me think I need to use
discrimination by serial number string:
---------------+---------------+-------------------------------------------
10203 (0x27db) | 5824 (0x16c0) | For USB Keyboards
---------------+---------------+-------------------------------------------
Yet in the statements within usbconfig.h it gives a keyboard example using "discrimination by textual name"
discrimination by textual name:
--------------+---------------+--------------------------------------------
1503 (0x05df) | 5824 (0x16c0) | For generic HID class devices (which are
| | NOT mice, keyboards or joysticks)
--------------+---------------+--------------------------------------------
But as you can see above it expressly says NOT for keyboards etc.
Can anyone shed some light? The vids are the same in both cases but the pids aren't.
Which should I use?
Second question is I don't understand to process to convert either of the above combinations into these hex number pairs?
#define USB_CFG_VENDOR_ID 0x42, 0x42
#define USB_CFG_DEVICE_ID 0x31, 0xe1 (example taken from 1-key-keyboard project)
Any help appreciated!
Edit.................
Think I can answer my own questions!
Q2) I think is someone elses vid/pid pair or just made up! that happens to work...
q1) I have ignored all else and chosen the recomended pair as per "USB-IDs-for-free.txt
10203 (0x27db) | 5824 (0x16c0) | For USB Keyboards
#define USB_CFG_VENDOR_ID 0xc0, 0x16
#define USB_CFG_DEVICE_ID 0xdb, 0x27
and it works fine!