fss500

package
v0.0.0-...-d61b845 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package fss500 is a driver for the Fujitsu ScanSnap iX500 document scanner, implemented from scratch based on USB traffic captures. Terminology has been chosen to be consistent with the SANE fujitsu driver’s terminology where appropriate.

See also https://www.staff.uni-mainz.de/tacke/scsi/SCSI2-15.html

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrShortRead represents a short read when transferring data.
	ErrShortRead = errors.New("short read")

	// ErrEndOfPaper is returned when no more data is to be read for
	// this page.
	ErrEndOfPaper = errors.New("end of paper")

	// ErrTemporaryNoData is returned when data was requested, but
	// there is no data to be read from the scanner.
	ErrTemporaryNoData = errors.New("temporary no data")

	// ErrHopperEmpty is returned when no paper is in the document
	// hopper.
	ErrHopperEmpty = errors.New("hopper empty")
)

Functions

func GetPixelSize

func GetPixelSize(dev io.ReadWriter) error

GetPixelSize requests the pixel size of the object being scanned.

func Inquire

func Inquire(dev io.ReadWriter) error

Inquire requests the scanner make and model.

func LampOn

func LampOn(dev io.ReadWriter) error

LampOn turns on the scanner’s lamp.

func ModeSelectAuto

func ModeSelectAuto(dev io.ReadWriter) error

ModeSelectAuto enables automatic paper feed.

func ModeSelectBackground

func ModeSelectBackground(dev io.ReadWriter) error

ModeSelectBackground sets the background color setting

func ModeSelectBuffering

func ModeSelectBuffering(dev io.ReadWriter) error

ModeSelectBuffering enables buffering.

func ModeSelectDoubleFeed

func ModeSelectDoubleFeed(dev io.ReadWriter) error

ModeSelectDoubleFeed enables double feed detection.

func ModeSelectDropout

func ModeSelectDropout(dev io.ReadWriter) error

ModeSelectDropout sets the dropout color.

func ModeSelectPrepick

func ModeSelectPrepick(dev io.ReadWriter) error

ModeSelectPrepick enables prepick.

func ObjectPosition

func ObjectPosition(dev io.ReadWriter) error

ObjectPosition loads an object (paper) into the scanner, returning an error if no more paper is found in the document feeder.

func Preread

func Preread(dev io.ReadWriter) error

Preread switches the scanner into 600 dpi scan mode.

func Ric

func Ric(dev io.ReadWriter, side int) error

TODO: document Ric

func SendLut

func SendLut(dev io.ReadWriter) error

TODO: document SendLut. Does lut stand for lookup table?

func SendQtable

func SendQtable(dev io.ReadWriter) error

TODO: document SendQtable

func SetWindow

func SetWindow(dev io.ReadWriter) error

SetWindow sets a window for scanning, specifying parameters such as the brightness, threshold, contrast, compression type, etc.

func StartScan

func StartScan(dev io.ReadWriter) error

StartScan instructs the scanner to start scanning.

Types

type HardwareStatus

type HardwareStatus struct {
	Hopper bool

	ScanSw bool
	// contains filtered or unexported fields
}

HardwareStatus contains status bits for individual features of the scanner, e.g. whether paper is inserted into the hopper, and whether the scan button was pressed.

func GetHardwareStatus

func GetHardwareStatus(dev io.ReadWriter) (HardwareStatus, error)

GetHardwareStatus retrieves the hardware status (including whether paper is inserted into the hopper, and whether the scan button was pressed) from the device.

type Response

type Response struct {
	// Raw contains the raw response bytes for the SCSI command.
	Raw []byte
	// Extra contains the extra bytes, if any, for the SCSI command.
	Extra []byte
}

Response contains the raw response and extra bytes read from the device.

func ReadData

func ReadData(dev io.ReadWriter, side int) (*Response, error)

ReadData reads data from the front of the page (side == 0) or the back of the page (side == 1).

Directories

Path Synopsis
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.
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.

Jump to

Keyboard shortcuts

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