Cashless Slave

The Cashless Peripheral implementation is ideal to simulate a cashless device efficiently to a VMC or a host.

Not every possible functionality is implemented, if you need specifics not found in the implementation, you can always use the generic peripheral mode to implement the complete cashless functionality yourself.

To configure the cashless device please see the Configuration section, where you will find the necessary commands to do so.

Commands

Enable/Disable the Cashless Peripheral

Enable/Disable the Cashless peripheral
Copy

Start a session (Vending Cycle)

Start a session (Vending Cycle)
Copy

If the VMC does not support always idle vend, the vending session has to be started by the peripheral .

If the cashless Master (VMC) has not activated the peripheral yet, this command will throw an error

Approve a vending request / Give Credit

Approve a vending request / Give Credit
Copy

Upon a vending request sent by the master, the peripheral must give the requested amount with the command presented above.

After this command, the VMC must finish the vend cycle and the cashless peripheral will go back to IDLE (waiting for session start)

Stop an inactive vend session

Use this command to cancel an ongoing vend session:

An Inactive Vend Session means that it was initiated by the Peripheral (only occurs in Idle/Authorization First mode) but was not followed up by the VMC, meaning that the credit was still not requested from the Cashless Peripheral.

Stop an inactive session
Copy

Stop an active vend session (Deny Credit Request)

An active vend session means that the Credit has already been requested by the Master, but not confirmed by the peripheral.

Bash
Copy

Accept/Deny a revalue request

In certain situations, the VMC might send a Revalue request to the peripheral. This can be triggered for whatever reason that may need the VMC to restore some funds to the card (like charging pre-paid cards with physical money). Once the Revalue is requested to the Cashless Peripheral, the VMC expects only an Accept or a Deny response. On the MDB interface, these answers can be sent as presented below:

Accept/Deny Revalue
Copy

Answers

Following is a table with possible answers and descriptions

AnswerDescription
c,ERR,"cashless is on"Cashless peripheralis already ON
c,ERR,"START -3"Cannot start session/vending cycle before VMC enables the peripheral
c,UNKNOWN," C"Bad command issued
c,STATUS,INACTIVEDevice is initialized but the machine has not been talking with it
c,STATUS,DISABLEDDevice is initialized and talks with the VMC but the VMC has disabled the cashless device
c,STATUS,ENABLEDThe device is enabled and a vend cycle can now be started
c,STATUS,IDLEDevice is Idle
c,STATUS,IDLE,Device has started the session and is waiting for VMC request (therefore it's idle)
c,STATUS,VEND,<price>,<item_number>The user has selected the product on the VMC and the VMC is waiting for a payment in the Cashless Peripheral (in this case, the MDB-USB/Pi Hat) . Note: <item_number> may not be transmitted from the vending machine to the Cashless Peripheral.
c,ERR,-3VMC has denied an ongoing Vending Cycle
c,VEND,SUCCESSFinished Successful Vending Cycle
c,ERR,VEND 1Vending has been cancelled (reported by the machine)
c,ERR,VEND 3Vending has failed (reported by the machine)
c,ERR,VEND 5The interface is in a vend cycle but the machine sends a general reset to the bus, resetting all peripherals
c,ERR,"VEND xx"

-3: Wrong state, command cannot be issued

-2: Invalid payload/argument

Display message on the vending machine

Some vending machines, allow connected Cashless Devices to send display requests to them, in response to polling. When this happens, it is possible to use the Cashless Terminal API to send a display request, if the cashless is in the Enabled state. To send a display request to the vending machine, the following command must be issued in the console:

Might be useful to control the display time of the message. Please check the Configuration section for further information.

Display Request
Copy
Example
Copy

Report Cash Sales

Some vending machines report cash sales to the Cashless Payment terminals. With these machines, it is possible to use our Cashless Terminal API to register the transactions and use this functionality as a part of a telemetry solution.

When a cash sale has happened, the Cashless Terminal API shows a message like the following:

Cash Sale
Copy
Example
Copy
Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard