Configuration Class
Package: GHIElectronics.Endpoint.Devices.UsbHost
Namespace: GHIElectronics.Endpoint.Devices.UsbHost.Descriptors
Configuration descriptor.
public class Configuration : BaseDescriptor
Constructors
Configuration(byte[] buffer)
public Configuration(byte[] buffer)
Constructs a new descriptor.
| Parameter | Type | Description |
|---|---|---|
buffer | byte[] | The buffer with which to populate the descriptor. |
Configuration(byte[] buffer, int offset)
public Configuration(byte[] buffer, int 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()
protected Configuration()
Constructs a new descriptor.
Properties
Attributes
public byte Attributes { get; set; }
A bitmap representing the attributes of the device.
Returns byte
AuxiliaryDescriptors
public Auxiliary[] AuxiliaryDescriptors { get; set; }
Child auxiliary descriptors.
Returns Auxiliary[]
Index
public byte Index { get; set; }
The configuration string descriptor index.
Returns byte
Interfaces
public Interface[] Interfaces { get; set; }
Child interface descriptors.
Returns Interface[]
MaxPower
public byte MaxPower { get; set; }
The maximum power consumption in 2mA units.
Returns byte
NumberOfInterfaces
public byte NumberOfInterfaces { get; set; }
The number of interfaces.
Returns byte
TotalLength
public ushort TotalLength { get; set; }
Total length of the the data returned in bytes.
Returns ushort
Value
public byte Value { get; set; }
The value to be used as an argument to select this configuration.
Returns byte
Methods
FillChildren(byte[] bytes, int offset)
public void FillChildren(byte[] bytes, int 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
public const byte FixedLength = 9
The fixed length of this descriptor type in bytes.