FabLabKasse.cashPayment.server.mdbCash package

Submodules

FabLabKasse.cashPayment.server.mdbCash.mdb module

exception FabLabKasse.cashPayment.server.mdbCash.mdb.BusError[source]

Bases: exceptions.Exception

exception FabLabKasse.cashPayment.server.mdbCash.mdb.InterfaceHardwareError[source]

Bases: exceptions.Exception

class FabLabKasse.cashPayment.server.mdbCash.mdb.MdbCashDevice(port, addr=1, extensionConfig=None)[source]

Bases: object

ACK = 0
BUSY = 'busy'
CMD_COIN_TYPE = 4
CMD_DISPENSE = 5
CMD_EXPANSION = 7
CMD_POLL = 3
CMD_RESET = 0
CMD_SETUP = 1
CMD_TUBE_STATUS = 2
ERROR = 'error'
IGNORE = 'ignore'
JUST_RESET = 'just reset'
NAK = 255
RET = 170
WARNING = 'warning'
checksum(data)[source]
cmd(command, data=None)[source]
dispenseCoin(type, amount)[source]
dispenseValue(maximumDispense)[source]
error(s)[source]
extensionCmd(data)[source]

in addition to the MDB commands, the interface hardware provides extension commands for other features (LEDs, hopper, …). Failure on these commands is not tolerated.

flushRead()[source]
getPossiblePayout()[source]
getSetup()[source]
getSortedCoinValues()[source]
getTubeStatus()[source]
getValue(type)[source]
log(s)[source]
poll(wasJustReset=False)[source]

get events from device. :param wasJustReset: set this to True at the first poll after the RESET command

printDebug(s, debugLevel)[source]
read()[source]
reset()[source]
serialCmd(text)[source]
setAcceptCoins(acceptCoins, manualDispenseEnabled=False)[source]
setLEDs(leds)[source]

set RGB-LED color via extension command, if it is enabled in the extensionConfig. :param leds: list of two LED color values. color value: RR GG BB in hex plus a mode of N (normal) or special modes B (blink) or T (timeout: switch off after 20 sec) e.g. “00FF00N” = green normal, “FF0000B” = red blink, “0000FFT” = blue with timeout (will switch off after 20sec or the next command)

statusEvents = {1: ['Escrow request', 'ignore'], 2: ['Payout Busy', 'busy'], 3: ['valid coin did not get to the place where credit is given', 'warning'], 4: ['Defective Tube Sensor', 'warning'], 5: ['Double Arrival', 'ignore'], 6: ['Acceptor unplugged', 'error'], 7: ['Tube jam', 'warning'], 8: ['ROM checksum error', 'error'], 9: ['coin routing error', 'error'], 10: ['Busy', 'busy'], 11: ['Was just reset', 'just reset'], 12: ['Coin jam', 'warning'], 13: ['Possible credited coin removal', 'warning']}
tryDispenseCoinFromExternalHopper()[source]

dispense a coin from an external non-MDB hopper connected directly to the interface board. :returns: False if it failed (or no external hopper is enabled), True if one coin was dispensed

warn(s)[source]
exception FabLabKasse.cashPayment.server.mdbCash.mdb.MissingResetEventError[source]

Bases: exceptions.Exception

Module contents