coin

package
v0.231214.0 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: CC0-1.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeCount = 16
)

Variables

View Source
var (
	ErrNoCredit      = errors.New("no Credit")
	ErrDoubleArrival = errors.New("double Arrival")
	ErrCoinRouting   = errors.New("coin Routing")
	ErrCoinJam       = errors.New("coin Jam")
	ErrSlugs         = errors.New("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 (ca *CoinAcceptor) AcceptMax(max currency.Amount) engine.Doer

func (*CoinAcceptor) CoinReset added in v0.230424.2

func (ca *CoinAcceptor) CoinReset() (err error)

func (*CoinAcceptor) CoinRun added in v0.230424.2

func (ca *CoinAcceptor) CoinRun(alive *alive.Alive, returnEvent func(money.ValidatorEvent))

func (*CoinAcceptor) CommandExpansionIdentification

func (ca *CoinAcceptor) CommandExpansionIdentification() error

func (*CoinAcceptor) CommandFeatureEnable

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

func (*CoinAcceptor) DisableAccept added in v0.230424.2

func (ca *CoinAcceptor) DisableAccept()

func (*CoinAcceptor) Dispence added in v0.230424.2

func (ca *CoinAcceptor) Dispence(amount currency.Amount) (err error)

func (*CoinAcceptor) DispenceCoin added in v0.230424.2

func (ca *CoinAcceptor) DispenceCoin(nominal currency.Nominal) (complete bool, err error)

func (*CoinAcceptor) EnableAccept added in v0.230424.2

func (ca *CoinAcceptor) EnableAccept(maximumNominal currency.Amount) (err error)

func (*CoinAcceptor) ExpansionDiagStatus

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

func (*CoinAcceptor) NewCoinType

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

func (*CoinAcceptor) NewDispense

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

MDB command DISPENSE (0d)

func (*CoinAcceptor) NewGive

func (ca *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 (ca *CoinAcceptor) NewGiveLeastOver(requestAmount currency.Amount, success *currency.NominalGroup) engine.Doer

func (*CoinAcceptor) NewPayout

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

MDB command PAYOUT (0f02)

func (*CoinAcceptor) SupportedNominals

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

func (*CoinAcceptor) TestingDispense added in v0.231111.0

func (ca *CoinAcceptor) TestingDispense()

func (*CoinAcceptor) TubeStatus

func (ca *CoinAcceptor) TubeStatus() error

func (*CoinAcceptor) Tubes

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

type CoinCommand added in v0.230424.2

type CoinCommand byte
const (
	Stop CoinCommand
)

type CoinRouting

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

type Coiner

type Coiner interface {
	AcceptMax(currency.Amount) engine.Doer
	ExpansionDiagStatus(*DiagResult) error
	SupportedNominals() []currency.Nominal
	NewGive(currency.Amount, bool, *currency.NominalGroup) engine.Doer
	TubeStatus() error
	Tubes() *currency.NominalGroup
	TestingDispense()
	CoinRun(*alive.Alive, func(money.ValidatorEvent))
	DisableAccept()
	Dispence(currency.Amount) error
}

type DiagResult

type DiagResult []DiagStatus

func (DiagResult) Error

func (dr DiagResult) Error() string

func (DiagResult) OK

func (dr 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) CoinRun added in v0.230424.2

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

func (Stub) DisableAccept added in v0.230424.2

func (Stub) DisableAccept()

func (Stub) Dispence added in v0.230424.2

func (Stub) Dispence(currency.Amount) error

func (Stub) ExpansionDiagStatus

func (Stub) ExpansionDiagStatus(*DiagResult) error

func (Stub) NewGive

func (Stub) SupportedNominals

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

func (Stub) TestingDispense added in v0.231111.0

func (Stub) TestingDispense()

func (Stub) TubeStatus

func (Stub) TubeStatus() error

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