Class BeltCashboxDrawer

All Implemented Interfaces:
Runnable

public class BeltCashboxDrawer extends Device
JposDevice based implementation of some JavaPOS device service implementations for the sample device implemented in SampleUdpDevice.tcl. It becomes the following JavaPOS device services in combination with the corresponding DeviceClassServer classes: Belt, BillAcceptor, BillDispenser, CashChanger, CashDrawer, CoinAcceptor and CoinDispenser.

The simulator supports the following commands:

  • CashDrawer:
    • 'DRAWER:GetState': Status request. Sends back 'DRAWER:0' if drawer is closed, otherwise 'DRAWER:1'.
    • 'DRAWER:Open': Opens the drawer. Sends back the new status which is always 'DRAWER:1'.
  • Belt:
    • 'BELT:GetState': Status request. Sends back 'BELT:WXYZ' with the following values for W, X, Y and Z:
      • W: The current belt speed, 0 (stopped), 1 (slow) or 2 (faster),
      • X: The current motor state, 0 (ok), 1 (overheated) or 2 (defective),
      • Y: The current security flap state, 0 (closed) or 1 (open) and
      • Z: The current light barrier state, 0 (free) or 1 (interrupted).
    • 'BELT:SpeedX': Sets the belt speed. Valid values for X are 0 (stopped), 1 (slow) and 2 (faster). Sends back the belt status in the same format as for command BELT:GetState.
  • Cashbox:
    • 'CASHBOX:GetState': Command to retrieve the current state: Sends back 'GetStateNMO' where
      • N is 0: (one slot)Empty, 1: (one slot) Low, 2: OK,
      • M is 0: (one slot) Full, 1: (one slot) High, 2: OK and
      • O is 0: Operational, 1: Waiting for input, 2: Input stopped, 3: Jam, 4: Opened
    • 'GetInput': Command to retrieve current input amount in minimum units. Sends back 'GetInputN' where N is current input in minimum units.
    • 'OutputXN': Command to output N minimum X-units, where X =C for coins, =B for bills and =A for coins or bills. Sends back 'OutputM' where M is the minimum units that could be output (If M < N, at least one slot is empty)
    • 'StartInputX': Command to start cash input. Enables the '+' buttons. X specifies whether coins (1), bills (2) or both (3) shall be accepted. Sends back 'StartInputN' where N is the current input (normally 0) in minimum units.
    • 'StopInput': Command to stop cash input. Disables enabled '+' buttons. Sends back 'StopInputN' where N is the final input in minimum units.
    • 'EndInput': Command to finish cash input. Disables enabled '+' buttons. Sends back 'EndInputN' where N is the final input in minimum units.
    • 'CancelInput': Command to cancel input. Disables enabled '+' buttons and restores previous slot values. Sends back 'CancelInputN' where N is the cancelled input (normally 0) in minimum units.
    • 'GetSlots': Command to retrieve the current slot amounts. Sends back 'GetSlotsL', where L is a list of value pairs separated by spaces where the first value of each pair specifies the cash value and the second value the amount of cash units in a slot.
    • 'AddSlotsK': Command to add cash units to the corresponding slots. K is a list of value pairs separated by spaces, two values per slot, where the first value of each pair specifies the cash value and the second value the amount of cash units to be added. Sends back 'AddSlotsL', where L is a list of value pairs separated by spaces where the first value of each pair specifies the cash value and the second value the amount of cash units in a slot.
All frames have variable length. Communication will be made with UDP sockets.
Multiple commands can be sent in a single frame, separated by comma (,). The corresponding responses will be sent in one frame, separated by comma as well.
  • Constructor Details

    • BeltCashboxDrawer

      protected BeltCashboxDrawer(String id)
      Constructor. id specifies the server to be connected in format host:port.
      Parameters:
      id - IPv4 target address and port
  • Method Details

    • changeDefaults

      public void changeDefaults(CashDrawerProperties props)
      Description copied from class: JposDevice
      Change defaults of properties. Must be implemented within derived classed that support cash drawer services.
      Overrides:
      changeDefaults in class JposDevice
      Parameters:
      props - Property set for setting the property defaults
    • getCashDrawerProperties

      public CashDrawerProperties getCashDrawerProperties(int index)
      Description copied from class: JposDevice
      Returns device implementation of CashDrawerProperties.
      Overrides:
      getCashDrawerProperties in class JposDevice
      Parameters:
      index - Device index, see constructor of JposCommonProperties.
      Returns:
      Instance of CashDrawerProperties that matches the requirements of the corresponding device service.
    • changeDefaults

      public void changeDefaults(BeltProperties props)
      Description copied from class: JposDevice
      Change defaults of properties. Must be implemented within derived classed that support belt services.
      Overrides:
      changeDefaults in class JposDevice
      Parameters:
      props - Property set for setting the property defaults
    • getBeltProperties

      public BeltProperties getBeltProperties(int index)
      Description copied from class: JposDevice
      Returns device implementation of BeltProperties.
      Overrides:
      getBeltProperties in class JposDevice
      Parameters:
      index - Device index, see constructor of JposCommonProperties.
      Returns:
      Instance of BeltProperties that matches the requirements of the corresponding device service.
    • changeDefaults

      public void changeDefaults(BillAcceptorProperties props)
      Description copied from class: JposDevice
      Change defaults of properties. Must be implemented within derived classed that support bill acceptor services.
      Overrides:
      changeDefaults in class JposDevice
      Parameters:
      props - Property set for setting the property defaults
    • changeDefaults

      public void changeDefaults(BillDispenserProperties props)
      Description copied from class: JposDevice
      Change defaults of properties. Must be implemented within derived classed that support bill dispenser services.
      Overrides:
      changeDefaults in class JposDevice
      Parameters:
      props - Property set for setting the property defaults
    • changeDefaults

      public void changeDefaults(CashChangerProperties props)
      Description copied from class: JposDevice
      Change defaults of properties. Must be implemented within derived classed that support cash changer services.
      Overrides:
      changeDefaults in class JposDevice
      Parameters:
      props - Property set for setting the property defaults
    • changeDefaults

      public void changeDefaults(CoinAcceptorProperties props)
      Description copied from class: JposDevice
      Change defaults of properties. Must be implemented within derived classed that support coin acceptor services.
      Overrides:
      changeDefaults in class JposDevice
      Parameters:
      props - Property set for setting the property defaults
    • changeDefaults

      public void changeDefaults(CoinDispenserProperties props)
      Description copied from class: JposDevice
      Change defaults of properties. Must be implemented within derived classed that support coin dispenser services.
      Overrides:
      changeDefaults in class JposDevice
      Parameters:
      props - Property set for setting the property defaults
    • getBillAcceptorProperties

      public BillAcceptorProperties getBillAcceptorProperties(int index)
      Description copied from class: JposDevice
      Returns device implementation of BillAcceptorProperties.
      Overrides:
      getBillAcceptorProperties in class JposDevice
      Parameters:
      index - Device index, see constructor of JposCommonProperties.
      Returns:
      Instance of BillAcceptorProperties that matches the requirements of the corresponding device service.
    • getCoinAcceptorProperties

      public CoinAcceptorProperties getCoinAcceptorProperties(int index)
      Description copied from class: JposDevice
      Returns device implementation of CoinAcceptorProperties.
      Overrides:
      getCoinAcceptorProperties in class JposDevice
      Parameters:
      index - Device index, see constructor of JposCommonProperties.
      Returns:
      Instance of CoinAcceptorProperties that matches the requirements of the corresponding device service.
    • getCashChangerProperties

      public CashChangerProperties getCashChangerProperties(int index)
      Description copied from class: JposDevice
      Returns device implementation of CashChangerProperties.
      Overrides:
      getCashChangerProperties in class JposDevice
      Parameters:
      index - Device index, see constructor of JposCommonProperties.
      Returns:
      Instance of CashChangerProperties that matches the requirements of the corresponding device service.
    • getBillDispenserProperties

      public BillDispenserProperties getBillDispenserProperties(int index)
      Description copied from class: JposDevice
      Returns device implementation of BillDispenserProperties.
      Overrides:
      getBillDispenserProperties in class JposDevice
      Parameters:
      index - Device index, see constructor of JposCommonProperties.
      Returns:
      Instance of BillDispenserProperties that matches the requirements of the corresponding device service.
    • getCoinDispenserProperties

      public CoinDispenserProperties getCoinDispenserProperties(int index)
      Description copied from class: JposDevice
      Returns device implementation of CoinDispenserProperties.
      Overrides:
      getCoinDispenserProperties in class JposDevice
      Parameters:
      index - Device index, see constructor of JposCommonProperties.
      Returns:
      Instance of CoinDispenserProperties that matches the requirements of the corresponding device service.