Add a test for InEndpoint.Read. Use ID for vid/pid in OpenDevice...

This commit is contained in:
Sebastian Zagrodzki
2017-04-10 01:25:51 +02:00
parent b1dcaa1195
commit b6794b7d45
3 changed files with 33 additions and 2 deletions

View File

@@ -82,7 +82,7 @@ func (c *Context) ListDevices(each func(desc *Descriptor) bool) ([]*Device, erro
// If there were any errors during device list traversal, it is possible
// it will return a non-nil device and non-nil error. A Device.Close() must
// be called to release the device if the returned device wasn't nil.
func (c *Context) OpenDeviceWithVidPid(vid, pid int) (*Device, error) {
func (c *Context) OpenDeviceWithVidPid(vid, pid ID) (*Device, error) {
var found bool
devs, err := c.ListDevices(func(desc *Descriptor) bool {
if found {