bill

package
v0.221115.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2022 License: CC0-1.0 Imports: 15 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
)
View Source
const (
	StatusRoutingBillStacked byte = 0x80 | (iota << 4)
	StatusRoutingEscrowPosition
	StatusRoutingBillReturned
	StatusRoutingBillToRecycler
	StatusRoutingDisabledBillRejected
	StatusRoutingBillToRecyclerManualFill
	StatusRoutingManualDispense
	StatusRoutingTransferredFromRecyclerToCashbox
)
View Source
const DefaultEscrowTimeout = 30 * time.Second
View Source
const (
	TypeCount = 16
)

Variables

View Source
var (
	ErrDefectiveMotor   = errors.New("Defective Motor")
	ErrBillRemoved      = errors.New("Bill Removed")
	ErrEscrowImpossible = errors.New("An ESCROW command was requested for a bill not in the escrow position.")
	ErrAttempts         = errors.New("Attempts")
	ErrEscrowTimeout    = errors.New("ESCROW timeout")
)

Functions

func Enum

func Enum(ctx context.Context) error

Types

type BillValidator

type BillValidator struct {
	mdb.Device

	DoEscrowAccept engine.Func
	DoEscrowReject engine.Func
	DoStacker      engine.Func
	// contains filtered or unexported fields
}

func (*BillValidator) AcceptMax

func (bv *BillValidator) AcceptMax(max currency.Amount) engine.Doer

func (*BillValidator) CommandExpansionIdentification

func (bv *BillValidator) CommandExpansionIdentification() error

func (*BillValidator) CommandExpansionIdentificationOptions

func (bv *BillValidator) CommandExpansionIdentificationOptions() error

func (*BillValidator) CommandFeatureEnable

func (bv *BillValidator) CommandFeatureEnable(requested Features) error

func (*BillValidator) CommandSetup

func (bv *BillValidator) CommandSetup(ctx context.Context) error

func (*BillValidator) EscrowAccept

func (bv *BillValidator) EscrowAccept() engine.Doer

func (*BillValidator) EscrowAmount

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

func (*BillValidator) EscrowReject

func (bv *BillValidator) EscrowReject() engine.Doer

func (*BillValidator) NewBillType

func (bv *BillValidator) NewBillType(accept, escrow uint16) engine.Doer

func (*BillValidator) Run

func (bv *BillValidator) Run(ctx context.Context, alive *alive.Alive, fun func(money.PollItem) bool)

func (*BillValidator) SupportedNominals

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

type Biller

type Biller interface {
	AcceptMax(currency.Amount) engine.Doer
	Run(context.Context, *alive.Alive, func(money.PollItem) bool)
	SupportedNominals() []currency.Nominal
	EscrowAmount() currency.Amount
	EscrowAccept() engine.Doer
	EscrowReject() engine.Doer
}

type Features

type Features uint32
const (
	FeatureFTL Features = 1 << iota
	FeatureRecycling
)

func (Features) String

func (i Features) String() string

type Stub

type Stub struct{}

func (Stub) AcceptMax

func (Stub) AcceptMax(currency.Amount) engine.Doer

func (Stub) EscrowAccept

func (Stub) EscrowAccept() engine.Doer

func (Stub) EscrowAccept() engine.Doer { return engine.Fail{E: errors.NotSupportedf("bill.Stub.EscrowAccept")} } func (Stub) EscrowReject() engine.Doer { return engine.Fail{E: errors.NotSupportedf("bill.Stub.EscrowReject")} }

func (Stub) EscrowAmount

func (Stub) EscrowAmount() currency.Amount

func (Stub) EscrowReject

func (Stub) EscrowReject() engine.Doer

func (Stub) Run

func (Stub) Run(ctx context.Context, alive *alive.Alive, fun func(money.PollItem) bool)

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