displayQR
The displayQR
method displays a QR code on the terminal's screen. It supports optional titles, subtitles, and a cancel button. The QR code must belong to a predefined domain.
Request
JSON-RPC 2.0
All methods in TweezerComm follow a JSON-RPC 2.0 structure. See Get Startedfor more details on how the requests are structured and sent.
To invoke this method, set the method
field to displayQR
, and include the service name and parameters as shown below.
{
"jsonrpc": "2.0",
"method": "displayQR",
"params": [
"device",
{
"title": "displayQRtitle",
"subtitle": "displayQRSubtitle",
"isCancellable": false,
"urlData": "https://stackoverflow.com",
"timeout": 60
}
],
"id": "32323453"
}
Request Parameters
The table below describes the parameters of the request:
Name | Type | Description |
---|---|---|
title | string | Title text to be shown above the QR code |
subtitle | string | Subtitle text below the title |
isCancellable | boolean | Whether a cancel button is displayed (default: true) |
urlData | string | URL encoded as the QR code (mandatory) |
timeout | integer | Display timeout in seconds (default: 30) |
Response
A successful request will return the following response:
{
"jsonrpc": "2.0",
"id": "1",
"result": {
"statusCode": 0,
"statusMessage": "ok"
}
}
Response Parameters
The table below describes the response parameters for this method:
Name | Type | Description |
---|---|---|
statusCode | integer | Operation status (0 = success) |
statusMessage | string | Message indicating operation result |
Updated 8 days ago