Skip to main content

OakOS

Display and Touch

Last updated: 15-Oct-2020

:danger: Display and Touch Configure

As of 6.0.0 version of OakOS, these configurations have been deprecated. They will still work as expected in prior versions. The Info end points will still return info

Display Info

Lists displays, current configuration and supported configurations. By running this request first to get the displayId we can use that id to set the display rotate direction. The same will be the method for the touchDeviceId

Display Info Url

http://{{dashboardHost}}/api/{{dashboardVersion}}/machine/{{dashboardMachine}}/display/info

this will return a list of displays with the information for each display listed. Here is a typical response

{
  "code": "",
  "details": "",
  "body": {
    "displays": [
      {
        "available_modes": [],
        "display_id": "DP1",
        "configuration": {
          "enabled": false,
          "mode": "",
          "reflect": "NO_REFLECT",
          "rotate": "NO_ROTATE",
          "transform": ""
        },
        "preferred_mode": ""
      },
      {
        "available_modes": [
          "640x480@59.94",
          "640x480@60.00",
          "720x400@70.08",
          "720x480@59.94",
          "720x480@60.00",
          "720x576@50.00",
          "800x500@60.01",
          "800x600@56.25",
          "800x600@60.32",
          "1024x768@60.00",
          "1280x720@59.94",
          "1280x720@60.00",
          "1280x800@59.91",
          "1280x1024@60.02",
          "1366x768@59.79",
          "1440x900@59.90",
          "1680x1050@59.88",
          "1920x1080@50.00",
          "1920x1080@59.94",
          "1920x1080@60.00"
        ],
        "display_id": "DP2",
        "configuration": {
          "enabled": true,
          "mode": "1920x1080@60.00",
          "reflect": "NO_REFLECT",
          "rotate": "NO_ROTATE",
          "transform": ""
        },
        "preferred_mode": "1920x1080@60.00"
      },
      {
        "available_modes": [],
        "display_id": "VIRTUAL1",
        "configuration": {
          "enabled": false,
          "mode": "",
          "reflect": "NO_REFLECT",
          "rotate": "NO_ROTATE",
          "transform": ""
        },
        "preferred_mode": ""
      }
    ],
    "global_configuration": {
      "dpi": 96
    }
  }
}

in the postman test tab we can set environmental variable to use in the Display Configuration. When in doubt, it is recommended that every display is configured with its preferred_mode.

v5 Test Script

var jsonData = pm.response.json();
console.log("Display results", jsonData)
var display = {}
var preferred_mode = ""
for (var p in jsonData.body.displays) {
    console.log("Display", jsonData.body.displays[p])
    if (jsonData.body.displays[p].configuration.enabled) {
        display = jsonData.body.displays[p];
        preferred_mode = jsonData.body.displays[p].preferred_mode;
        break;
    } else {
        display = jsonData.body.displays[0];
        preferred_mode = jsonData.body.displays[0].preferred_mode;
    }
}
console.log("DISPLAY: ",display)
pm.environment.set("display", JSON.stringify(display));
pm.environment.set("display.display_id", JSON.stringify(display.display_id));
pm.environment.set("display.configuration.enabled", JSON.stringify(display.configuration.enabled));
pm.environment.set("display.configuration.mode", JSON.stringify(preferred_mode));
pm.environment.set("display.configuration.reflect", JSON.stringify(display.configuration.reflect));
pm.environment.set("display.configuration.rotate", JSON.stringify(display.configuration.rotate));
pm.environment.set("display.configuration.transform", JSON.stringify(display.configuration.transform));

console.log(pm.environment)

Notice that all JSON objects need to be stringified in order to store them as environmental variables. From the above response we can set postman variables and use them in the next step

Display Configure

:danger: Deprecated as of OakOS v6.x +

Applies configuration to a specific display

Display Configure Url

http://{{dashboardHost}}/api/{{dashboardVersion}}/machine/{{dashboardMachine}}/touch/info

JSON Request

{
    "display_id": {{display.display_id}},
    "configuration": {
        "enabled": {{display.configuration.enabled}},
        "mode": {{display.configuration.mode}},
        "reflect": {{display.configuration.reflect}},
        "rotate": "LEFT",
        "transform": {{display.configuration.transform}}
    }
}

The rotate possible values are:

  • NO_ROTATE
  • LEFT
  • RIGHT
  • INVERTED

Display Configure Global

Applies configuration that affects all displays. At the time of this writing the only thing in here is the dpi setting. When in doubt, it is recommended that every display is configured with the DPI be set to 96.

{
  "dpi": 96
}

Touch Info

Lists touch interfaces that can be configured

Touch Info Url

http://{{dashboardHost}}/api/{{dashboardVersion}}/machine/{{dashboardMachine}}/touch/info

GET Response

{
  "code": "",
  "details": "",
  "body": {
    "touch_devices": [
      {
        "touch_device_id": "Elo_Touch_Solutions_E801039_Edgley",
        "configuration": {
          "calibration": "",
          "orientation": "FORWARD_UPRIGHT"
        }
      }
    ]
  }
}

The following test script is used to choose and set the touch touchDeviceId

v5 Test Script

var jsonData = pm.response.json();
console.log(jsonData)
var id = jsonData.body.touchDevices[0].touch_device_id;
pm.environment.set("touch_device_id", JSON.stringify(id));

Touch Configure

:danger: Deprecated as of OakOS v6.x +"

Applies configuration to a touch interface

Configure Request Body

{
 "touch_device_id": {{touch_device_id}},
 "configuration" : {
 "orientation": "FORWARD_LEFT"
}

The available orientations are:

  • FORWARD_UPRIGHT
  • FORWARD_LEFT
  • FORWARD_RIGHT
  • FORWARD_INVERTED
  • BACKWARD_UPRIGHT
  • BACKWARD_LEFT
  • BACKWARD_RIGHT
  • BACKWARD_INVERTED

Need help?

Do you have a question? If you didn’t find the answer you are looking for in our documentation, you can contact our Support teams for more information. If you have a technical issue or question, please contact us. We are happy to help.

Not yet a Verifone customer?

We’ll help you choose the right payment solution for your business, wherever you want to sell, in-person or online. Our team of experts will happily discuss your needs.

Verifone logo