SteveBar
Well-known member
When I connect two of the same Teensy based MIDI controllers to Windows they show up with the same PRODUCT_NAME even if they have different PRODUCT_NAMEs.
Details:
Using Windows "Device Manger", under the category of "Sound, video and games controllers", the devices show up with their different names (as expected). Tip: under the "View" menu you can "Show hidden devices", this show all previous attached devices with ghosted icons.
However most, if not all, of the MIDI applications don't seem to use the PRODUCT_NAME to differ between connected devices. So we hacked the PRODUCT_ID and had a different number for each of the devices. Now all the MIDI applications show the proper PRODUCT_NAMEs.
Paul - it would be REALLY useful to be able to change the PRODUCT_ID in my code (see below). However if I need to change the PRODUCT_ID based on a user setting that uniquely names the specific device (if they had more than one), then this needs to happen at run time not compile time. It would be awesome if there was a pre-enumeration call back that provided the opportunity to 'quickly' set all these parameters!
BTW we have been using a "-" and "A"-"Z" as a unique naming convention for our users (i.e. "Widget-A" or "Widget-B"...). "Widget" is the default name.
Details:
Using Windows "Device Manger", under the category of "Sound, video and games controllers", the devices show up with their different names (as expected). Tip: under the "View" menu you can "Show hidden devices", this show all previous attached devices with ghosted icons.
However most, if not all, of the MIDI applications don't seem to use the PRODUCT_NAME to differ between connected devices. So we hacked the PRODUCT_ID and had a different number for each of the devices. Now all the MIDI applications show the proper PRODUCT_NAMEs.
Paul - it would be REALLY useful to be able to change the PRODUCT_ID in my code (see below). However if I need to change the PRODUCT_ID based on a user setting that uniquely names the specific device (if they had more than one), then this needs to happen at run time not compile time. It would be awesome if there was a pre-enumeration call back that provided the opportunity to 'quickly' set all these parameters!
BTW we have been using a "-" and "A"-"Z" as a unique naming convention for our users (i.e. "Widget-A" or "Widget-B"...). "Widget" is the default name.
Code:
#define MANUFACTURER_NAME {'C','o','m','p','a','n','y'}
#define MANUFACTURER_NAME_LEN 7
struct usb_string_descriptor_struct usb_string_manufacturer_name = {
2 + MANUFACTURER_NAME_LEN * 2,
3,
MANUFACTURER_NAME
};
#define PRODUCT_NAME {'W','i','d','g','e','t', 0,0} // leave last 2 chars empty for unique name
#define PRODUCT_NAME_LEN 8
struct usb_string_descriptor_struct usb_string_product_name = {
2 + PRODUCT_NAME_LEN * 2,
3,
PRODUCT_NAME
};
#define SERIAL_NO {'0','0','0','0','2','1'} // 1st 4 digits = the HW_UNIT_NUMBER_EEPROM_ADDY
#define SERIAL_NO_LEN 6
struct usb_string_descriptor_struct usb_string_serial_number = {
2 + SERIAL_NO_LEN * 2,
3,
SERIAL_NO
};
#define PRODUCT_ID {'5','2','4','6','5'} // upto 65535
#define PRODUCT_ID_LEN 6
struct usb_string_descriptor_struct usb_string_serial_number = {
2 + PRODUCT_ID_LEN * 2,
3,
PRODUCT_ID
};
Last edited: