Skip to content

Commit

Permalink
make ctrl exportable
Browse files Browse the repository at this point in the history
  • Loading branch information
mengzhuo committed Nov 6, 2017
1 parent 8ac6f75 commit 0d56fe2
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 @@ -28,4 +28,5 @@ type Device interface {
GetReport(int) ([]byte, error)
Read(size int, ms time.Duration) ([]byte, error)
Write(data []byte, ms time.Duration) (int, error)
Ctrl(rtype, req, val, index int, data []byte, t int) (int, error)
}
4 changes: 4 additions & 0 deletions usb_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ func (hid *usbDevice) release() error {
return nil
}

func (hid *usbDevice) Ctrl(rtype, req, val, index int, data []byte, t int) (int, error) {
return hid.ctrl(rtype, req, val, index, data, t)
}

func (hid *usbDevice) ctrl(rtype, req, val, index int, data []byte, t int) (int, error) {
s := usbfsCtrl{
ReqType: uint8(rtype),
Expand Down

0 comments on commit 0d56fe2

Please sign in to comment.