hid.go 494 B

12345678910111213141516171819202122232425262728293031
  1. package hid
  2. import "time"
  3. //
  4. // General information about the HID device
  5. //
  6. type Info struct {
  7. Vendor uint16
  8. Product uint16
  9. Revision uint16
  10. SubClass uint8
  11. Protocol uint8
  12. Interface uint8
  13. }
  14. //
  15. // A common HID device interace
  16. //
  17. type Device interface {
  18. Open() error
  19. Close()
  20. Info() Info
  21. HIDReport() ([]byte, error)
  22. SetReport(int, []byte) error
  23. GetReport(int) ([]byte, error)
  24. Read(size int, ms time.Duration) ([]byte, error)
  25. Write(data []byte, ms time.Duration) (int, error)
  26. }