accessories

package
v0.0.0-...-77df42f Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command = uint8

Command is a command that can be sent to the printer

const (
	// CommandInit is the command to initialize the printer
	CommandInit Command = 0x01
	// CommandStart is the command to start printing
	CommandStart Command = 0x02
	// CommandData is the command to send data to the printer
	CommandData Command = 0x04
	// CommandStatus is the command to get the status of the printer
	CommandStatus Command = 0xF
)

type CommandPosition

type CommandPosition uint8

CommandPosition is the position of the command in the command sequence

const (
	// CommandPositionMagic1 is the first magic byte
	CommandPositionMagic1 CommandPosition = 0x00
	// CommandPositionMagic2 is the second magic byte
	CommandPositionMagic2 CommandPosition = 0x01
	// CommandPositionID is the ID of the command
	CommandPositionID CommandPosition = 0x02
	// CommandPositionCompression is the compression flag
	CommandPositionCompression CommandPosition = 0x03
	// CommandPositionLengthLow is the low byte of the length
	CommandPositionLengthLow CommandPosition = 0x04
	// CommandPositionLengthHigh is the high byte of the length
	CommandPositionLengthHigh CommandPosition = 0x05
	// CommandPositionData is the data of the command
	CommandPositionData CommandPosition = 0x06
	// CommandPositionChecksumLow is the low byte of the checksum
	CommandPositionChecksumLow CommandPosition = 0x07
	// CommandPositionChecksumHigh is the high byte of the checksum
	CommandPositionChecksumHigh CommandPosition = 0x08
	// CommandPositionKeepAlive is the keep alive flag
	CommandPositionKeepAlive CommandPosition = 0x09
	// CommandPositionStatus is the status byte
	CommandPositionStatus CommandPosition = 0x0A
)

func (CommandPosition) String

func (c CommandPosition) String() string

type Printer

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

func NewPrinter

func NewPrinter() *Printer

func (*Printer) GetPrintJob

func (p *Printer) GetPrintJob() image.Image

func (*Printer) HasPrintJob

func (p *Printer) HasPrintJob() bool

func (*Printer) PrintStashed

func (p *Printer) PrintStashed()

func (*Printer) Receive

func (p *Printer) Receive(bit bool)

Receive a bit to the printer

func (*Printer) Send

func (p *Printer) Send() bool

Send a bit from the printer

Jump to

Keyboard shortcuts

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