newEndpoint no longer references *Device, but receives individual values
extracted from the device. Makes testing easier.
This commit is contained in:
@@ -78,12 +78,12 @@ func (e *endpoint) transfer(buf []byte, timeout time.Duration) (int, error) {
|
||||
return n, nil
|
||||
}
|
||||
|
||||
func newEndpoint(d *Device, s InterfaceSetup, e EndpointInfo) *endpoint {
|
||||
func newEndpoint(h *libusbDevHandle, s InterfaceSetup, e EndpointInfo, rt, wt time.Duration) *endpoint {
|
||||
return &endpoint{
|
||||
InterfaceSetup: s,
|
||||
EndpointInfo: e,
|
||||
h: d.handle,
|
||||
readTimeout: d.ReadTimeout,
|
||||
writeTimeout: d.WriteTimeout,
|
||||
h: h,
|
||||
readTimeout: rt,
|
||||
writeTimeout: wt,
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user