4

I am writing the firmware for a USB HID device. When it is connected to a Windows PC (running Windows 8.1, if that makes any difference) it gets listed in Device Manager, under "Human Interface Devices", as "HID-compliant vendor-defined device". For obvious reasons it would be preferable for a nicer description to be shown.

I'd have guessed that the description would be taken from the USB string descriptor table, perhaps from the entry specified in the device descriptor as containing the product name. This doesn't appear to happen. Perhaps there is an error in my descriptors, but when I connect a USB analyser during enumeration it correctly identifies the manufacturer name, product name, and serial number string.

A little googling suggests that the Device Manager's descriptions can be controlled from a driver's .inf file, but this device doesn't have its own drivers.

Am I out of luck, or is there a way for an HID device to determine how it is described by the Device Manager? If there is, what is it?

(Related prior SO question: Rename a USB HID device under Windows. An answer to that question says that you need to write a Windows device driver to do this, but comments on the answer indicate that this shouldn't apply to HID devices, and the answerer concedes this. Unfortunately no further suggestions are to be found there. That question may actually be trying to ask essentially the same thing as I am, but if so it's ill-titled; I am not trying to rename anything.)

1 Answer 1

0

Windows have default drivers for HID input devices. This is the main advantage of this USB class of devices.

Windows installs driver for a USB device first, and then driver for each of its USB interface and creates child devices node under USB device. Each interface may be a HID device interface (0x03 in USB_INTERFACE_DESCRIPTOR.bInterfaceClass) and in this case Windows parses HID device descriptor and creates child device node for each its top-level collection:

enter image description here

But unfortunately this HID Top-Level Collection driver just do set the DEVPKEY_Device_FriendlyName for the device in accordance to its type and it will be something like "HID-compliant mouse" as this means that the driver for a Mouse Usage type (Usage Page 0x0001, Usage 0x0001) is installed (see HID Spec for more info).

Good news here that HID-aware application can use HidD_GetManufacturerString/HidD_GetProductString/HidD_GetSerialNumberString functions to get device string information from the corresponding USB_INTERFACE_DESCRIPTOR (or USB_DEVICE_DESCRIPTOR if USB_INTERFACE_DESCRIPTOR.iInterface is zero). Note also that these string may be empty (not set by manufacturer).

If you really want to set DEVPKEY_Device_FriendlyName for your HID device in device tree then you have to create a special driver *.inf file for it. You need to use this hardware ID:

enter image description here

You can look at example inf file that changes device name in C:\Windows\INF\msmouse.inf.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.