google

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: MIT Imports: 5 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

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

Context models libusb context and implements the driver.Context interface.

func (*Context) Close

func (c *Context) Close() error

Close the libusb session/context.

func (*Context) NewDeviceByVIDPID

func (c *Context) NewDeviceByVIDPID(VID, PID int) (driver.USBDevice, error)

NewDeviceByVIDPID creates new USB device based on the given the vendor ID and product ID. If multiple USB devices matching the VID and PID are found, only the first is returned.

func (*Context) SetDebugLevel

func (c *Context) SetDebugLevel(level int)

SetDebugLevel sets the debug level for the libusb session/context

type Device

type Device struct {
	BulkInEndpoint      *gousb.InEndpoint
	BulkOutEndpoint     *gousb.OutEndpoint
	InterruptInEndpoint *gousb.InEndpoint
	// contains filtered or unexported fields
}

Device represents a USB device not a USBMTC device.

func (*Device) Close

func (d *Device) Close() error

Close closes the Device.

func (*Device) Read

func (d *Device) Read(p []byte) (n int, err error)

Read reads from the USB device's bulk in endpoint.

func (*Device) String

func (d *Device) String() string

String providers the Stringer interface method for Device.

func (*Device) Write

func (d *Device) Write(p []byte) (n int, err error)

Write writes to the USB device's bulk out endpoint.

func (*Device) WriteString

func (d *Device) WriteString(s string) (n int, err error)

WriteString writes the given string to the Device and returns the number of bytes written along with an error code.

type Driver

type Driver struct {
}

Driver implements the visa.Driver interface.

func (Driver) NewContext

func (d Driver) NewContext() (driver.Context, error)

NewContext creates a new libusb session/context.

Jump to

Keyboard shortcuts

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