USB的字符串描述
时间:12-15
来源:互联网
点击:
这个字符串描述理解得有点费劲,另外拿来说说!
以下是协议中的内容
9.6.7 String
String descriptors are optional. As noted previously, if a device does not support string descriptors, all references to string descriptors withindevice, configuration, and interfacedescriptors must be reset to zero.
String descriptors use UNICODE encodings as defined by The Unicode Standard, Worldwide Character
Encoding, Version 3.0, The Unicode Consortium, Addison-Wesley Publishing Company, Reading,
Massachusetts (URL: http://www.unicode.com). The strings in a USB device may support multiple
languages. When requesting a string descriptor, the requester specifies the desired language using a sixteenbit language ID (LANGID) defined by the USB-IF. The list of currently defined USB LANGIDs can be found at http://www.usb.org/developers/docs.html. String index zero for all languages returns a string descriptor that contains an array of two-byte LANGID codes supported by the device. Table 9-15 shows the LANGID code array. A USB device may omit all string descriptors. USB devices that omit all string descriptors must not return an array of LANGID codes.
The array of LANGID codes is not NULL-terminated. The size of the array (in bytes) is computed by
subtracting two from the value of the first byte of the descriptor.
The UNICODE string descriptor (shown in Table 9-16) is not NULL-terminated. The string length is
computed by subtracting two from the value of the first byte of the descriptor
现拿一个例子说说
这是一个设备的描述表,第14,15,16个字节(0x04,0x0e,0x30)分别是三个字符串的索引号,
在设备的字符串描述中是这样定义的.在这个表中,第0x04,0x14,0x30起始的地方就是相应的Manufacturer,Product,SerialNumber的字符串.
以下是协议中的内容
9.6.7 String
String descriptors are optional. As noted previously, if a device does not support string descriptors, all references to string descriptors withindevice, configuration, and interfacedescriptors must be reset to zero.
String descriptors use UNICODE encodings as defined by The Unicode Standard, Worldwide Character
Encoding, Version 3.0, The Unicode Consortium, Addison-Wesley Publishing Company, Reading,
Massachusetts (URL: http://www.unicode.com). The strings in a USB device may support multiple
languages. When requesting a string descriptor, the requester specifies the desired language using a sixteenbit language ID (LANGID) defined by the USB-IF. The list of currently defined USB LANGIDs can be found at http://www.usb.org/developers/docs.html. String index zero for all languages returns a string descriptor that contains an array of two-byte LANGID codes supported by the device. Table 9-15 shows the LANGID code array. A USB device may omit all string descriptors. USB devices that omit all string descriptors must not return an array of LANGID codes.
The array of LANGID codes is not NULL-terminated. The size of the array (in bytes) is computed by
subtracting two from the value of the first byte of the descriptor.
The UNICODE string descriptor (shown in Table 9-16) is not NULL-terminated. The string length is
computed by subtracting two from the value of the first byte of the descriptor
现拿一个例子说说
这是一个设备的描述表,第14,15,16个字节(0x04,0x0e,0x30)分别是三个字符串的索引号,
在设备的字符串描述中是这样定义的.在这个表中,第0x04,0x14,0x30起始的地方就是相应的Manufacturer,Product,SerialNumber的字符串.
USB字符 相关文章:
- USB字符串描述符(12-12)
- Windows CE 进程、线程和内存管理(11-09)
- RedHatLinux新手入门教程(5)(11-12)
- uClinux介绍(11-09)
- openwebmailV1.60安装教学(11-12)
- Linux嵌入式系统开发平台选型探讨(11-09)