newEndpoint no longer references *Device, but receives individual values

extracted from the device. Makes testing easier.
This commit is contained in:
Sebastian Zagrodzki
2017-02-26 21:47:47 +01:00
parent d0859b8c47
commit 2d51a51ec5
3 changed files with 7 additions and 9 deletions

View File

@@ -141,7 +141,7 @@ func (d *Device) OpenEndpoint(cfgNum, ifNum, setNum, epNum uint8) (Endpoint, err
return nil, fmt.Errorf("usb: unknown endpoint %02x", epNum)
}
end := newEndpoint(d, *ifs, *ep)
end := newEndpoint(d.handle, *ifs, *ep, d.ReadTimeout, d.WriteTimeout)
// Set the configuration
activeConf, err := libusb.getConfig(d.handle)