Modify EndpointInfo to provide meaningful data rather than raw USB

descriptor values. E.g. for the user, the distinction between
MaxIsoPkt and MaxPktSize is irrelevant, only the calculated max packet
size matters.
This commit is contained in:
Sebastian Zagrodzki
2017-04-08 23:49:10 +02:00
parent d982ef5a37
commit e0f30623b3
11 changed files with 195 additions and 141 deletions

View File

@@ -92,7 +92,7 @@ func (d *Device) Close() error {
return nil
}
func (d *Device) OpenEndpoint(cfgNum, ifNum, setNum, epNum uint8) (*Endpoint, error) {
func (d *Device) OpenEndpoint(epNum, cfgNum, ifNum, setNum uint8) (*Endpoint, error) {
var cfg *ConfigInfo
for _, c := range d.Configs {
if c.Config == cfgNum {
@@ -132,7 +132,7 @@ func (d *Device) OpenEndpoint(cfgNum, ifNum, setNum, epNum uint8) (*Endpoint, er
var ep *EndpointInfo
for _, e := range ifs.Endpoints {
if e.Address == epNum {
if e.Number == epNum {
debug.Printf("found ep %02x in %#v\n", epNum, *ifs)
ep = &e
}