Skip to content

Commit

Permalink
add interface support
Browse files Browse the repository at this point in the history
  • Loading branch information
mattdf committed Aug 31, 2016
1 parent 61aab8c commit 754b27e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions hid.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ type Device interface {
Close()
Info() Info
SetEndpoint(int)
SetInterface(int)
HIDReport() ([]byte, error)
SetReport(int, []byte) error
GetReport(int) ([]byte, error)
Expand Down
4 changes: 4 additions & 0 deletions usb_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ func (hid *usbDevice) SetEndpoint(ep int) {
hid.epIn = ep + 0x80
}

func (hid *usbDevice) SetInterface(ifno int) {
hid.info.Interface = uint8(ifno)
}

func (hid *usbDevice) Open() (err error) {
if hid.f != nil {
return errors.New("device is already opened")
Expand Down

0 comments on commit 754b27e

Please sign in to comment.