protocol

package
v0.0.0-...-d23200b Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2024 License: 0BSD Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PrintModeDefault = 0
	PrintModeFont2   = 1 << 0

	PrintModeEmphasized   = 1 << 3
	PrintModeDoubleHeight = 1 << 4
	PrintModeDoubleWidth  = 1 << 5

	PrintModeUnderline = 1 << 7
)
View Source
const (
	ASBReportNothing               = 0
	ASBReportKickoutConnector      = 1 << 0
	ASBReportOnlineStatus          = 1 << 1
	ASBReportErrors                = 1 << 2
	ASBReportRollPaperSensorStatus = 1 << 3

	ASBReportPanelSwitchStatus = 1 << 6

	ASBReportAll = ASBReportKickoutConnector |
		ASBReportOnlineStatus |
		ASBReportErrors |
		ASBReportRollPaperSensorStatus |
		ASBReportPanelSwitchStatus
)
View Source
const (
	TransmitPaperSensorStatus      = 1
	TransmitKickoutConnectorStatus = 2
)
View Source
const (
	Color1 = 49
	Color2 = 50
)
View Source
const (
	FullCut           = 0
	PartialCut        = 1
	FeedAndFullCut    = 65
	FeedAndPartialCut = 66
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ASBStatus

type ASBStatus struct {
	DrawerKickoutConnector DrawerKickoutConnectorStatus
	Online                 OnlineStatus
	Paper                  PaperSensorStatus
	Error                  ErrorStatus
	PanelSwitch            PanelSwitchStatus
}

type DrawerKickoutConnectorStatus

type DrawerKickoutConnectorStatus struct {
	IsPin3High bool
}

type ErrorStatus

type ErrorStatus struct {
	RecoverableErrorOccurred              bool
	AutocutterErrorOccurred               bool
	UnrecoverableErrorOccurred            bool
	AutomaticallyRecoverableErrorOccurred bool
}

type OnlineStatus

type OnlineStatus struct {
	IsOffline                  bool
	IsCoverOpen                bool
	IsPaperFedByFeedButton     bool
	IsWaitingForOnlineRecovery bool
}

type PanelSwitchStatus

type PanelSwitchStatus struct {
	IsFeedButtonPressed bool
}

type PaperSensorStatus

type PaperSensorStatus struct {
	IsNearEnd    bool
	IsNotPresent bool
}

type Protocol

type Protocol int
const (
	Generic Protocol = iota
	TMT88IV Protocol = iota
)

func (Protocol) CutPaper

func (p Protocol) CutPaper(m uint8, n uint8) ([]byte, error)

CutPaper executes GS V ("Select cut mode and cut paper")

func (Protocol) InitializePrinter

func (p Protocol) InitializePrinter() ([]byte, error)

InitializePrinter executes ESC @ ("Initialize printer")

func (Protocol) ParseASBStatus

func (p Protocol) ParseASBStatus(status [4]byte) ASBStatus

func (Protocol) ParsePaperSensorStatus

func (p Protocol) ParsePaperSensorStatus(status byte) PaperSensorStatus

func (Protocol) PrintGraphicsData

func (p Protocol) PrintGraphicsData() ([]byte, error)

PrintGraphicsData executes GS 8 L p1 p2 p3 p4 m fn <Function 50> ("Print the graphics data in the print buffer.")

func (Protocol) SelectCharacterCodeTable

func (p Protocol) SelectCharacterCodeTable(n uint8) ([]byte, error)

SelectCharacterCodeTable executes ESC t n ("Select character code table")

func (Protocol) SelectPrintModes

func (p Protocol) SelectPrintModes(n uint8) ([]byte, error)

SelectPrintModes executes ESC ! n ("Select print mode(s)")

func (Protocol) SelectPrintSpeed

func (p Protocol) SelectPrintSpeed(m uint8) ([]byte, error)

SetPrintSpeed executes GS ( K <Function 50> ("Select the print speed")

func (Protocol) SetAutomaticStatusBack

func (p Protocol) SetAutomaticStatusBack(n uint8) ([]byte, error)

func (Protocol) StoreGraphicsData

func (p Protocol) StoreGraphicsData(bx uint8, by uint8, c uint8, x uint16, y uint16, d ...uint8) ([]byte, error)

StoreGraphicsData executes GS 8 L p1 p2 p3 p4 m fn a bx by c xL xH yL yH d1...dk <Function 112> ("Store the graphics data in the print buffer (raster format).")

func (Protocol) TransmitStatus

func (p Protocol) TransmitStatus(n uint8) ([]byte, error)

Jump to

Keyboard shortcuts

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