Replace descriptor Configs with a map - config ids are arbitrary numbers
(unlike interface or alt setting numbers, which are 0-based array indices). This makes it easier to access a particular config without having to iterate over the descriptors.
This commit is contained in:
@@ -35,7 +35,7 @@ var (
|
||||
Vendor: ID(0x9999),
|
||||
Product: ID(0x0001),
|
||||
Protocol: 255,
|
||||
Configs: []ConfigInfo{{
|
||||
Configs: map[int]ConfigInfo{1: {
|
||||
Config: 1,
|
||||
MaxPower: Milliamperes(100),
|
||||
Interfaces: []InterfaceInfo{{
|
||||
@@ -71,7 +71,7 @@ var (
|
||||
Vendor: ID(0x8888),
|
||||
Product: ID(0x0002),
|
||||
Protocol: 255,
|
||||
Configs: []ConfigInfo{{
|
||||
Configs: map[int]ConfigInfo{1: {
|
||||
Config: 1,
|
||||
MaxPower: Milliamperes(100),
|
||||
Interfaces: []InterfaceInfo{{
|
||||
|
Reference in New Issue
Block a user