usb

package
v0.0.0-...-7e8a2ca Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package usb is a minimal, device-specific library which uses Linux’s usbdevfs and /sys interfaces to communicate with a Fujitsu ScanSnap iX500 via USB.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Device

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

Device represents a USB device.

func FindDevice

func FindDevice() (*Device, error)

FindDevice returns a ready-to-use Device object for the Fujitsu ScanSnap iX500 or a non-nil error if the scanner is not connected.

func (*Device) Close

func (u *Device) Close() error

Close releases all resources associated with the Device. The Device must not be used after calling Close.

func (*Device) Read

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

Read transfers up to len(p) bytes from the device to the host via blocking USB bulk transfer.

func (*Device) Write

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

Write transfers p from the host to the device via blocking USB bulk transfer.

Jump to

Keyboard shortcuts

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