usb

package
v1.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	VendorT1            = 0x534c
	ProductT1Firmware   = 0x0001
	VendorT2            = 0x1209
	ProductT2Bootloader = 0x53C0
	ProductT2Firmware   = 0x53C1

	VendorArchos               = 0x0E79
	ProductSafeTminiBootloader = 0x6001
	ProductSafeTminiFirmware   = 0x6000
)

Variables

View Source
var (
	ErrNotFound = fmt.Errorf("device not found")
)

Functions

This section is empty.

Types

type Bus

type Bus interface {
	Enumerate() ([]Info, error)
	Connect(path string) (Device, error)
	Has(path string) bool
}

type Device

type Device interface {
	io.ReadWriteCloser
}

type HID

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

func (*HID) Close

func (d *HID) Close() 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 {
	// contains filtered or unexported fields
}

func InitHIDAPI

func InitHIDAPI(logger, dlogger *log.Logger) (*HIDAPI, error)

func (*HIDAPI) Connect

func (b *HIDAPI) Connect(path string) (Device, error)

func (*HIDAPI) Enumerate

func (b *HIDAPI) Enumerate() ([]Info, error)

func (*HIDAPI) Has

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

type Info

type Info struct {
	Path      string
	VendorID  int
	ProductID int
}

type UDP

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

func InitUDP

func InitUDP(ports []int) (*UDP, error)

func (*UDP) Connect

func (u *UDP) Connect(path string) (Device, error)

func (*UDP) Enumerate

func (u *UDP) Enumerate() ([]Info, error)

func (*UDP) Has

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

type UDPDevice

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

func (*UDPDevice) Close

func (d *UDPDevice) Close() 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 ...Bus) *USB

func (*USB) Connect

func (b *USB) Connect(path string) (Device, error)

func (*USB) Enumerate

func (b *USB) Enumerate() ([]Info, error)

type WUD

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

func (*WUD) Close

func (d *WUD) Close() error

func (*WUD) Read

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

func (*WUD) Write

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

type WebUSB

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

func InitWebUSB

func InitWebUSB(logger, dlogger *log.Logger) (*WebUSB, error)

func (*WebUSB) Close

func (b *WebUSB) Close()

func (*WebUSB) Connect

func (b *WebUSB) Connect(path string) (Device, error)

func (*WebUSB) Enumerate

func (b *WebUSB) Enumerate() ([]Info, error)

func (*WebUSB) Has

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

Jump to

Keyboard shortcuts

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