Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

These REST calls define separate demo modes for the cabinet. Note they do not work all in the same way. Some might have state, some don’t.

URL

http://<<ip address>>/rest/cabinet/demo/

random-pick

Method

PUT

Description

Switches on 3-6 random lights, with a number randomised between 1 and 5. This demo is disabled by switching all lights off, or by pushing all lights.

This demo mode is stateless.

Request

Ignored

Response

HTTP204 when successful

Possible Errors

None

Status

Status
colourGreen
titleimplemented

URL

http://<<ip address>>/rest/cabinet/demo/mode

Method

PUT

Description

Enables a stateful demo mode or runs a stateless demo.

barcode is the mode that accepts different barcodes to run demos (see below).

off switches off all demo modes.

Request

Code Block
{
    "mode": "random-pick|barcode|off"
}

Response

HTTP204 when successful

Subsequent GET calls to rest/cabinet will have barcode the mode set in the demo mode field, when switched onfor stateful demos, or off when switched off.

Possible Errors

Noneno stateful mode is selected.

Stateless modes will result in the mode being set to off when requesting the cabinet information.

When the cabinet is already in a demo mode, it will be completely reset and the new mode will be started.

Possible Errors

HTTP400 when an invalid demo mode is selected. Demo mode will be off afterwards.

Status

Status
colourYellowGreen
titlependingimplemented

Demo descriptions

random-pick

Switches on 3-6 random lights, with a number randomized between 1 and 5. This demo is disabled by switching all lights off, or by pushing all lights.

This demo mode is stateless.

barcode

Enables the barcode scanning demos. See below for behavior when a barcode is sent.

The demo mode is stateful.

URL

http://<<ip address>>/rest/cabinet/demo/barcode/«barcode»

Method

POST

Description

Triggers the processing of barcode «barcode» when in demo mode barcode.

Ignored otherwise.

Request

None

Response

HTTP204 when successful

Possible Errors

None

Status

Status
colourYellowGreen
titlependingimplemented

Extra Information

The following barcodes will have effect:

  • Starting with a 1: The pick demo will be triggered:

    • A random light will light up, with a random number.

    • When the light is clicked, the next will light up.

    • This will repeat three times.

When a ‘new’ code is sent, any previous state will be reset.