Introduce two more layers between device and endpoint:

device -> active config -> claimed interface -> endpoints.
Device can have at most one active config. A config can have
multiple claimed interfaces, each with a specific alt setting.
An interface with an alt setting defines a list of endpoints.
This commit is contained in:
Sebastian Zagrodzki
2017-04-29 00:01:11 +02:00
parent d193e605a4
commit 5f122b4dcd
10 changed files with 309 additions and 250 deletions

View File

@@ -68,7 +68,7 @@ func (c *Context) ListDevices(each func(desc *Descriptor) bool) ([]*Device, erro
reterr = err
continue
}
ret = append(ret, newDevice(handle, desc))
ret = append(ret, &Device{handle: handle, Descriptor: desc})
} else {
libusb.dereference(dev)
}