Documentation
¶
Index ¶
- Constants
- Variables
- type DeviceInfo
- type USB
- func (u *USB) Close(ctx context.Context) error
- func (u *USB) GetFeatureReport(ctx context.Context, v []byte) (int, error)
- func (u *USB) Info() DeviceInfo
- func (u *USB) Open(ctx context.Context) error
- func (u *USB) Read(ctx context.Context, v []byte, t time.Duration) (int, error)
- func (u *USB) SendFeatureReport(ctx context.Context, v []byte) (int, error)
- func (u *USB) Write(ctx context.Context, v []byte) (int, error)
Constants ¶
View Source
const ( USBHidClass = 3 USBDevBus = "/dev/bus/usb" USBDevFSConnect = 0x5517 USBDevFSDisconnect = 0x5516 USBDevFSClaim = 0x8004550f USBDevFSRelease = 0x80045510 USBDevFSIoctl = 0xc0105512 USBDevFSBulk = 0xc0185502 USBDevFSControl = 0xc0185500 USBDescTypeDevice = 1 USBDescTypeConfig = 2 USBDescTypeString = 3 USBDescTypeInterface = 4 USBDescTypeEndpoint = 5 USBDescTypeReport = 33 )
Variables ¶
View Source
var ErrDeviceAlreadyConnected = errors.New("hid: device already connected")
Functions ¶
This section is empty.
Types ¶
type DeviceInfo ¶
type USB ¶
type USB struct {
// contains filtered or unexported fields
}
func Devices ¶
Devices returns a slice of USB devices by recursively searching the given directory. If the directory points to a USB device, then it will be returned as a slice of length 1.
func (*USB) GetFeatureReport ¶
func (*USB) SendFeatureReport ¶
Click to show internal directories.
Click to hide internal directories.