evend

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: 14 Imported by: 0

Documentation

Overview

Package evend incapsulates common parts of MDB protocol for eVend machine devices like conveyor, hopper, cup dispenser, elevator, etc.

Index

Constants

View Source
const (
	DefaultReadyTimeout = 5 * time.Second
	DefaultResetDelay   = 2100 * time.Millisecond
)
View Source
const ConveyorDefaultTimeout = 30 * time.Second
View Source
const ConveyorMinTimeout = 1 * time.Second
View Source
const DefaultShakeSpeed uint8 = 100
View Source
const DefaultTimeout = 60

Variables

This section is empty.

Functions

func EnumConveyor added in v0.220524.0

func EnumConveyor(ctx context.Context) error

func EnumCup added in v0.220524.0

func EnumCup(ctx context.Context) error

func EnumElevator added in v0.220524.0

func EnumElevator(ctx context.Context) error

func EnumEspresso added in v0.220524.0

func EnumEspresso(ctx context.Context) error

func EnumHopper added in v0.220524.0

func EnumHopper(ctx context.Context, hNo int) error

func EnumMixer added in v0.220524.0

func EnumMixer(ctx context.Context) error

func EnumMultiHopper added in v0.220524.0

func EnumMultiHopper(ctx context.Context) error

func EnumValve added in v0.220524.0

func EnumValve(ctx context.Context) error

Types

type BunkerDevice added in v0.231020.0

type BunkerDevice interface {
	// contains filtered or unexported methods
}

type DeviceConveyor

type DeviceConveyor struct {
	Generic

	DoSetSpeed engine.FuncArg
	// contains filtered or unexported fields
}

type DeviceCup

type DeviceCup struct {
	Generic
	// contains filtered or unexported fields
}
var Cup *DeviceCup

func (*DeviceCup) LightOff added in v0.240203.1

func (c *DeviceCup) LightOff() error

func (*DeviceCup) LightOn added in v0.240203.1

func (c *DeviceCup) LightOn() error

func (*DeviceCup) Reset added in v0.240203.1

func (c *DeviceCup) Reset() error

type DeviceElevator

type DeviceElevator struct {
	Generic
	// contains filtered or unexported fields
}

type DeviceErrorCode

type DeviceErrorCode byte

func (DeviceErrorCode) Error

func (c DeviceErrorCode) Error() string

type DeviceEspresso

type DeviceEspresso struct {
	Generic
	// contains filtered or unexported fields
}

type DeviceHopper

type DeviceHopper struct {
	Generic
}

type DeviceMixer

type DeviceMixer struct {
	Generic
	// contains filtered or unexported fields
}

func (*DeviceMixer) NewFan

func (m *DeviceMixer) NewFan(on bool) engine.Doer

type DeviceMultiHopper

type DeviceMultiHopper struct {
	Generic
}

type DeviceValve

type DeviceValve struct {
	Generic

	DoSetTempHot   engine.FuncArg
	DoPourCold     engine.Doer
	DoPourHot      engine.Doer
	DoPourEspresso engine.Doer
	// contains filtered or unexported fields
}
var EValve DeviceValve

func (*DeviceValve) GetTemperature added in v0.230424.2

func (dv *DeviceValve) GetTemperature() (int32, error)

func (*DeviceValve) NewPump

func (dv *DeviceValve) NewPump(start bool) engine.Doer

func (*DeviceValve) NewPumpEspresso

func (dv *DeviceValve) NewPumpEspresso(start bool) engine.Doer

func (*DeviceValve) NewValveBoiler

func (dv *DeviceValve) NewValveBoiler(open bool) engine.Doer

func (*DeviceValve) NewValveCold

func (dv *DeviceValve) NewValveCold(open bool) engine.Doer

func (*DeviceValve) NewValveHot

func (dv *DeviceValve) NewValveHot(open bool) engine.Doer

func (*DeviceValve) SetTemp added in v0.230424.2

func (dv *DeviceValve) SetTemp(temp uint8) (err error)

type ErrWaterTemperature

type ErrWaterTemperature struct {
	Source  string
	Current int16
	Target  int16
}

func (*ErrWaterTemperature) Error

func (e *ErrWaterTemperature) Error() string

type Generic

type Generic struct {
	// contains filtered or unexported fields
}

func (*Generic) Command added in v0.230424.2

func (gen *Generic) Command(args ...byte) (err error)

func (*Generic) CommandNoWait added in v0.230424.2

func (gen *Generic) CommandNoWait(cmd ...byte) (err error)

func (*Generic) CommandWaitSuccess added in v0.230424.2

func (gen *Generic) CommandWaitSuccess(count uint16, cmd ...byte) (err error)

func (*Generic) Diagnostic

func (gen *Generic) Diagnostic() (byte, error)

func (*Generic) Init

func (gen *Generic) Init(ctx context.Context, address uint8, name string, proto evendProtocol)

func (*Generic) Name

func (gen *Generic) Name() string

func (*Generic) NewAction

func (gen *Generic) NewAction(tag string, args ...byte) engine.Doer

func (*Generic) NewErrPollProblem

func (gen *Generic) NewErrPollProblem(p mdb.Packet) error

func (*Generic) NewErrPollUnexpected

func (gen *Generic) NewErrPollUnexpected(p mdb.Packet) error

func (*Generic) NewWaitDone

func (gen *Generic) NewWaitDone(tag string, timeout time.Duration) engine.Doer

NewWaitDone proto1/2 agnostic, use it after action

func (*Generic) NewWaitReady

func (gen *Generic) NewWaitReady(tag string) engine.Doer

NewWaitReady proto1/2 agnostic, use it before action

func (*Generic) Proto1PollWaitSuccess added in v0.230424.2

func (gen *Generic) Proto1PollWaitSuccess(count uint16, timeOut bool) (err error)

timeout count every 200 ms

func (*Generic) Proto2PollWaitSuccess added in v0.230424.2

func (gen *Generic) Proto2PollWaitSuccess(count uint16, timeOut bool, waitExetute bool) (err error)

func (*Generic) ReadError added in v0.230920.0

func (gen *Generic) ReadError() (err error)

func (*Generic) ReadError_proto2 added in v0.230424.2

func (gen *Generic) ReadError_proto2() (errb byte)

func (*Generic) WaitSuccess added in v0.230424.2

func (gen *Generic) WaitSuccess(count uint16, timeOut bool) error

func (*Generic) WithRestart

func (gen *Generic) WithRestart(d engine.Doer) *engine.RestartError

Directories

Path Synopsis
Separate package to for hardware/evend related config structure.
Separate package to for hardware/evend related config structure.

Jump to

Keyboard shortcuts

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