Information Technology Reference
In-Depth Information
The device descriptor's iSerialNumber field contains an index to the string
descriptor containing the serial number.
Table 3-5 s hows the fields in a string descriptor. Here are more details about
the fields and how they're used in a mass-storage device:
bLength. The number of bytes in the descriptor.
bDescriptorType. The constant STRING (03h).
wLANGID[0...n] or bString . When a host requests a String descriptor, the
low byte of the wValue field in the Setup stage is an index value. If the index
value is zero, the host is requesting language IDs. If the index value is greater
than zero, the host is requesting the string descriptor with that index.
String descriptor zero contains one or more 16-bit language ID codes that
indicate the languages that the strings are available in. The code for U.S.
English is 0409h. This is likely to be the only code supported by an operat-
ing system. The wLANGID value must be valid for any of the other strings
to be valid. Devices that return no string descriptors must not return an
array of language IDs. The USB-IF's web site has a list of defined USB lan-
guage IDs.
For index values of 1 and higher, the bString field contains a Unicode string.
With a few exceptions, ANSI character codes 00h through 7Fh correspond
to Unicode values 0000h through 007Fh. For example, a product string for
a product called “Gizmo” would contain five 16-bit Unicode values that
represent the characters in the product name:
0047 0069 007A 006D 006F
In the string descriptor, each Unicode character transmits LSB first:
47 00 69 00 7A 00 6D 00 6F 00
The strings are not null-terminated. The bLength field for a string descrip-
tor that contains a string equals (2 * number of characters in string) + 2.
Responding to Commands
In mass-storage communications that use SCSI commands, the USB host
sends a command block, the host or device may send data, and the device
Search WWH ::




Custom Search