public interface Cmd
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PID
Key ("pid") for PID identifier in JSON result.
|
static java.lang.String |
TS
Key ("ts") for timestamp in JSON result.
|
static java.lang.String |
VALUE
Key ("value") for the returned value in JSON result.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
id()
Unique identifier of the command.
|
boolean |
result(com.google.gson.JsonObject result,
byte[] reply)
Process the reply into a result.
|
void |
writeCmd(java.io.OutputStream out)
How the command is written to the serial port.
|
static final java.lang.String PID
static final java.lang.String TS
static final java.lang.String VALUE
void writeCmd(java.io.OutputStream out) throws java.io.IOException
out
- OutputStream to write bytes to.java.io.IOException
- Exception writing bytes.boolean result(com.google.gson.JsonObject result, byte[] reply)
result
- JSON object to populate with the result.reply
- Bytes that were returned from the command execution.true
result is valid, false
otherwise.java.lang.String id()
Copyright © 2016 The Apache Software Foundation. All Rights Reserved - bbe71fa-20161201-1641