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:
Sebastian Zagrodzki
2017-04-29 11:56:49 +02:00
parent 60d0aba507
commit 77c176cd4c
4 changed files with 22 additions and 26 deletions

View File

@@ -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{{