coin

package
v0.210504.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2021 License: CC0-1.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeCount = 16
)

Variables

View Source
var (
	ErrNoCredit      = errors.Errorf("No Credit")
	ErrDoubleArrival = errors.Errorf("Double Arrival")
	ErrCoinRouting   = errors.Errorf("Coin Routing")
	ErrCoinJam       = errors.Errorf("Coin Jam")
	ErrSlugs         = errors.Errorf("Slugs")
)

Functions

func Enum

func Enum(ctx context.Context) error

Types

type CoinAcceptor

type CoinAcceptor struct {
	mdb.Device
	// contains filtered or unexported fields
}

func (*CoinAcceptor) AcceptMax

func (self *CoinAcceptor) AcceptMax(max currency.Amount) engine.Doer

func (*CoinAcceptor) CommandExpansionIdentification

func (self *CoinAcceptor) CommandExpansionIdentification() error

func (*CoinAcceptor) CommandFeatureEnable

func (self *CoinAcceptor) CommandFeatureEnable(requested Features) error

func (*CoinAcceptor) ExpansionDiagStatus

func (self *CoinAcceptor) ExpansionDiagStatus(result *DiagResult) error

CommandExpansionSendDiagStatus returns: - `nil` if command is not supported by device, result is not modified - otherwise returns nil or MDB/parse error, result set to valid DiagResult

func (*CoinAcceptor) NewCoinType

func (self *CoinAcceptor) NewCoinType(accept, dispense uint16) engine.Doer

func (*CoinAcceptor) NewDispense

func (self *CoinAcceptor) NewDispense(nominal currency.Nominal, count uint8) engine.Doer

MDB command DISPENSE (0d)

func (*CoinAcceptor) NewGive

func (self *CoinAcceptor) NewGive(requestAmount currency.Amount, over bool, success *currency.NominalGroup) engine.Doer

High-level dispense wrapper. Handles: - built-in payout or dispense-by-coin using expend strategy - give smallest amount >= requested

func (*CoinAcceptor) NewGiveLeastOver

func (self *CoinAcceptor) NewGiveLeastOver(requestAmount currency.Amount, success *currency.NominalGroup) engine.Doer

func (*CoinAcceptor) NewPayout

func (self *CoinAcceptor) NewPayout(amount currency.Amount, success *currency.NominalGroup) engine.Doer

MDB command PAYOUT (0f02)

func (*CoinAcceptor) Run

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

func (*CoinAcceptor) SupportedNominals

func (self *CoinAcceptor) SupportedNominals() []currency.Nominal

func (*CoinAcceptor) TubeStatus

func (self *CoinAcceptor) TubeStatus() error

func (*CoinAcceptor) Tubes

func (self *CoinAcceptor) Tubes() *currency.NominalGroup

type CoinRouting

type CoinRouting uint8
const (
	RoutingCashBox CoinRouting = 0
	RoutingTubes   CoinRouting = 1
	RoutingNotUsed CoinRouting = 2
	RoutingReject  CoinRouting = 3
)

func (CoinRouting) String

func (i CoinRouting) String() string

type Coiner

type Coiner interface {
	AcceptMax(currency.Amount) engine.Doer
	Run(context.Context, *alive.Alive, func(money.PollItem) bool)
	ExpansionDiagStatus(*DiagResult) error
	SupportedNominals() []currency.Nominal
	NewGive(currency.Amount, bool, *currency.NominalGroup) engine.Doer
	TubeStatus() error
	Tubes() *currency.NominalGroup
}

type DiagResult

type DiagResult []DiagStatus

func (DiagResult) Error

func (self DiagResult) Error() string

func (DiagResult) OK

func (self DiagResult) OK() bool

type DiagStatus

type DiagStatus uint16
const (
	DiagPoweringUp                 DiagStatus = 0x0100
	DiagPoweringDown               DiagStatus = 0x0200
	DiagOK                         DiagStatus = 0x0300
	DiagKeypadShifted              DiagStatus = 0x0400
	DiagManualActive               DiagStatus = 0x0510
	DiagNewInventoryInformation    DiagStatus = 0x0520
	DiagInhibited                  DiagStatus = 0x0600
	DiagGeneralError               DiagStatus = 0x1000
	DiagGeneralChecksum1           DiagStatus = 0x1001
	DiagGeneralChecksum2           DiagStatus = 0x1002
	DiagGeneralVoltage             DiagStatus = 0x1003
	DiagDiscriminatorError         DiagStatus = 0x1100
	DiagDiscriminatorFlightOpen    DiagStatus = 0x1110
	DiagDiscriminatorReturnOpen    DiagStatus = 0x1111
	DiagDiscriminatorJam           DiagStatus = 0x1130
	DiagDiscriminatorBelowStandard DiagStatus = 0x1141
	DiagDiscriminatorSensorA       DiagStatus = 0x1150
	DiagDiscriminatorSensorB       DiagStatus = 0x1151
	DiagDiscriminatorSensorC       DiagStatus = 0x1152
	DiagDiscriminatorTemperature   DiagStatus = 0x1153
	DiagDiscriminatorOptics        DiagStatus = 0x1154
	DiagAccepterError              DiagStatus = 0x1200
	DiagAccepterJam                DiagStatus = 0x1230
	DiagAccepterAlarm              DiagStatus = 0x1231
	DiagAccepterEmpty              DiagStatus = 0x1240
	DiagAccepterExitBeforeEnter    DiagStatus = 0x1250
	DiagSeparatorError             DiagStatus = 0x1300
	DiagSeparatorSortSensor        DiagStatus = 0x1310
	DiagDispenserError             DiagStatus = 0x1400
	DiagStorageError               DiagStatus = 0x1500
	DiagStorageCassetteRemoved     DiagStatus = 0x1502
	DiagStorageCashboxSensor       DiagStatus = 0x1503
	DiagStorageAmbientLight        DiagStatus = 0x1504
)

func (DiagStatus) String

func (i DiagStatus) String() string

type Features

type Features uint32
const (
	FeatureAlternativePayout Features = 1 << iota
	FeatureExtendedDiagnostic
	FeatureControlledManualFillPayout
	FeatureFTL
)

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) ExpansionDiagStatus

func (Stub) ExpansionDiagStatus(*DiagResult) error

func (Stub) NewGive

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

func (Stub) TubeStatus

func (Stub) TubeStatus() error

func (Stub) TubeStatus() error { return errors.NotSupportedf("coin.Stub.TubeStatus") }

func (Stub) Tubes

func (Stub) Tubes() *currency.NominalGroup

Jump to

Keyboard shortcuts

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