hid

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

README

go-hid

Working prototype to prove that you don't need cgo to work with HID devices. Currently, only Windows is supported.

Developed as part of go-ctaphid.

Status

  • Windows
    • Enumerate
    • Open
      • Read
      • Write
  • macOS
    • Enumerate
    • Open
      • Read
      • Write
  • Linux
    • Enumerate
    • Open
      • Read
      • Write

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Enumerate added in v0.2.0

func Enumerate() iter.Seq2[*DeviceInfo, error]

Types

type Device added in v0.2.0

type Device struct {
	// contains filtered or unexported fields
}

func OpenPath added in v0.2.0

func OpenPath(path string) (*Device, error)

func (*Device) Close added in v0.2.0

func (d *Device) Close() error

func (*Device) Read added in v0.2.0

func (d *Device) Read(b []byte) (int, error)

func (*Device) Write added in v0.2.0

func (d *Device) Write(b []byte) (int, error)

type DeviceInfo

type DeviceInfo struct {
	Path         string // Platform-Specific Device Path
	VendorID     uint16 // Device Vendor ID
	ProductID    uint16 // Device Product ID
	SerialNbr    string // Serial Number
	ReleaseNbr   uint16 // Device Version Number
	MfrStr       string // Manufacturer String
	ProductStr   string // Product String
	UsagePage    uint16 // Usage Page for Device/Interface
	Usage        uint16 // Usage for Device/Interface
	InterfaceNbr int    // USB Interface Number
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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