Cloud Interaction

Under Project Settings in PLTcloud, serial number allocation can be configured to use either monotonic counters, or through a webhook.

When using serial request, and a webhook is selected in PLTcloud, a JSON request will be sent containing:

{
    "dut_id": "<DUT IDENTIFIER>",
    "serial_number": "<SERIAL NUMBER>",
    "ble_mac": "<BLE MAC>",
    "mcu_id": "<MCU ID>",
    "MYCUSTOMKEY": "my custom value"
}

The API endpoint should return something like:

{
    "serial_number": "<SERIAL NUMBER>",
    "extra": {
       "name": "Ben"
    }
}

To extract the name field, use the serial request command as below:

title: Eventbrite
suite:
- ident: SCAN
  title: Scan
  steps:
  - command: scan ANY
    extractKey: BARCODE
- ident: WEBHOOK
  title: Lookup barcode
  steps:
  - command: serial request NAME:name
  - command: operator %NAME%
- ident: PRINT
  title: Print badge
  steps:
  - command: label keys NAME

Using serial set, the serial number can be set directly from the test plan, for example using a key extracted from a barcode scan:

title: Scan serial number
suite:
- steps:
  - command: scan ANY
    extractKey: BARCODE
  - command: serial set %BARCODE%

Commands