USB HIDView (CV) Test
Note This content applies to the Windows Logo Kit (WLK). For the latest information using the new Windows Hardware Certification Kit (HCK), see Windows HCK User's Guide on the Windows Hardware Dev Center.
Type: Automated Test
Overview
The primary use of a HID class device is to control the operation of the system. Examples of HID class devices include keyboards, pointing devices (such as mouse devices, trackballs, and joysticks), control devices (such as steering wheels, throttles, rudder pedals, and data gloves), and other devices that perform a similar function, such as bar code readers.
The USB HIDView (CV) test is based on the USBCV compliance test tool that the USB-IF provides. For information about the USB HID class, see the Universal Serial Bus Device Class Definition for Human Interface Devices, Revision 1.11 available from the USB-IF on the USB Developers Web site.
Details
This test validates that USB human input devices (HID) comply with the functional and operational specifications for HID class USB devices. The test specifically validates the HID class-specific report descriptor. To run this test, you must attach a physical device to the system.
Note This test is required for USB-capable HID class devices.
Set Up:
This test requires the test device to be connected via an intermediate USB 2.0 hub to the host system. If the test machine has two USB controllers disable the controller that is not under test (or the test will fail).
Note For embedded USB Hubs with no Exposed Ports where it is impossible to manually run this test:
Select the job USB HIDView (CV) Test from Available jobs pane in the Device Console.
Click the Add Selected button on the Device Console. The selected job shows up in the bottom pane.
Select this job from the bottom pane. Right-click it and select Edit Parameters
You will see the Parameter Edit window open, with parameters listed on the left and their values on the right.
Change this value of IsEmbeddedUSBDevice parameter from FALSE to TRUE.
Click the Schedule Jobs button on the Device Console to run this job.
Note For embedded USB devices (for example, laptop devices) where it is impossible to meet this external hub connectivity requirement, you must follow these steps:
In the Available jobs pane in Device Console, select the USB HIDView (CV) (Manual) job.
Click Add Selected button from the Device Console window. The selected job shows up in the bottom pane.
Right-click the job and click Edit Parameters. You will see the Parameter Edit window open, with parameters listed on the left and their values on the right.
Change the value of the "IsEmbeddedUSBDevice" parameter to TRUE.
Click Schedule Jobs button from Device Console to run this job
HID Class Algorithm
The USB HIDView (CV) test uses the following algorithm to verify that the test device is a HID class device:
The test sends a valid get descriptor request to the device.
For each configuration that the device supports, the test sends a valid GetDescriptor (Configuration) request with a bLength of 9 bytes. The test then sends a valid Get Configuration request with a blength equal to the wTotalLength field of the configuration descriptor.
For each configuration descriptor obtained in step 2, the test parses the descriptor finding all interface descriptors. If any of the interface descriptors has a bDeviceClass value of 0x03 (HID_CLASS), the device is a HID device. The device is then tested.
Test Cases
The USB HIDView (CV) test runs a series of tests that verify the test device complies with the specifications for HID class devices.
TD-9.27.3.1 HID Descriptor Test
TD-9.27.3.2 HID Get/Set Idle Test
TD-9.27.3.3 HID Get/Set Protocol Test
TD-9.27.3.4 HID Report Descriptor Test
TD-9.27.3.5 HID Specification Version Test
TD-9.27.3.1 HID Descriptor Test
This test verifies that the device that is being tested responds to a valid Get HID Descriptor request and returns a descriptor in compliance with the HID specification. It also verifies that the HID descriptors in the configuration descriptor and the descriptors returned explicitly in response to the Get HID Descriptor request are identical.
This test is run with the device in the configured state.
The test performs the following steps:
Issues a valid Set Configuration request for the configuration (unless it is an other_speed_configuration descriptor).
Issues a valid Get Configuration request and verifies that the configuration has been set. (unless it is an other_speed_configuration descriptor).
Issues a valid get configuration descriptor with a requested length of 9 bytes.
Issues a valid get configuration descriptor with a requested length of the wTotalLength field from the descriptor obtained in step 3.
For the configuration descriptor obtained in step 4, the test parses the descriptor to locate all interface descriptors.
For each interface descriptor, the test checks to see if bInterfaceClass == 0x03 (HID_CLASS).
Performs each of the following checks on the HID class interfaces:
For each HID interface found in step 6, the test locates the HID descriptor as follows:
- Issue a valid get configuration descriptor call requesting 9 bytes.
- Issue a valid get configuration descriptor call requesting the full length.
- Look at each interface descriptor in order until the interface and alternate setting numbers match the interface found in step 6
- Confirm that bInterfaceClass == 0x03.
- Search forward in the configuration descriptor from this interface descriptor until a HID class descriptor is found. If none are found, the test fails.
If the HID class descriptor found in step 8 is for an interface with alternate setting zero and the configuration descriptor being tested is not an OTHER_SPEED_DESCRIPTOR, a valid Get HID descriptor is issued for the interface in question.
The HID class descriptor(s) obtained in steps 8 and 9 are compared to ensure that they are identical (the test fails if they are different).
For each HID class descriptor obtained in steps 9 and 10, the test performs the following checks:
bLength > 8.
bLength must be a multiple of 3.
bLength == (9 + (bNumDescriptors -1)*3)
bDescriptorType == HID descriptor type (0x21)
bcdHID >= 0x100
Each Additional bDescriptorType field must not be in the reserved range from 0x24 to 0x2F.
Note The test is repeated for each possible device configuration. For a high-speed capable device, the test is run with the device operating at both full speed and high speed. The test is also performed on the OTHER_SPEED_CONFIGURATION descriptor as described above.
Results Interpretation
The test writes the pass/fail results to a log file.
The test fails if:
Device enumeration fails when following the method described in this specification.
Valid get descriptor requests fail for any reason.
Valid set address requests fail for any reason.
Valid set configuration requests fail for any reason.
Valid get configuration requests fail for any reason.
Any of the HID descriptor content checks fail.
Valid get HID descriptor requests fail for any reason.
TD-9.27.3.2 HID Get/Set Idle Test
This test verifies that the device being tested correctly supports the Get Idle request if it supports the Set Idle request.
This test is run with the device in the configured state.
The test performs the following steps:
Issues a valid set configuration request for the configuration (unless it is an OTHER_SPEED_CONFIGURATION descriptor).
Issues a valid get configuration request and verifies that the configuration has been set (if we are not testing an OTHER_SPEED_CONFIGURATION descriptor).
Issues a valid get configuration descriptor request with a requested length of 9 bytes.
Issues a valid get configuration descriptor request with a requested length equal to the value of the wTotalLength field from the configuration descriptor obtained in step 3.
Parses the configuration descriptor obtained in step 4 in order to locate all interface descriptors.
For each interface descriptor, the test checks to see if bInterfaceClass == 0x03 (HID_CLASS).
For each interface found in step 6, the following descriptor parsing is performed:
REPORT DESCRIPTOR PARSING
Issues a valid get HID descriptor request for the interface being tested.
Parses the HID descriptor to find the length of the report descriptor for this interface.
Issues a valid get report descriptor request with a requested length equal to the length found in step 9.
Counts the number of item tags in the report descriptor. The number of items tags must be at least 1.
Counts the number of input tags in the report descriptor.
Counts the number of report IDs in the report descriptor.
If there are no report IDs the GET/SET Idle test is run with the value equal to 0x7F.
If there are report IDs, the Get/Set Idle test is run with values equal to 0x00, 0x7F, and 0xFF for each report ID for an INPUT.
GET/SET IDLE TEST
Issues a valid set idle request for the report ID and duration being tested.
Issues a valid get idle request for the report ID being tested.
If both requests complete successfully, the test confirms that the get idle request returns the correct value that was set.
The test is repeated for each possible device configuration.
Note For high-speed capable device, the test is run with the device operating at both full speed and high speed.
Results Interpretation
The test writes the pass/fail results to a log file.
The test fails if:
Device enumeration fails when following the method described in this specification.
Valid get descriptor requests fail for any reason.
Valid set address requests fail for any reason.
Valid set configuration requests fail for any reason.
Valid get configuration requests fail for any reason.
Valid get HID descriptor requests fail for any reason.
Valid get HID report descriptor requests fail for any reason.
Set IDLE values do not match those returned by the Get IDLE request.
TD-9.27.3.3 HID Get/Set Protocol Test
This test verifies that a boot class HID interface correctly supports the Get and Set Protocol HID Requests.
This test is run with the device in the configured state.
The test performs the following steps:
Issues a valid set configuration request for the configuration (unless it is an OTHER_SPEED_CONFIGURATION descriptor).
If you are not testing an OTHER_SPEED_CONFIGURATION descriptor, the test issues a valid get configuration request and verifies that the configuration has been set.
Issues a valid get configuration descriptor request with a requested length equal to 9 bytes.
Issues a valid get configuration descriptor request with a requested length equal to the wTotalLength field from the configuration descriptor obtained in step 3.
For the configuration descriptor obtained in step 4, the test parses the descriptor to locate all interface descriptors.
For each interface descriptor, the test checks to see if bInterfaceClass == 0x03 (HID_CLASS).
For each HID interface descriptor, check the bInterfaceSubClass. If the bInterfaceSubClass == 0x01 and bAlternateSetting == 0, perform the following test:
GET/SET PROTOCOL:
Issues a valid set protocol request for the report protocol.
Issues a valid get protocol request.
Verifies that the get protocol request returns a report protocol.
Issues a valid set protocol request for the boot protocol.
Issues a valid get protocol request for the boot protocol.
Confirms that the get protocol request returns boot protocol.
The test is repeated for each possible device configuration.
Note For a high-speed capable device, the test is run twice, once with the device operating at full speed, and once with the device operating at high speed.
Results Interpretation
The test writes the pass/fail results to a log file.
The test fails if:
Device enumeration fails when following the method described in this specification.
Valid get descriptor requests fail for any reason.
Valid set address requests fail for any reason.
Valid set configuration requests fail for any reason.
Valid get configuration requests fail for any reason.
Valid get HID descriptor requests fail for any reason.
Valid get HID report descriptor requests fail for any reason.
Set protocol values do not match those returned by the get protocol request.
Valid get protocol or set protocol requests to a boot interface fail for any reason
TD-9.27.3.4 HID Report Descriptor Test
This test verifies that the device under test provides a report descriptor that meets the HID specification for each of its HID interfaces.
This test is run with the device in the configured state.
The test performs the following steps:
Issues a valid set configuration request for the configuration (unless it is an OTHER_SPEED_CONFIGURATION descriptor).
If you are not testing an OTHER_SPEED_CONFIGURATION descriptor, the test issues a valid get configuration request and verifies that the configuration has been set. ()
Issues a valid get configuration descriptor request with a requested length equal to 9 bytes.
Issues a valid get configuration descriptor request with a requested length equal to the wTotalLength field from the configuration descriptor obtained in step 3.
For the configuration descriptor obtained in step 4, the test parses the descriptor to locate all interface descriptors.
For each interface descriptor, the test checks to see if bInterfaceClass == 0x03 (HID_CLASS).
For each interface found in step 6, the following descriptor parsing is performed:
REPORT DESCRIPTOR PARSING
Issues a valid get HID descriptor request for the interface being tested.
Parses the HID descriptor to find the length of the report descriptor for this interface.
Issues a valid get report descriptor request with a requested length equal to the length found in step 9.
The test counts the number of item tags in the report descriptor. There must be at least one item tag.
Parses the report descriptor according to section 6.2.2 of the HID specification.
The test is repeated for each possible device configuration.
Note For a high-speed capable device, the test is run twice, once with the device operating at full speed, and once with the device operating at high speed.
Results Interpretation
The test writes the pass/fail results to a log file.
The test fails if:
Device enumeration fails when following the method described in this specification.
Valid get descriptor requests fail for any reason.
Valid set address requests fail for any reason.
Valid set configuration requests fail for any reason.
Valid get configuration requests fail for any reason.
Valid get HID descriptor requests fail for any reason.
Valid get HID report descriptor requests fail for any reason.
A report descriptor does not comply with section 6.2.2 of the HID specification
TD-9.27.3.5 HID Specification Version Test
This test checks to see with which version of the HID specification the device is in compliance.
This test is run with the device in the configured state.
The test performs the following steps:
Issues a valid set configuration request for the configuration (unless it is an OTHER_SPEED_CONFIGURATION descriptor).
If you are not testing an OTHER_SPEED_CONFIGURATION descriptor, the test issues a valid get configuration request and verifies that the configuration has been set.
Issues a valid get configuration descriptor request with a requested length equal to 9 bytes.
Issues a valid get configuration descriptor request with a requested length equal to the wTotalLength field from the configuration descriptor obtained in step 3.
For the configuration descriptor obtained in step 4, the test parses the descriptor to locate all interface descriptors.
For each interface descriptor, the test checks to see if bInterfaceClass == 0x03 (HID_CLASS).
For each interface found in step 6, the following descriptor parsing is performed:
HID SPEC VERSION PARSING
Starting at the HID descriptor found in step 6, the test parses forward in the configuration descriptor to locate each of the following items:
- First HID descriptor after the HID interface.
- Second HID descriptor after the HID interface.
- First EndPoint descriptor after HID interface.
- First interface descriptor (any kind) after the HID interface.
Referring to step 8, if the location of A is greater than the location of D, the test fails.
Referring to step 8, if the location of B is less than the location of D, the test fails.
Referring to step 8, if the location of C is greater than the location of D, the test fails.
Referring to step 8, if the location of A is less than C, the interface is HID specification 4 compliant. Otherwise, it is HID specification 3 compliant.
The test is repeated for each possible device configuration.
Note For a high-speed capable device, the test is run twice, once with the device operating at full speed, and once with the device operating at high speed.
Results Interpretation
The test writes the pass/fail results to a log file.
The test fails if:
Device enumeration fails when following the method described in this specification.
Valid get descriptor requests fail for any reason.
Valid set address requests fail for any reason.
Valid set configuration requests fail for any reason.
Valid get configuration requests fail for any reason.
A HID interface does not have at least one endpoint.
Two HID descriptors describe a single HID interface.
A HID interface does not have a following HID descriptor before the next interface
Run Time: 5 minutes
Log File:
System Restart Required: No
Test Category:
Supported operating systems for Logo or Signature testing:
Windows 7
Windows Server 2008
Windows Vista
Windows Server 2003
Windows XP
Software components included with the device that is being tested.
Program:
Requirements
Software Requirements
The test tool requires the following software:
- Supported operating system (see list above).
- Software components included with the device that is being tested.
Hardware Requirements
- Device to be tested
- One USB 2.0 controller PCI adapter, if system does not contain a USB 2.0 controller
- One USB 1.1 or 2.0 hub to connect the system and the test USB device. If the test USB 2.0 device is high-speed, the additional USB 2.0 hub must also be high-speed. Use a USB IF certified hub when testing.
Processor
- x86
- x64
- Itanium
Troubleshooting
The following list describes the USB HIDView (CV) Test Assertions:
- General HID Assertions
3.2.1 A HID class compliant Interface must have one HID descriptor associated with it.
Reference document: Universal Serial Bus Device Class Definition for Human Interface Devices, Revision 1.1, Section 7.1.
3.2.2 A HID class compliant Interface must have one Endpoint descriptor associated with it.
Reference document: Universal Serial Bus Device Class Definition for Human Interface Devices, Revision 1.1, Section 7.1.
- HID Descriptor Assertions
3.2.20 A HID class compliant Interface must have a value of 0x00/0x01 in the bInterfaceSubClass field.
Reference document: Universal Serial Bus Device Class Definition for Human Interface Devices, Revision 1.1, Appendix E.3.
3.2.21 A HID class compliant Interface must have a value of 0x00/0x01/0x02 in the bInterfaceProtocol field.
Reference document: Universal Serial Bus Device Class Definition for Human Interface Devices, Revision 1.1, Appendix E.3.
3.2.22 A HID class compliant Interface must have a valid HID descriptor associated with it.
Reference document: Universal Serial Bus Device Class Definition for Human Interface Devices, Revision 1.1, Section 7.1.
3.2.23 The HID descriptors obtained from the configuration descriptor and one obtained by performing a GetDescriptor request for the same interface must match.
Reference document: Universal Serial Bus Device Class Definition for Human Interface Devices, Revision 1.1, Section 7.1.
3.2.24 The descriptor returned in response to a GetDescriptor(HIDDescriptor) request must have a length of at least 0x09 and in increments of 3 if more than 9.
Reference document: Universal Serial Bus Device Class Definition for Human Interface Devices, Revision 1.1, Section 6.2.1.
3.2.25 The descriptor returned in response to a GetDescriptor(HIDDescriptor) request must have a bNumDescriptors value that correlates with the length value.
Reference document: Universal Serial Bus Device Class Definition for Human Interface Devices, Revision 1.1, Section 6.2.1.
3.2.26 The descriptor returned in response to a GetDescriptor(HIDDescriptor) request must the value of 0x21 in the Type field.
Reference document: Universal Serial Bus Device Class Definition for Human Interface Devices, Revision 1.1, Section 6.2.1.
3.2.27 The descriptor returned in response to a GetDescriptor(HIDDescriptor) request must the value greater than 0x01 in the high byte of the bcdHID field.
Reference document: Universal Serial Bus Device Class Definition for Human Interface Devices, Revision 1.1, Section 6.2.1.
3.2.28 The descriptor returned in response to a GetDescriptor(HIDDescriptor) request must contain at least one entry containing of type report descriptor.
Reference document: Universal Serial Bus Device Class Definition for Human Interface Devices, Revision 1.1, Section 6.2.1.
3.27.3.2.29 The descriptor returned in response to a GetDescriptor(HIDDescriptor) cannot contain any optional descriptors with type field set to 0x24-0x2F.
Reference document: Universal Serial Bus Device Class Definition for Human Interface Devices, Revision 1.1, Section 6.2.1.
- HID Command Assertions
3.2.40 The protocol returned in response to a GetProtocol request must match the protocol set by a successful previous call to SetProtocol.
Reference document: Universal Serial Bus Device Class Definition for Human Interface Devices, Revision 1.1, Section 7.2.5.
3.2.60 The number of items in a report descriptor must be greater than 0x0.
Reference document: Universal Serial Bus Device Class Definition for Human Interface Devices, Revision 1.1, Section 6.2.2.
3.2.61 The report descriptor returned in response to a GetDescriptor(Report) must be compliant with the HID specification.
Reference document: Universal Serial Bus Device Class Definition for Human Interface Devices, Revision 1.1, Section 6.2.2.
3.2.80 The idle rate returned in response to a GetIdle request must match the idle rate set by a successful previous call to SetIdle.
Reference document: Universal Serial Bus Device Class Definition for Human Interface Devices, Revision 1.1, Section 7.2.3.
Build date: 9/14/2012