hidapi

package
v2.0.25+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2018 License: LGPL-3.0 Imports: 5 Imported by: 0

README

hidapi go wrapper

This is a go wrapper around hidapi.

The code is mostly copied from https://github.com/karalabe/hid

ALSO NOTE - there is a hardcoded device filter because of random windows errors.

License

Code is under GNU LGPL 2.1.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetLogWriter

func SetLogWriter(l io.Writer)

Types

type HidDevice

type HidDevice struct {
	HidDeviceInfo // Embed the infos for easier access
}

func (*HidDevice) Close

func (dev *HidDevice) Close() error

func (*HidDevice) Read

func (dev *HidDevice) Read(b []byte, milliseconds int) (int, error)

func (*HidDevice) Write

func (dev *HidDevice) Write(b []byte, prepend bool) (int, error)

type HidDeviceInfo

type HidDeviceInfo struct {
	VendorID  uint16 // Device Vendor ID
	ProductID uint16 // Device Product ID
	Interface int
	UsagePage uint16 // Usage Page for this Device/Interface (Windows/Mac only)
	Path      string // Platform-specific device path
}

func HidEnumerate

func HidEnumerate(vendorID uint16, productID uint16) []HidDeviceInfo

func (HidDeviceInfo) Open

func (info HidDeviceInfo) Open() (*HidDevice, error)

Jump to

Keyboard shortcuts

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