Configuration Class
Package: GHIElectronics.Endpoint.Devices.UsbHost
Namespace: GHIElectronics.Endpoint.Devices.UsbHost.Descriptors
Configuration descriptor.
class Configuration : public BaseDescriptor {};
Constructors
Configuration(byte[] buffer)
Configuration(const std::vector<uint8_t>& buffer);
Constructs a new descriptor.
| Parameter | Type | Description |
|---|---|---|
buffer | byte[] | The buffer with which to populate the descriptor. |
Configuration(byte[] buffer, int offset)
Configuration(const std::vector<uint8_t>& buffer, int32_t offset);
Constructs a new descriptor.
| Parameter | Type | Description |
|---|---|---|
buffer | byte[] | The buffer with which to populate the descriptor. |
offset | int | The offset into the buffer at which to start. |
Configuration()
Configuration();
Constructs a new descriptor.
Properties
Attributes
uint8_t Attributes() const;
void Attributes(uint8_t value);
A bitmap representing the attributes of the device.
Returns byte
AuxiliaryDescriptors
std::vector<Auxiliary> AuxiliaryDescriptors() const;
void AuxiliaryDescriptors(std::vector<Auxiliary> value);
Child auxiliary descriptors.
Returns Auxiliary[]
Index
uint8_t Index() const;
void Index(uint8_t value);
The configuration string descriptor index.
Returns byte
Interfaces
std::vector<Interface> Interfaces() const;
void Interfaces(std::vector<Interface> value);
Child interface descriptors.
Returns Interface[]
MaxPower
uint8_t MaxPower() const;
void MaxPower(uint8_t value);
The maximum power consumption in 2mA units.
Returns byte
NumberOfInterfaces
uint8_t NumberOfInterfaces() const;
void NumberOfInterfaces(uint8_t value);
The number of interfaces.
Returns byte
TotalLength
uint16_t TotalLength() const;
void TotalLength(uint16_t value);
Total length of the the data returned in bytes.
Returns ushort
Value
uint8_t Value() const;
void Value(uint8_t value);
The value to be used as an argument to select this configuration.
Returns byte
Methods
FillChildren(byte[] bytes, int offset)
void FillChildren(const std::vector<uint8_t>& bytes, int32_t offset);
Walks a config-descriptor blob from offset to the end and fills Configuration.Interfaces, the nested endpoints, and Configuration.AuxiliaryDescriptors.
| Parameter | Type | Description |
|---|---|---|
bytes | byte[] | The full configuration-descriptor blob (length = Configuration.TotalLength). |
offset | int | Byte offset to start parsing children: typically Configuration.FixedLength when the blob starts with the configuration header. |
Fields
FixedLength
static constexpr uint8_t FixedLength = 9;
The fixed length of this descriptor type in bytes.