Skip to content

Commit

Permalink
Quirks logistics down to the UsbInterface structure
Browse files Browse the repository at this point in the history
  • Loading branch information
alexpevzner committed Dec 8, 2024
1 parent 85049d8 commit 165bf17
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions usbio_libusb.go
Original file line number Diff line number Diff line change
Expand Up @@ -675,8 +675,8 @@ func (devhandle *UsbDevHandle) usbIppBasicCaps() (caps UsbIppBasicCaps) {
}

// OpenUsbInterface opens an interface
func (devhandle *UsbDevHandle) OpenUsbInterface(addr UsbIfAddr) (
*UsbInterface, error) {
func (devhandle *UsbDevHandle) OpenUsbInterface(addr UsbIfAddr,
quirks Quirks) (*UsbInterface, error) {

// Claim the interface
rc := C.libusb_claim_interface(
Expand Down Expand Up @@ -705,13 +705,15 @@ func (devhandle *UsbDevHandle) OpenUsbInterface(addr UsbIfAddr) (
return &UsbInterface{
devhandle: devhandle,
addr: addr,
quirks: quirks,
}, nil
}

// UsbInterface represents IPP-over-USB interface
type UsbInterface struct {
devhandle *UsbDevHandle // Device handle
addr UsbIfAddr // Interface address
quirks Quirks // Device quirks
}

// Close the interface
Expand Down
2 changes: 1 addition & 1 deletion usbtransport.go
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ func (transport *UsbTransport) openUsbConn(

// Obtain interface
var err error
conn.iface, err = dev.OpenUsbInterface(ifaddr)
conn.iface, err = dev.OpenUsbInterface(ifaddr, quirks)
if err != nil {
goto ERROR
}
Expand Down

0 comments on commit 165bf17

Please sign in to comment.