Display
Displays are output devices, which do not require claiming. Status information will be reported inside the POST, and display messages can be passed back by the server inside the JSON POST response.
Inside the JSON POST, a "display" field will provide an array of JSON objects in the following format:
{
"name": "<device logical name>",
"status": { "connected": bool }
}
- "name" - specifies a logical device name to uniquely identify the display. This name may be used to claim the "display" in order to send a message to show on the display device.
- "status" - an object describing the device status, containing a field:
- "connected" - a Boolean value, true if the display is physically connected and false otherwise.
Sending messages to the display, is handled by specifying a "display" field in the JSON POST response form the server back to the client.
Messages are strings which can use a simple markup format.
Command | Function |
---|---|
[cls] | Clear display, and reset cursor to home position. |
[home] | Reset cursor to home position. |
[nl] | New Line, moves cursor to the beginning of the next line. |
[http://...] [https://...] | Display image from URL. The CloudPRNT device will download a PNG or Jpeg image from the specified url and draw to the display (If image display is supported). |
[enc <encoding>] | Set display text encoding to <encoding>. |
The markup language is sent as plain text strings through JSON, which will be displayed directly. Special commands can be embedded inside the square bracket '[' ']' sets.
Escaping is supported for characters which might otherwise not be possible to insert. The characters '', '[' and ']' can be escaped with the sequences "\", "[" and "]" respectively.
Hex data sequences can be inserted with the escape "\xHH", where "HH" is a double digit hex value.