bill

package
v0.240209.0 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2024 License: CC0-1.0 Imports: 13 Imported by: 0

Documentation

Overview

Package bill incapsulates work with bill validators.

Index

Constants

View Source
const (
	StatusDefectiveMotor       byte = 0x01
	StatusSensorProblem        byte = 0x02
	StatusValidatorBusy        byte = 0x03
	StatusROMChecksumError     byte = 0x04
	StatusValidatorJammed      byte = 0x05
	StatusValidatorWasReset    byte = 0x06
	StatusBillRemoved          byte = 0x07
	StatusCashboxOutOfPosition byte = 0x08
	StatusValidatorDisabled    byte = 0x09
	StatusInvalidEscrowRequest byte = 0x0a
	StatusBillRejected         byte = 0x0b
	StatusCreditedBillRemoval  byte = 0x0c
)

bill poll status

View Source
const (
	StatusRoutingBillStacked byte = 0x80 | (iota << 4)
	StatusRoutingEscrowPosition
	StatusRoutingBillReturned
	StatusRoutingBillToRecycler
	StatusRoutingDisabledBillRejected
	StatusRoutingBillToRecyclerManualFill
	StatusRoutingManualDispense
	StatusRoutingTransferredFromRecyclerToCashbox
)

bill poll routing status

Variables

This section is empty.

Functions

func Enum

func Enum(ctx context.Context) error

Types

type BillCommand added in v0.230424.2

type BillCommand byte
const (
	Stop BillCommand
	ExecuteStop
	Accept
	ExecuteAccept
	Reject
	ExecuteReject
)

type BillValidator

type BillValidator struct {
	mdb.Device

	// dynamic state useful for external code
	EscrowBill currency.Nominal // assume only one bill may be in escrow position
	// contains filtered or unexported fields
}

func (*BillValidator) BillReset added in v0.230424.2

func (bv *BillValidator) BillReset() (err error)

func (*BillValidator) BillRun added in v0.230424.2

func (bv *BillValidator) BillRun(alive *alive.Alive, returnEvent func(money.ValidatorEvent))

прием банкнот ( если не принимал ранее). останавливаем по времени.

func (*BillValidator) BillStacked added in v0.230424.2

func (bv *BillValidator) BillStacked() bool

func (*BillValidator) DisableAccept added in v0.230424.2

func (bv *BillValidator) DisableAccept()

func (*BillValidator) EscrowAmount

func (bv *BillValidator) EscrowAmount() currency.Amount

func (*BillValidator) EscrowNominal added in v0.230424.2

func (bv *BillValidator) EscrowNominal() currency.Nominal

func (*BillValidator) GetState added in v0.230424.2

func (bv *BillValidator) GetState() BllStateType

func (*BillValidator) SendCommand added in v0.230424.2

func (bv *BillValidator) SendCommand(cmd BillCommand)

func (*BillValidator) SupportedNominals

func (bv *BillValidator) SupportedNominals() []currency.Nominal

type Biller

type Biller interface {
	SupportedNominals() []currency.Nominal
	EscrowAmount() currency.Amount
	EscrowNominal() currency.Nominal

	SendCommand(BillCommand)
	BillRun(*alive.Alive, func(money.ValidatorEvent))
	BillReset() error
	BillStacked() bool
	GetState() BllStateType
	DisableAccept()
}

type BllStateType added in v0.230424.2

type BllStateType byte
const (
	Broken BllStateType

	WaitConfigure
)

func (BllStateType) String added in v0.230424.2

func (b BllStateType) String() string

type Stub

type Stub struct{}

func (Stub) BillReset added in v0.230424.2

func (Stub) BillReset() error

func (Stub) BillRun added in v0.230424.2

func (Stub) BillRun(*alive.Alive, func(money.ValidatorEvent))

func (Stub) BillStacked added in v0.230424.2

func (Stub) BillStacked() bool

func (Stub) DisableAccept added in v0.230424.2

func (Stub) DisableAccept()

func (Stub) EscrowAmount

func (Stub) EscrowAmount() currency.Amount

func (Stub) EscrowNominal added in v0.230424.2

func (Stub) EscrowNominal() currency.Nominal

func (Stub) GetState added in v0.230424.2

func (Stub) GetState() BllStateType

func (Stub) SendCommand added in v0.230424.2

func (Stub) SendCommand(BillCommand)

func (Stub) SupportedNominals

func (Stub) SupportedNominals() []currency.Nominal

Jump to

Keyboard shortcuts

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