USB_StdDescriptor_String_t Struct Reference

Standard USB String Descriptor (USB-IF naming conventions). More...

Data Fields

u8 bLength
 
u8 bDescriptorType
 
wchar_t bString []
 

Detailed Description

Standard USB String Descriptor (USB-IF naming conventions).

Type define for a standard string descriptor. Unlike other standard descriptors, the length of the descriptor for placement in the descriptor header must be determined by the USB_STRING_LEN() macro rather than by the size of the descriptor structure, as the length is not fixed.

This structure should also be used for string index 0, which contains the supported language IDs for the device as an array.

This structure uses the relevant standard's given element names to ensure compatibility with the standard.

See also
USB_Descriptor_String_t for the version of this type with with non-standard LUFA specific element names.
Note
Regardless of CPU architecture, these values should be stored as little endian.

Field Documentation

◆ bLength

u8 USB_StdDescriptor_String_t::bLength

Size of the descriptor, in bytes.

◆ bDescriptorType

u8 USB_StdDescriptor_String_t::bDescriptorType

Type of the descriptor, either a value in USB_DescriptorTypes_t or a value given by the specific class.

◆ bString

wchar_t USB_StdDescriptor_String_t::bString[]

String data, as unicode characters (alternatively, string language IDs). If normal ASCII characters are to be used, they must be added as an array of characters rather than a normal C string so that they are widened to Unicode size.

Under GCC, strings prefixed with the "L" character (before the opening string quotation mark) are considered to be Unicode strings, and may be used instead of an explicit array of ASCII characters.