Author Topic: reading string descriptors - specifying language ID  (Read 10119 times)

erdmann

  • Member
  • ***
  • Posts: 43
reading string descriptors - specifying language ID
« on: March 27, 2014, 10:44:46 am »
Hallo,

this website: http://www.usbmadesimple.co.uk/ums_4.htm
specifies that you have to specify the INDEX of the entry in the language ID table in the "wIndex" field of the GET_DESCRIPTOR request when you read a string descriptor where the index is zero based (set wIndex=0 to use the first language in the language ID table):

<quote>
Get Descriptor (String)

There are several strings which a host may request. The strings defined in the device descriptor are:

    Manufacturer String
    Product String
    Serial Number String

These strings are optional. If not supported, the corresponding index in the device descriptor will be 0. Otherwise the host may use the specified index in a Get Descriptor (String) request to fetch the descriptor.

Get Descriptor (String), with a descriptor index of 0 in the low byte of wValue, is used to fetch a special string language descriptor. This contains a series of 2-byte sized language specifiers. In theory, if the language of your choice is supported in this list, you can use the index to this language ID to access the string descriptors in this language by specifying this in wIndex of the Get Descriptor (String) request. In practise, with Windows, you will have difficulties if you do not ensure that the first language specified is English (US).
</quote>


However, the USB 2.0 spec states in chapter 9.4.3 that you need to specify the language ID itself (wIndex=0x0409 for US english as an example) in the "wIndex" field of the GET_DESCRIPTOR request.


So what is "correct" now ? With "correct" I mean what is used in real life ...


Lars

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: reading string descriptors - specifying language ID
« Reply #1 on: March 27, 2014, 11:48:48 am »
Use 0x0409.

That might also be what the explanation you quoted is saying in an unclear way. ("This" refers to the language ID, not the index.)