usb

package
v2.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2022 License: LGPL-3.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

View Source
const HIDUse = false

Variables

View Source
var ErrNotFound = errors.New("device not found")

Functions

This section is empty.

Types

type HID

type HID struct {
}

func (*HID) Close

func (d *HID) Close(disconnected bool) error

func (*HID) Read

func (d *HID) Read(buf []byte) (int, error)

func (*HID) Write

func (d *HID) Write(buf []byte) (int, error)

type HIDAPI

type HIDAPI struct {
}

func InitHIDAPI

func InitHIDAPI(mw *memorywriter.MemoryWriter) (*HIDAPI, error)

func (*HIDAPI) Close

func (b *HIDAPI) Close()

func (*HIDAPI) Connect

func (b *HIDAPI) Connect(path string, debug bool, reset bool) (core.USBDevice, error)

func (*HIDAPI) Enumerate

func (b *HIDAPI) Enumerate() ([]core.USBInfo, error)

func (*HIDAPI) Has

func (b *HIDAPI) Has(path string) bool

type LibUSB

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

func InitLibUSB

func InitLibUSB(mw *memorywriter.MemoryWriter, onlyLibusb, allowCancel, detach bool) (*LibUSB, error)

func (*LibUSB) Close

func (b *LibUSB) Close()

func (*LibUSB) Connect

func (b *LibUSB) Connect(path string, debug bool, reset bool) (core.USBDevice, error)

func (*LibUSB) Enumerate

func (b *LibUSB) Enumerate() ([]core.USBInfo, error)

func (*LibUSB) Has

func (b *LibUSB) Has(path string) bool

type LibUSBDevice

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

func (*LibUSBDevice) Close

func (d *LibUSBDevice) Close(disconnected bool) error

func (*LibUSBDevice) Read

func (d *LibUSBDevice) Read(buf []byte) (int, error)

func (*LibUSBDevice) Write

func (d *LibUSBDevice) Write(buf []byte) (int, error)

type PortTouple

type PortTouple struct {
	Normal int
	Debug  int // 0 if not present
}

type UDP

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

func InitUDP

func InitUDP(ports []PortTouple, mw *memorywriter.MemoryWriter) (*UDP, error)

func (*UDP) Close

func (udp *UDP) Close()

func (*UDP) Connect

func (udp *UDP) Connect(path string, debug bool, reset bool) (core.USBDevice, error)

func (*UDP) Enumerate

func (udp *UDP) Enumerate() ([]core.USBInfo, error)

func (*UDP) Has

func (udp *UDP) Has(path string) bool

type UDPDevice

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

func (*UDPDevice) Close

func (d *UDPDevice) Close(disconnected bool) error

func (*UDPDevice) Read

func (d *UDPDevice) Read(buf []byte) (int, error)

func (*UDPDevice) Write

func (d *UDPDevice) Write(buf []byte) (int, error)

type USB

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

func Init

func Init(buses ...core.USBBus) *USB

func (*USB) Close

func (b *USB) Close()

func (*USB) Connect

func (b *USB) Connect(path string, debug bool, reset bool) (core.USBDevice, error)

func (*USB) Enumerate

func (b *USB) Enumerate() ([]core.USBInfo, error)

func (*USB) Has

func (b *USB) Has(path string) bool

Directories

Path Synopsis
lowlevel
libusb
Package libusb provides go wrappers for libusb-1.0
Package libusb provides go wrappers for libusb-1.0

Jump to

Keyboard shortcuts

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