Pārlūkot izejas kodu

make ctrl exportable

zhuo.meng 7 gadi atpakaļ
vecāks
revīzija
89c412f53a
2 mainītis faili ar 5 papildinājumiem un 0 dzēšanām
  1. 1 0
      hid.go
  2. 4 0
      usb_linux.go

+ 1 - 0
hid.go

@@ -28,4 +28,5 @@ type Device interface {
 	GetReport(int) ([]byte, error)
 	GetReport(int) ([]byte, error)
 	Read(size int, ms time.Duration) ([]byte, error)
 	Read(size int, ms time.Duration) ([]byte, error)
 	Write(data []byte, ms time.Duration) (int, error)
 	Write(data []byte, ms time.Duration) (int, error)
+	Ctrl(rtype, req, val, index int, data []byte, t int) (int, error)
 }
 }

+ 4 - 0
usb_linux.go

@@ -95,6 +95,10 @@ func (hid *usbDevice) release() error {
 	return nil
 	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) {
 func (hid *usbDevice) ctrl(rtype, req, val, index int, data []byte, t int) (int, error) {
 	s := usbfsCtrl{
 	s := usbfsCtrl{
 		ReqType: uint8(rtype),
 		ReqType: uint8(rtype),