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