Skip to main content

Emulation

The emulator is a tool that allows you to simulate the behavior of a vending machine. It is a useful tool for testing and debugging the software that interacts with the vending machine.

Information

In every method used is recommended send the instance of the class that is using the emulator.

Enable the Emulator

By default, the emulator is disabled. To enable it, you need to set the enable property to true in the configuration

import {Emulator} from '@danidoble/webserial';

Emulator.enable = true;

You need at least one class instance

import {Jofemar} from '@danidoble/webserial';

const machine = new Jofemar();

API

Set connection instance

As I said before, you need to set the instance of the class that is using the emulator.

But of course sending every time sounds like a lot of work, so you can set the connection instance. And then you can use the emulator methods without sending the instance.

Tip

Only if the instance is the same for all methods that you are going to use.

emulator.setConnection(machine);

Status

Simulate the status of the vending machine.

Emulator.status(machine)

Dispensed

Simulate the dispensing of a product.

Emulator.dispensed(machine)

Not Dispensed

Simulate the product not being dispensed.

Emulator.notDispensed(machine)

Gate inactive

Simulate the gate being inactive.

Information

Only works with Locker

Emulator.gateInactive(machine)

Gate configured

Simulate the gate being configured.

Information

Only works with Locker

Emulator.gateConfigured(machine)

Keyboard pressed

Simulate a key being pressed on the vending machine.

Information

Only works with Jofemar

Emulator.keyboardPressed(machine)

Door opened

Simulate the door being opened.

Information

Only works with Jofemar and Boardroid

emulator.doorOpened(machine);

Door closed

Simulate the door being closed.

Information

Only works with Jofemar and Boardroid

emulator.doorClosed(machine);

Channel disconnected

Simulate a channel disconnected.

Information

Only works with Jofemar

emulator.channelDisconnected(machine);

Channel connected

Simulate a channel connected.

Information

Only works with Jofemar

emulator.channelConnected(machine);

Channel empty

Simulate a channel being empty.

Information

Only works with Jofemar

emulator.channelEmpty(machine);

Working temperature

Simulate the working temperature of the vending machine.

Information

Only works with Jofemar

emulator.workingTemperature(machine);

Current temperature

Simulate the current temperature of the vending machine.

Information

Only works with Jofemar and Boardroid

emulator.currentTemperature(machine);

Ready

Simulate the Machine is ready

Information

Only works with Jofemar

emulator.ready(machine);

Busy

Simulate the Machine is busy

Information

Only works with Jofemar

emulator.busy(machine);

Invalid tray

Simulate an invalid tray.

Information

Only works with Jofemar

emulator.invalidTray(machine);

Invalid channel

Simulate an invalid channel.

Information

Only works with Jofemar

emulator.invalidChannel(machine);

Empty channel

Simulate an empty channel.

Information

Only works with Jofemar

emulator.emptyChannel(machine);

Elevator jam

Simulate an elevator jam.

Information

Only works with Jofemar

emulator.elevatorJam(machine);

Elevator malfunction

Simulate an elevator malfunction.

Information

Only works with Jofemar

emulator.elevatorMalfunction(machine);

Photo transistor failure

Simulate a photo transistor failure.

Information

Only works with Jofemar

emulator.phototransistorFailure(machine);

All channels empty

Simulate all channels being empty.

Information

Only works with Jofemar

emulator.allChannelsEmpty(machine);

Product detector failure

Simulate a product detector failure.

Information

Only works with Jofemar

emulator.productDetectorFailure(machine);

Display disconnected

Simulate the display is disconnected.

Information

Only works with Jofemar

emulator.displayDisconnected(machine);

Product under elevator

Simulate a product being under the elevator.

Information

Only works with Jofemar

emulator.productUnderElevator(machine);

Elevator setting alarm

Simulate the elevator setting an alarm.

Information

Only works with Jofemar

emulator.elevatorSettingAlarm(machine);

Button panel failure

Simulate a button panel failure.

Information

Only works with Jofemar

emulator.buttonPanelFailure(machine);

Error Writing EEPROM

Simulate an error writing to the EEPROM.

Information

Only works with Jofemar

emulator.errorWritingEeprom(machine);

Error in control temperature

Simulate an error in the control temperature.

Information

Only works with Jofemar

emulator.errorControlTemperature(machine);

Thermometer disconnected

Simulate the thermometer being disconnected.

Information

Only works with Jofemar

emulator.thermometerDisconnected(machine);

Thermometer misconfigured

Simulate the thermometer being misconfigured.

Information

Only works with Jofemar

emulator.thermometerMisconfigured(machine);

Thermometer failure

Simulate the thermometer failing.

Information

Only works with Jofemar

emulator.thermometerFailure(machine);

Error extractor consumption

Simulate an error in the extractor consumption.

Information

Only works with Jofemar

emulator.errorExtractorConsumption(machine);

Channel search error

Simulate a channel search error.

Information

Only works with Jofemar

emulator.channelSearchError(machine);

Product exit mouth search error

Simulate a product exit mouth search error.

Information

Only works with Jofemar

emulator.productExitMouthSearchError(machine);

Interior elevator blocked

Simulate the interior elevator being blocked.

Information

Only works with Jofemar

emulator.elevatorInteriorLocked(machine);

Product detector verifier error

Simulate a product detector verifier error.

Information

Only works with Jofemar

emulator.productDetectorVerifierError(machine);

Waiting for product recall

Simulate waiting for a product recall.

Information

Only works with Jofemar

emulator.waitingForProductRecall(machine);

Product expired by temperature

Simulate a product expiring due to temperature.

Information

Only works with Jofemar

emulator.productExpiredByTemperature(machine);

Faulty automatic door

Simulate a faulty automatic door.

Information

Only works with Jofemar

emulator.faultyAutomaticDoor(machine);

Reject lever

Simulate the reject lever was pressed.

Information

Only works with Boardroid

emulator.rejectLever(machine);

Reset coin purse

Simulate the coin purse being reset.

Information

Only works with Boardroid

emulator.resetCoinPurse(machine);

Coin inserted box

Simulate a coin being inserted into the box.

Information

Only works with Boardroid

emulator.coinInsertedBox(machine);

Coin inserted tube

Simulate a coin being inserted into the tube.

Information

Only works with Boardroid

emulator.coinInsertedTube(machine);

Banknote inserted stacker

Simulate a banknote being inserted into the stacker.

Information

Only works with Boardroid

emulator.banknoteInsertedStacker(machine);

Banknote inserted escrow

Simulate a banknote being inserted into the escrow.

Information

Only works with Boardroid

emulator.banknoteInsertedEscrow(machine);

Banknote ejected

Simulate a banknote being ejected.

Information

Only works with Boardroid

emulator.banknoteEjected(machine);

Banknote inserted recycler

Simulate a banknote being inserted into the recycler.

Information

Only works with Boardroid

emulator.banknoteInsertedRecycler(machine);

Banknote taken

Simulate a banknote being taken.

Information

Only works with Boardroid

emulator.banknoteTaken(machine);

Coin purse enabled

Simulate the coin purse being enabled.

Information

Only works with Boardroid

emulator.coinPurseEnabled(machine);

Coin purse disabled

Simulate the coin purse being disabled.

Information

Only works with Boardroid

emulator.coinPurseDisabled(machine);

Banknote purse disabled

Simulate the banknote purse being disabled.

Information

Only works with Boardroid

emulator.billPurseDisabled(machine);

banknote purse enabled

Simulate the banknote purse being enabled.

Information

Only works with Boardroid

emulator.billPurseEnabled(machine);

Read tubes

Simulate reading the tubes.

Information

Only works with Boardroid

emulator.readTubes(machine);

Reading banknote purse

Simulate reading the banknote purse.

Information

Only works with Boardroid

emulator.readBillPurse(machine);

Banknote accepted

Simulate a banknote being accepted.

Information

Only works with Boardroid

emulator.banknoteAccepted(machine);

Banknote rejected

Simulate a banknote being rejected.

Information

Only works with Boardroid

emulator.banknoteRejected(machine);

Banknotes dispensed

Simulate banknotes being dispensed.

Information

Only works with Boardroid

emulator.banknotesDispensed(machine);

Coins dispensed

Simulate coins being dispensed.

Information

Only works with Boardroid

emulator.coinsDispensed(machine);

Relay on

Simulate the relay being turned on.

Information

Only works with Boardroid

emulator.relayOn(machine);

Relay off

Simulate the relay being turned off.

Information

Only works with Boardroid

emulator.relayOff(machine);

Nayax enabled

Simulate the Nayax being enabled.

Information

Only works with Boardroid

emulator.nayaxEnabled(machine);

Nayax disabled

Simulate the Nayax being disabled.

Information

Only works with Boardroid

emulator.nayaxDisabled(machine);

Nayax pre-credit authorized

Simulate the Nayax pre-credit being authorized.

Information

Only works with Boardroid

emulator.nayaxPreCreditAuthorized(machine);

Nayax cancel request

Simulate the Nayax cancel request.

Information

Only works with Boardroid

emulator.nayaxCancelRequest(machine);

Nayax sell approved

Simulate the Nayax sell being approved.

Information

Only works with Boardroid

emulator.nayaxSellApproved(machine);

Nayax sell denied

Simulate the Nayax sell being denied.

Information

Only works with Boardroid

emulator.nayaxSellDenied(machine);

Nayax end session

Simulate the Nayax session ending.

Information

Only works with Boardroid

emulator.nayaxEndSession(machine);

Nayax cancelled

Simulate the Nayax being cancelled.

Information

Only works with Boardroid

emulator.nayaxCancelled(machine);

Nayax dispensed

Simulate the Nayax dispensing.

Information

Only works with Boardroid

emulator.nayaxDispensed(machine);

Nayax not dispensed

Simulate the Nayax not dispensing.

Information

Only works with Boardroid

emulator.nayaxNotDispensed(machine);

Full tray

Simulate a full tray.

Information

Only works with Jofemar

emulator.fullTray(machine);