USB::StringDescriptor< max_chars > Struct Template Reference

Template for making a USB string descriptor. More...

#include <Descriptors.h>

Inheritance diagram for USB::StringDescriptor< max_chars >:
Collaboration diagram for USB::StringDescriptor< max_chars >:

Public Member Functions

 StringDescriptor ()
 Construct an empty string descriptor. More...
 
 StringDescriptor (const char *str, size_t charCount)
 Construct a string descriptor containing text. More...
 
 StringDescriptor (const String &s)
 
- Public Member Functions inherited from USB::Descriptor
template<typename T >
const T * as () const
 Less clumsy way to cast descriptor to a specific type. More...
 
size_t printTo (Print &p) const
 

Public Attributes

uint16_t text [max_chars]
 UTF16-LE encoded text (no NUL terminator) More...
 
- Public Attributes inherited from USB::Descriptor
uint8_t length
 Total size (in bytes) including this header. More...
 
uint8_t type
 e.g. TUSB_DESC_STRING More...
 

Detailed Description

template<size_t max_chars>
struct USB::StringDescriptor< max_chars >

Template for making a USB string descriptor.

Constructor & Destructor Documentation

◆ StringDescriptor() [1/3]

template<size_t max_chars>
USB::StringDescriptor< max_chars >::StringDescriptor ( )
inline

Construct an empty string descriptor.

◆ StringDescriptor() [2/3]

template<size_t max_chars>
USB::StringDescriptor< max_chars >::StringDescriptor ( const char *  str,
size_t  charCount 
)
inline

Construct a string descriptor containing text.

Parameters
strASCII text (unicode page #0 only)
charCountNumber of characters in string

◆ StringDescriptor() [3/3]

template<size_t max_chars>
USB::StringDescriptor< max_chars >::StringDescriptor ( const String s)
inline

Member Data Documentation

◆ text

template<size_t max_chars>
uint16_t USB::StringDescriptor< max_chars >::text[max_chars]

UTF16-LE encoded text (no NUL terminator)


The documentation for this struct was generated from the following file: