Versions in this module Expand all Collapse all v1 v1.1.3 Feb 24, 2024 v1.1.2 Mar 29, 2022 Changes in this version type DeviceDesc + Path []int v1.1.1 Nov 9, 2020 v1.1.0 Apr 29, 2020 Changes in this version + const ControlClass + const ControlDevice + const ControlEndpoint + const ControlIn + const ControlInterface + const ControlOther + const ControlOut + const ControlVendor + type BCD uint16 + func Version(major, minor uint8) BCD + func (s BCD) Major() uint8 + func (s BCD) Minor() uint8 + func (s BCD) String() string + type Class uint8 + const ClassApplication + const ClassAudio + const ClassAudioVideo + const ClassBillboard + const ClassComm + const ClassContentSecurity + const ClassData + const ClassDiagnosticDevice + const ClassHID + const ClassHub + const ClassImage + const ClassMassStorage + const ClassMiscellaneous + const ClassPTP + const ClassPerInterface + const ClassPersonalHealthcare + const ClassPhysical + const ClassPrinter + const ClassSmartCard + const ClassUSBTypeCBridge + const ClassVendorSpec + const ClassVideo + const ClassWireless + func (c Class) String() string + type Config struct + Desc ConfigDesc + func (c *Config) Close() error + func (c *Config) Interface(num, alt int) (*Interface, error) + func (c *Config) String() string + type ConfigDesc struct + Interfaces []InterfaceDesc + MaxPower Milliamperes + Number int + RemoteWakeup bool + SelfPowered bool + func (c ConfigDesc) String() string + type Context struct + func NewContext() *Context + func (c *Context) Close() error + func (c *Context) Debug(level int) + func (c *Context) OpenDeviceWithVIDPID(vid, pid ID) (*Device, error) + func (c *Context) OpenDevices(opener func(desc *DeviceDesc) bool) ([]*Device, error) + type DescriptorType uint8 + const DescriptorTypeConfig + const DescriptorTypeDevice + const DescriptorTypeEndpoint + const DescriptorTypeHID + const DescriptorTypeHub + const DescriptorTypeInterface + const DescriptorTypePhysical + const DescriptorTypeReport + const DescriptorTypeString + func (dt DescriptorType) String() string + type Device struct + ControlTimeout time.Duration + Desc *DeviceDesc + func (d *Device) ActiveConfigNum() (int, error) + func (d *Device) Close() error + func (d *Device) Config(cfgNum int) (*Config, error) + func (d *Device) ConfigDescription(cfg int) (string, error) + func (d *Device) Control(rType, request uint8, val, idx uint16, data []byte) (int, error) + func (d *Device) DefaultInterface() (intf *Interface, done func(), err error) + func (d *Device) GetStringDescriptor(descIndex int) (string, error) + func (d *Device) InterfaceDescription(cfgNum, intfNum, altNum int) (string, error) + func (d *Device) Manufacturer() (string, error) + func (d *Device) Product() (string, error) + func (d *Device) Reset() error + func (d *Device) SerialNumber() (string, error) + func (d *Device) SetAutoDetach(autodetach bool) error + func (d *Device) String() string + type DeviceDesc struct + Address int + Bus int + Class Class + Configs map[int]ConfigDesc + Device BCD + MaxControlPacketSize int + Port int + Product ID + Protocol Protocol + Spec BCD + Speed Speed + SubClass Class + Vendor ID + func (d *DeviceDesc) String() string + type EndpointAddress uint8 + func (a EndpointAddress) String() string + type EndpointDesc struct + Address EndpointAddress + Direction EndpointDirection + IsoSyncType IsoSyncType + MaxPacketSize int + Number int + PollInterval time.Duration + TransferType TransferType + UsageType UsageType + func (e EndpointDesc) String() string + type EndpointDirection bool + const EndpointDirectionIn + const EndpointDirectionOut + func (ed EndpointDirection) String() string + type Error C.int + const ErrorAccess + const ErrorBusy + const ErrorIO + const ErrorInterrupted + const ErrorInvalidParam + const ErrorNoDevice + const ErrorNoMem + const ErrorNotFound + const ErrorNotSupported + const ErrorOther + const ErrorOverflow + const ErrorPipe + const ErrorTimeout + const Success + func (e Error) Error() string + type ID uint16 + func (id ID) String() string + type InEndpoint struct + func (e *InEndpoint) NewStream(size, count int) (*ReadStream, error) + func (e *InEndpoint) Read(buf []byte) (int, error) + func (e *InEndpoint) ReadContext(ctx context.Context, buf []byte) (int, error) + func (e InEndpoint) String() string + type Interface struct + Setting InterfaceSetting + func (i *Interface) Close() + func (i *Interface) InEndpoint(epNum int) (*InEndpoint, error) + func (i *Interface) OutEndpoint(epNum int) (*OutEndpoint, error) + func (i *Interface) String() string + type InterfaceDesc struct + AltSettings []InterfaceSetting + Number int + func (i InterfaceDesc) String() string + type InterfaceSetting struct + Alternate int + Class Class + Endpoints map[EndpointAddress]EndpointDesc + Number int + Protocol Protocol + SubClass Class + func (a InterfaceSetting) String() string + type IsoSyncType uint8 + const IsoSyncTypeAdaptive + const IsoSyncTypeAsync + const IsoSyncTypeNone + const IsoSyncTypeSync + func (ist IsoSyncType) String() string + type Milliamperes uint + type OutEndpoint struct + func (e *OutEndpoint) NewStream(size, count int) (*WriteStream, error) + func (e *OutEndpoint) Write(buf []byte) (int, error) + func (e *OutEndpoint) WriteContext(ctx context.Context, buf []byte) (int, error) + func (e OutEndpoint) String() string + type Protocol uint8 + func (p Protocol) String() string + type ReadStream struct + func (r *ReadStream) Close() error + func (r *ReadStream) Read(p []byte) (int, error) + func (r *ReadStream) ReadContext(ctx context.Context, p []byte) (int, error) + type Speed int + const SpeedFull + const SpeedHigh + const SpeedLow + const SpeedSuper + const SpeedUnknown + func (s Speed) String() string + type TransferStatus uint8 + const TransferCancelled + const TransferCompleted + const TransferError + const TransferNoDevice + const TransferOverflow + const TransferStall + const TransferTimedOut + func (ts TransferStatus) Error() string + func (ts TransferStatus) String() string + type TransferType uint8 + const TransferTypeBulk + const TransferTypeControl + const TransferTypeInterrupt + const TransferTypeIsochronous + func (tt TransferType) String() string + type UsageType uint8 + const InterruptUsageTypeNotification + const InterruptUsageTypePeriodic + const IsoUsageTypeData + const IsoUsageTypeFeedback + const IsoUsageTypeImplicit + const UsageTypeUndefined + func (ut UsageType) String() string + type WriteStream struct + func (w *WriteStream) Close() error + func (w *WriteStream) CloseContext(ctx context.Context) error + func (w *WriteStream) Write(p []byte) (int, error) + func (w *WriteStream) WriteContext(ctx context.Context, p []byte) (int, error) + func (w *WriteStream) Written() int Incompatible versions in this module v2.1.0+incompatible Apr 29, 2020retracted