hide

package
v0.0.0-...-2c4df64 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 2, 2018 License: LGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Names

func Names() ([]string, error)

Names lists the names of all available HID devices.

Types

type Attr

type Attr struct {
	VendorId  uint16
	ProductId uint16
	Version   uint16
	SerialNo  string
}

type Caps

type Caps struct {
	Usage     uint16
	UsagePage uint16

	// Report lengths
	InputLen   int
	OutputLen  int
	FeatureLen int

	NumLinkCollectionNodes int
	NumInputButtonCaps     int
	NumInputValueCaps      int
	NumInputDataIndices    int
	NumOutputButtonCaps    int
	NumOutputValueCaps     int
	NumOutputDataIndices   int
	NumFeatureButtonCaps   int
	NumFeatureValueCaps    int
	NumFeatureDataIndices  int
}

type Device

type Device struct {
	*asyncio.File
}

Device is a HID device that statisfies io.ReadWriteCloser.

func Open

func Open(name string) (*Device, error)

Open opens the specified device.

func (*Device) DeviceInfo

func (d *Device) DeviceInfo() (*DeviceInfo, error)

func (*Device) SetOutputReport

func (d *Device) SetOutputReport(p []byte) error

type DeviceInfo

type DeviceInfo struct {
	Name string

	Attr *Attr
	Caps *Caps
}

func SerialNo

func SerialNo(sno string) ([]*DeviceInfo, error)

SerialNo finds accessible devices having the specified serial number.

func Stat

func Stat(name string) (*DeviceInfo, error)

Stat returns device info from the specified path.

func VendorDevices

func VendorDevices(vendor uint16, products ...uint16) ([]*DeviceInfo, error)

VendorDevices finds accessible devices having the specified vendor and product IDs.

type Error

type Error struct {
	Func string
	Path string
	Err  error
}

func (*Error) Error

func (e *Error) Error() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL