This command will read the value of all the input pins. The command by default will report the input values immediately. However, by setting the queue value to 0, the user can send the command to the normal priority queue, where the input values will be reported after all other commands before it are concluded.
Key, value pairs
Key
Value
Required
Description
"cmd"
"input"
Yes
Read input values.
"id"
Int (>0)
No
Id can be any positive integer. If id is not provided, status of the command will not be returned from the controller.
"queue"
0 / 1
No
If the value is 0, the command will be submitted to the normal priority queue. Otherwise, it will be submitted to the high priority queue. The default value 1.
Response
Key
Value
Description
"cmd"
"input"
The response of an input command will be a message with cmd field set to input.
"id"
Int (>0)
Same id as the original input command.
"in0", "in1", …, "in15"
0 / 1
The value of each input.
Example
{"cmd":"input", "id":5}
This command will read the input values and will respond with a message as follows which specifies the current value of each input pin.